Overrides the [Color] with given [code]name[/code] in the [member theme] resource the control uses.
Creates a local override for a theme [Color] with the specified [code]name[/code]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_color_override].
See also [method get_theme_color].
[b]Example of overriding a label's color and resetting it later:[/b]
[codeblocks]
[gdscript]
# Override the child node "MyLabel"'s font color to orange.
# Given the child Label node "MyLabel", override its font color with a custom value.
Overrides an integer constant with given [code]name[/code] in the [member theme] resource the control uses.
Creates a local override for a theme constant with the specified [code]name[/code]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_constant_override].
See also [method get_theme_constant].
</description>
</method>
<methodname="add_theme_font_override">
@ -274,7 +278,8 @@
<argumentindex="1"name="font"type="Font">
</argument>
<description>
Overrides the font with given [code]name[/code] in the [member theme] resource the control uses.
Creates a local override for a theme [Font] with the specified [code]name[/code]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_font_override].
See also [method get_theme_font].
</description>
</method>
<methodname="add_theme_font_size_override">
@ -285,7 +290,8 @@
<argumentindex="1"name="font_size"type="int">
</argument>
<description>
Overrides the font size with given [code]name[/code] in the [member theme] resource the control uses.
Creates a local override for a theme font size with the specified [code]name[/code]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_font_size_override].
See also [method get_theme_font_size].
</description>
</method>
<methodname="add_theme_icon_override">
@ -296,7 +302,8 @@
<argumentindex="1"name="texture"type="Texture2D">
</argument>
<description>
Overrides the icon with given [code]name[/code] in the [member theme] resource the control uses.
Creates a local override for a theme icon with the specified [code]name[/code]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_icon_override].
See also [method get_theme_icon].
</description>
</method>
<methodname="add_theme_stylebox_override">
@ -307,7 +314,8 @@
<argumentindex="1"name="stylebox"type="StyleBox">
</argument>
<description>
Overrides the [StyleBox] with given [code]name[/code] in the [member theme] resource the control uses.
Creates a local override for a theme [StyleBox] with the specified [code]name[/code]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_stylebox_override].
See also [method get_theme_stylebox].
[b]Example of modifying a property in a StyleBox by duplicating it:[/b]
Returns a color from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code].
Returns a [Color] from the first matching [Theme] in the tree if that [Theme] has a color item with the specified [code]name[/code] and [code]theme_type[/code]. If [code]theme_type[/code] is omitted the class name of the current control is used as the type, or [member theme_type_variation] if it is defined. If the type is a class name its parent classes are also checked, in order of inheritance. If the type is a variation its base types are checked, in order of dependency, then the control's class name and its parent classes are checked.
For the current control its local overrides are considered first (see [method add_theme_color_override]), then its assigned [member theme]. After the current control, each parent control and its assigned [member theme] are considered; controls without a [member theme] assigned are skipped. If no matching [Theme] is found in the tree, a custom project [Theme] (see [member ProjectSettings.gui/theme/custom]) and the default [Theme] are used.
[codeblocks]
[gdscript]
func _ready():
modulate = get_theme_color("font_color", "Button") #get the color defined for button fonts
# Get the font color defined for the current Control's class, if it exists.
modulate = get_theme_color("font_color")
# Get the font color defined for the Button class.
Returns a constant from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code].
Returns a constant from the first matching [Theme] in the tree if that [Theme] has a constant item with the specified [code]name[/code] and [code]theme_type[/code].
Returns a font from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code].
Returns a [Font] from the first matching [Theme] in the tree if that [Theme] has a font item with the specified [code]name[/code] and [code]theme_type[/code].
Returns a font size from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code].
Returns a font size from the first matching [Theme] in the tree if that [Theme] has a font size item with the specified [code]name[/code] and [code]theme_type[/code].
Returns an icon from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code].
Returns an icon from the first matching [Theme] in the tree if that [Theme] has an icon item with the specified [code]name[/code] and [code]theme_type[/code].
Returns a [StyleBox] from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code].
Returns a [StyleBox] from the first matching [Theme] in the tree if that [Theme] has a stylebox item with the specified [code]name[/code] and [code]theme_type[/code].
Returns [code]true[/code] if [Color] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code] exists in assigned [Theme].
Returns [code]true[/code] if there is a matching [Theme] in the tree that has a color item with the specified [code]name[/code] and [code]theme_type[/code].
Returns [code]true[/code] if constant with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code] exists in assigned [Theme].
Returns [code]true[/code] if there is a matching [Theme] in the tree that has a constant item with the specified [code]name[/code] and [code]theme_type[/code].
Returns [code]true[/code] if font with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code] exists in assigned [Theme].
Returns [code]true[/code] if there is a matching [Theme] in the tree that has a font item with the specified [code]name[/code] and [code]theme_type[/code].
Returns [code]true[/code] if font size with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code] exists in assigned [Theme].
Returns [code]true[/code] if there is a matching [Theme] in the tree that has a font size item with the specified [code]name[/code] and [code]theme_type[/code].
Returns [code]true[/code] if icon with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code] exists in assigned [Theme].
Returns [code]true[/code] if there is a matching [Theme] in the tree that has an icon item with the specified [code]name[/code] and [code]theme_type[/code].
Returns [code]true[/code] if [StyleBox] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code] exists in assigned [Theme].
Returns [code]true[/code] if there is a matching [Theme] in the tree that has a stylebox item with the specified [code]name[/code] and [code]theme_type[/code].
Returns [code]true[/code] if [StyleBox] with given [code]name[/code] has a valid override in this [Control] node.
Returns [code]true[/code] if there is a local override for a theme [StyleBox] with the specified [code]name[/code] in this [Control] node.
See [method add_theme_stylebox_override].
</description>
</method>
<methodname="is_layout_rtl"qualifiers="const">
@ -727,7 +759,7 @@
<argumentindex="0"name="name"type="StringName">
</argument>
<description>
Removes a theme override for a [Color] with the given [code]name[/code].
Removes a local override for a theme [Color] with the specified [code]name[/code] previously added by [method add_theme_color_override] or via the Inspector dock.
</description>
</method>
<methodname="remove_theme_constant_override">
@ -736,7 +768,7 @@
<argumentindex="0"name="name"type="StringName">
</argument>
<description>
Removes a theme override for a constant with the given [code]name[/code].
Removes a local override for a theme constant with the specified [code]name[/code] previously added by [method add_theme_constant_override] or via the Inspector dock.
</description>
</method>
<methodname="remove_theme_font_override">
@ -745,7 +777,7 @@
<argumentindex="0"name="name"type="StringName">
</argument>
<description>
Removes a theme override for a [Font] with the given [code]name[/code].
Removes a local override for a theme [Font] with the specified [code]name[/code] previously added by [method add_theme_font_override] or via the Inspector dock.
</description>
</method>
<methodname="remove_theme_font_size_override">
@ -754,7 +786,7 @@
<argumentindex="0"name="name"type="StringName">
</argument>
<description>
Removes a theme override for a font size with the given [code]name[/code].
Removes a local override for a theme font size with the specified [code]name[/code] previously added by [method add_theme_font_size_override] or via the Inspector dock.
</description>
</method>
<methodname="remove_theme_icon_override">
@ -763,7 +795,7 @@
<argumentindex="0"name="name"type="StringName">
</argument>
<description>
Removes a theme override for an icon with the given [code]name[/code].
Removes a local override for a theme icon with the specified [code]name[/code] previously added by [method add_theme_icon_override] or via the Inspector dock.
</description>
</method>
<methodname="remove_theme_stylebox_override">
@ -772,7 +804,7 @@
<argumentindex="0"name="name"type="StringName">
</argument>
<description>
Removes a theme override for a [StyleBox] with the given [code]name[/code].
Removes a local override for a theme [StyleBox] with the specified [code]name[/code] previously added by [method add_theme_stylebox_override] or via the Inspector dock.