Documentation
¶
Overview ¶
Package Theme provides methods for working with Theme object instances.
Index ¶
- type Advanced
- type Any
- type DataType
- type Instance
- func (self Instance) AddType(theme_type string)
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) AsTheme() Instance
- func (self Instance) Clear()
- func (self Instance) ClearColor(name string, theme_type string)
- func (self Instance) ClearConstant(name string, theme_type string)
- func (self Instance) ClearFont(name string, theme_type string)
- func (self Instance) ClearFontSize(name string, theme_type string)
- func (self Instance) ClearIcon(name string, theme_type string)
- func (self Instance) ClearStylebox(name string, theme_type string)
- func (self Instance) ClearThemeItem(data_type gdclass.ThemeDataType, name string, theme_type string)
- func (self Instance) ClearTypeVariation(theme_type string)
- func (self Instance) DefaultBaseScale() Float.X
- func (self Instance) DefaultFont() [1]gdclass.Font
- func (self Instance) DefaultFontSize() int
- func (self Instance) GetColor(name string, theme_type string) Color.RGBA
- func (self Instance) GetColorList(theme_type string) []string
- func (self Instance) GetColorTypeList() []string
- func (self Instance) GetConstant(name string, theme_type string) int
- func (self Instance) GetConstantList(theme_type string) []string
- func (self Instance) GetConstantTypeList() []string
- func (self Instance) GetFont(name string, theme_type string) [1]gdclass.Font
- func (self Instance) GetFontList(theme_type string) []string
- func (self Instance) GetFontSize(name string, theme_type string) int
- func (self Instance) GetFontSizeList(theme_type string) []string
- func (self Instance) GetFontSizeTypeList() []string
- func (self Instance) GetFontTypeList() []string
- func (self Instance) GetIcon(name string, theme_type string) [1]gdclass.Texture2D
- func (self Instance) GetIconList(theme_type string) []string
- func (self Instance) GetIconTypeList() []string
- func (self Instance) GetStylebox(name string, theme_type string) [1]gdclass.StyleBox
- func (self Instance) GetStyleboxList(theme_type string) []string
- func (self Instance) GetStyleboxTypeList() []string
- func (self Instance) GetThemeItem(data_type gdclass.ThemeDataType, name string, theme_type string) any
- func (self Instance) GetThemeItemList(data_type gdclass.ThemeDataType, theme_type string) []string
- func (self Instance) GetThemeItemTypeList(data_type gdclass.ThemeDataType) []string
- func (self Instance) GetTypeList() []string
- func (self Instance) GetTypeVariationBase(theme_type string) string
- func (self Instance) GetTypeVariationList(base_type string) []string
- func (self Instance) HasColor(name string, theme_type string) bool
- func (self Instance) HasConstant(name string, theme_type string) bool
- func (self Instance) HasDefaultBaseScale() bool
- func (self Instance) HasDefaultFont() bool
- func (self Instance) HasDefaultFontSize() bool
- func (self Instance) HasFont(name string, theme_type string) bool
- func (self Instance) HasFontSize(name string, theme_type string) bool
- func (self Instance) HasIcon(name string, theme_type string) bool
- func (self Instance) HasStylebox(name string, theme_type string) bool
- func (self Instance) HasThemeItem(data_type gdclass.ThemeDataType, name string, theme_type string) bool
- func (self Instance) IsTypeVariation(theme_type string, base_type string) bool
- func (self Instance) MergeWith(other [1]gdclass.Theme)
- func (self Instance) RemoveType(theme_type string)
- func (self Instance) RenameColor(old_name string, name string, theme_type string)
- func (self Instance) RenameConstant(old_name string, name string, theme_type string)
- func (self Instance) RenameFont(old_name string, name string, theme_type string)
- func (self Instance) RenameFontSize(old_name string, name string, theme_type string)
- func (self Instance) RenameIcon(old_name string, name string, theme_type string)
- func (self Instance) RenameStylebox(old_name string, name string, theme_type string)
- func (self Instance) RenameThemeItem(data_type gdclass.ThemeDataType, old_name string, name string, ...)
- func (self Instance) SetColor(name string, theme_type string, color Color.RGBA)
- func (self Instance) SetConstant(name string, theme_type string, constant int)
- func (self Instance) SetDefaultBaseScale(value Float.X)
- func (self Instance) SetDefaultFont(value [1]gdclass.Font)
- func (self Instance) SetDefaultFontSize(value int)
- func (self Instance) SetFont(name string, theme_type string, font [1]gdclass.Font)
- func (self Instance) SetFontSize(name string, theme_type string, font_size int)
- func (self Instance) SetIcon(name string, theme_type string, texture [1]gdclass.Texture2D)
- func (self Instance) SetStylebox(name string, theme_type string, texture [1]gdclass.StyleBox)
- func (self Instance) SetThemeItem(data_type gdclass.ThemeDataType, name string, theme_type string, value any)
- func (self Instance) SetTypeVariation(theme_type string, base_type string)
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type DataType ¶
type DataType = gdclass.ThemeDataType //gd:Theme.DataType
const ( /*Theme's [Color] item type.*/ DataTypeColor DataType = 0 /*Theme's constant item type.*/ DataTypeConstant DataType = 1 /*Theme's [Font] item type.*/ DataTypeFont DataType = 2 /*Theme's font size item type.*/ DataTypeFontSize DataType = 3 /*Theme's icon [Texture2D] item type.*/ DataTypeIcon DataType = 4 /*Theme's [StyleBox] item type.*/ DataTypeStylebox DataType = 5 /*Maximum value for the DataType enum.*/ DataTypeMax DataType = 6 )
type Instance ¶
A resource used for styling/skinning [Control] and [Window] nodes. While individual controls can be styled using their local theme overrides (see [method Control.add_theme_color_override]), theme resources allow you to store and apply the same settings across all controls sharing the same type (e.g. style all [Button]s the same). One theme resource can be used for the entire project, but you can also set a separate theme resource to a branch of control nodes. A theme resource assigned to a control applies to the control itself, as well as all of its direct and indirect children (as long as a chain of controls is uninterrupted). Use [member ProjectSettings.gui/theme/custom] to set up a project-scope theme that will be available to every control in your project. Use [member Control.theme] of any control node to set up a theme that will be available to that control and all of its direct and indirect children.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddType ¶
Adds an empty theme type for every valid data type. [b]Note:[/b] Empty types are not saved with the theme. This method only exists to perform in-memory changes to the resource. Use available [code]set_*[/code] methods to add theme items.
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) Clear ¶
func (self Instance) Clear()
Removes all the theme properties defined on the theme resource.
func (Instance) ClearColor ¶
Removes the [Color] property defined by [param name] and [param theme_type], if it exists. Fails if it doesn't exist. Use [method has_color] to check for existence.
func (Instance) ClearConstant ¶
Removes the constant property defined by [param name] and [param theme_type], if it exists. Fails if it doesn't exist. Use [method has_constant] to check for existence.
func (Instance) ClearFont ¶
Removes the [Font] property defined by [param name] and [param theme_type], if it exists. Fails if it doesn't exist. Use [method has_font] to check for existence.
func (Instance) ClearFontSize ¶
Removes the font size property defined by [param name] and [param theme_type], if it exists. Fails if it doesn't exist. Use [method has_font_size] to check for existence.
func (Instance) ClearIcon ¶
Removes the icon property defined by [param name] and [param theme_type], if it exists. Fails if it doesn't exist. Use [method has_icon] to check for existence.
func (Instance) ClearStylebox ¶
Removes the [StyleBox] property defined by [param name] and [param theme_type], if it exists. Fails if it doesn't exist. Use [method has_stylebox] to check for existence.
func (Instance) ClearThemeItem ¶
func (self Instance) ClearThemeItem(data_type gdclass.ThemeDataType, name string, theme_type string)
Removes the theme property of [param data_type] defined by [param name] and [param theme_type], if it exists. Fails if it doesn't exist. Use [method has_theme_item] to check for existence. [b]Note:[/b] This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
func (Instance) ClearTypeVariation ¶
Unmarks [param theme_type] as being a variation of another theme type. See [method set_type_variation].
func (Instance) DefaultBaseScale ¶
func (Instance) DefaultFont ¶
func (Instance) DefaultFontSize ¶
func (Instance) GetColor ¶
Returns the [Color] property defined by [param name] and [param theme_type], if it exists. Returns the default color value if the property doesn't exist. Use [method has_color] to check for existence.
func (Instance) GetColorList ¶
Returns a list of names for [Color] properties defined with [param theme_type]. Use [method get_color_type_list] to get a list of possible theme type names.
func (Instance) GetColorTypeList ¶
Returns a list of all unique theme type names for [Color] properties. Use [method get_type_list] to get a list of all unique theme types.
func (Instance) GetConstant ¶
Returns the constant property defined by [param name] and [param theme_type], if it exists. Returns [code]0[/code] if the property doesn't exist. Use [method has_constant] to check for existence.
func (Instance) GetConstantList ¶
Returns a list of names for constant properties defined with [param theme_type]. Use [method get_constant_type_list] to get a list of possible theme type names.
func (Instance) GetConstantTypeList ¶
Returns a list of all unique theme type names for constant properties. Use [method get_type_list] to get a list of all unique theme types.
func (Instance) GetFont ¶
Returns the [Font] property defined by [param name] and [param theme_type], if it exists. Returns the default theme font if the property doesn't exist and the default theme font is set up (see [member default_font]). Use [method has_font] to check for existence of the property and [method has_default_font] to check for existence of the default theme font. Returns the engine fallback font value, if neither exist (see [member ThemeDB.fallback_font]).
func (Instance) GetFontList ¶
Returns a list of names for [Font] properties defined with [param theme_type]. Use [method get_font_type_list] to get a list of possible theme type names.
func (Instance) GetFontSize ¶
Returns the font size property defined by [param name] and [param theme_type], if it exists. Returns the default theme font size if the property doesn't exist and the default theme font size is set up (see [member default_font_size]). Use [method has_font_size] to check for existence of the property and [method has_default_font_size] to check for existence of the default theme font. Returns the engine fallback font size value, if neither exist (see [member ThemeDB.fallback_font_size]).
func (Instance) GetFontSizeList ¶
Returns a list of names for font size properties defined with [param theme_type]. Use [method get_font_size_type_list] to get a list of possible theme type names.
func (Instance) GetFontSizeTypeList ¶
Returns a list of all unique theme type names for font size properties. Use [method get_type_list] to get a list of all unique theme types.
func (Instance) GetFontTypeList ¶
Returns a list of all unique theme type names for [Font] properties. Use [method get_type_list] to get a list of all unique theme types.
func (Instance) GetIcon ¶
Returns the icon property defined by [param name] and [param theme_type], if it exists. Returns the engine fallback icon value if the property doesn't exist (see [member ThemeDB.fallback_icon]). Use [method has_icon] to check for existence.
func (Instance) GetIconList ¶
Returns a list of names for icon properties defined with [param theme_type]. Use [method get_icon_type_list] to get a list of possible theme type names.
func (Instance) GetIconTypeList ¶
Returns a list of all unique theme type names for icon properties. Use [method get_type_list] to get a list of all unique theme types.
func (Instance) GetStylebox ¶
Returns the [StyleBox] property defined by [param name] and [param theme_type], if it exists. Returns the engine fallback stylebox value if the property doesn't exist (see [member ThemeDB.fallback_stylebox]). Use [method has_stylebox] to check for existence.
func (Instance) GetStyleboxList ¶
Returns a list of names for [StyleBox] properties defined with [param theme_type]. Use [method get_stylebox_type_list] to get a list of possible theme type names.
func (Instance) GetStyleboxTypeList ¶
Returns a list of all unique theme type names for [StyleBox] properties. Use [method get_type_list] to get a list of all unique theme types.
func (Instance) GetThemeItem ¶
func (self Instance) GetThemeItem(data_type gdclass.ThemeDataType, name string, theme_type string) any
Returns the theme property of [param data_type] defined by [param name] and [param theme_type], if it exists. Returns the engine fallback value if the property doesn't exist (see [ThemeDB]). Use [method has_theme_item] to check for existence. [b]Note:[/b] This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
func (Instance) GetThemeItemList ¶
func (self Instance) GetThemeItemList(data_type gdclass.ThemeDataType, theme_type string) []string
Returns a list of names for properties of [param data_type] defined with [param theme_type]. Use [method get_theme_item_type_list] to get a list of possible theme type names. [b]Note:[/b] This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
func (Instance) GetThemeItemTypeList ¶
func (self Instance) GetThemeItemTypeList(data_type gdclass.ThemeDataType) []string
Returns a list of all unique theme type names for [param data_type] properties. Use [method get_type_list] to get a list of all unique theme types. [b]Note:[/b] This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
func (Instance) GetTypeList ¶
Returns a list of all unique theme type names. Use the appropriate [code]get_*_type_list[/code] method to get a list of unique theme types for a single data type.
func (Instance) GetTypeVariationBase ¶
Returns the name of the base theme type if [param theme_type] is a valid variation type. Returns an empty string otherwise.
func (Instance) GetTypeVariationList ¶
Returns a list of all type variations for the given [param base_type].
func (Instance) HasColor ¶
Returns [code]true[/code] if the [Color] property defined by [param name] and [param theme_type] exists. Returns [code]false[/code] if it doesn't exist. Use [method set_color] to define it.
func (Instance) HasConstant ¶
Returns [code]true[/code] if the constant property defined by [param name] and [param theme_type] exists. Returns [code]false[/code] if it doesn't exist. Use [method set_constant] to define it.
func (Instance) HasDefaultBaseScale ¶
Returns [code]true[/code] if [member default_base_scale] has a valid value. Returns [code]false[/code] if it doesn't. The value must be greater than [code]0.0[/code] to be considered valid.
func (Instance) HasDefaultFont ¶
Returns [code]true[/code] if [member default_font] has a valid value. Returns [code]false[/code] if it doesn't.
func (Instance) HasDefaultFontSize ¶
Returns [code]true[/code] if [member default_font_size] has a valid value. Returns [code]false[/code] if it doesn't. The value must be greater than [code]0[/code] to be considered valid.
func (Instance) HasFont ¶
Returns [code]true[/code] if the [Font] property defined by [param name] and [param theme_type] exists, or if the default theme font is set up (see [method has_default_font]). Returns [code]false[/code] if neither exist. Use [method set_font] to define the property.
func (Instance) HasFontSize ¶
Returns [code]true[/code] if the font size property defined by [param name] and [param theme_type] exists, or if the default theme font size is set up (see [method has_default_font_size]). Returns [code]false[/code] if neither exist. Use [method set_font_size] to define the property.
func (Instance) HasIcon ¶
Returns [code]true[/code] if the icon property defined by [param name] and [param theme_type] exists. Returns [code]false[/code] if it doesn't exist. Use [method set_icon] to define it.
func (Instance) HasStylebox ¶
Returns [code]true[/code] if the [StyleBox] property defined by [param name] and [param theme_type] exists. Returns [code]false[/code] if it doesn't exist. Use [method set_stylebox] to define it.
func (Instance) HasThemeItem ¶
func (self Instance) HasThemeItem(data_type gdclass.ThemeDataType, name string, theme_type string) bool
Returns [code]true[/code] if the theme property of [param data_type] defined by [param name] and [param theme_type] exists. Returns [code]false[/code] if it doesn't exist. Use [method set_theme_item] to define it. [b]Note:[/b] This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
func (Instance) IsTypeVariation ¶
Returns [code]true[/code] if [param theme_type] is marked as a variation of [param base_type].
func (Instance) MergeWith ¶
Adds missing and overrides existing definitions with values from the [param other] theme resource. [b]Note:[/b] This modifies the current theme. If you want to merge two themes together without modifying either one, create a new empty theme and merge the other two into it one after another.
func (Instance) RemoveType ¶
Removes the theme type, gracefully discarding defined theme items. If the type is a variation, this information is also erased. If the type is a base for type variations, those variations lose their base.
func (Instance) RenameColor ¶
Renames the [Color] property defined by [param old_name] and [param theme_type] to [param name], if it exists. Fails if it doesn't exist, or if a similar property with the new name already exists. Use [method has_color] to check for existence, and [method clear_color] to remove the existing property.
func (Instance) RenameConstant ¶
Renames the constant property defined by [param old_name] and [param theme_type] to [param name], if it exists. Fails if it doesn't exist, or if a similar property with the new name already exists. Use [method has_constant] to check for existence, and [method clear_constant] to remove the existing property.
func (Instance) RenameFont ¶
Renames the [Font] property defined by [param old_name] and [param theme_type] to [param name], if it exists. Fails if it doesn't exist, or if a similar property with the new name already exists. Use [method has_font] to check for existence, and [method clear_font] to remove the existing property.
func (Instance) RenameFontSize ¶
Renames the font size property defined by [param old_name] and [param theme_type] to [param name], if it exists. Fails if it doesn't exist, or if a similar property with the new name already exists. Use [method has_font_size] to check for existence, and [method clear_font_size] to remove the existing property.
func (Instance) RenameIcon ¶
Renames the icon property defined by [param old_name] and [param theme_type] to [param name], if it exists. Fails if it doesn't exist, or if a similar property with the new name already exists. Use [method has_icon] to check for existence, and [method clear_icon] to remove the existing property.
func (Instance) RenameStylebox ¶
Renames the [StyleBox] property defined by [param old_name] and [param theme_type] to [param name], if it exists. Fails if it doesn't exist, or if a similar property with the new name already exists. Use [method has_stylebox] to check for existence, and [method clear_stylebox] to remove the existing property.
func (Instance) RenameThemeItem ¶
func (self Instance) RenameThemeItem(data_type gdclass.ThemeDataType, old_name string, name string, theme_type string)
Renames the theme property of [param data_type] defined by [param old_name] and [param theme_type] to [param name], if it exists. Fails if it doesn't exist, or if a similar property with the new name already exists. Use [method has_theme_item] to check for existence, and [method clear_theme_item] to remove the existing property. [b]Note:[/b] This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
func (Instance) SetColor ¶
Creates or changes the value of the [Color] property defined by [param name] and [param theme_type]. Use [method clear_color] to remove the property.
func (Instance) SetConstant ¶
Creates or changes the value of the constant property defined by [param name] and [param theme_type]. Use [method clear_constant] to remove the property.
func (Instance) SetDefaultBaseScale ¶
func (Instance) SetDefaultFont ¶
func (Instance) SetDefaultFontSize ¶
func (Instance) SetFont ¶
Creates or changes the value of the [Font] property defined by [param name] and [param theme_type]. Use [method clear_font] to remove the property.
func (Instance) SetFontSize ¶
Creates or changes the value of the font size property defined by [param name] and [param theme_type]. Use [method clear_font_size] to remove the property.
func (Instance) SetIcon ¶
Creates or changes the value of the icon property defined by [param name] and [param theme_type]. Use [method clear_icon] to remove the property.
func (Instance) SetStylebox ¶
Creates or changes the value of the [StyleBox] property defined by [param name] and [param theme_type]. Use [method clear_stylebox] to remove the property.
func (Instance) SetThemeItem ¶
func (self Instance) SetThemeItem(data_type gdclass.ThemeDataType, name string, theme_type string, value any)
Creates or changes the value of the theme property of [param data_type] defined by [param name] and [param theme_type]. Use [method clear_theme_item] to remove the property. Fails if the [param value] type is not accepted by [param data_type]. [b]Note:[/b] This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
func (Instance) SetTypeVariation ¶
Marks [param theme_type] as a variation of [param base_type]. This adds [param theme_type] as a suggested option for [member Control.theme_type_variation] on a [Control] that is of the [param base_type] class. Variations can also be nested, i.e. [param base_type] can be another variation. If a chain of variations ends with a [param base_type] matching the class of the [Control], the whole chain is going to be suggested as options. [b]Note:[/b] Suggestions only show up if this theme resource is set as the project default theme. See [member ProjectSettings.gui/theme/custom].