I have created TabBar Menu using GDScript in Godot game engine version 4.2.1 and these menus consist of 4 different icons.
There is a card in png format in the background of these menus and when I press the icons, I want the icons to grow a little and the background to get a different color. Can you explain in detail how to do this?
The background color for the selected tab can be changed by modifying the theme (or theme override) for the TabContainer. Create a StyleBoxFlat with a new background color and override it for “tab_selected” for the TabContainer.
For changing the icon size, I think you need to change to a different version of the icon. It doesn’t seem to be controllable through a theme.
Here’s code for changing the background theme (tab_container is the created object to your TabContainer).
var selected_tab_style : StyleBoxFlat = StyleBoxFlat.new()
selected_tab_style.bg_color = Color.PINK
tab_container.add_theme_stylebox_override("tab_selected", selected_tab_style)