ThemeDB
继承: Object
A singleton that provides access to static information about Theme
resources used by the engine and by your project.
描述
This singleton provides access to static information about Theme
resources used by the engine and by your projects. You can fetch the default engine theme, as well as your project configured theme.
ThemeDB also contains fallback values for theme properties.
属性
float | fallback_base_scale |
Font | fallback_font |
int | fallback_font_size |
Texture2D | fallback_icon |
StyleBox | fallback_stylebox |
方法
信号
fallback_changed ( )
Emitted when one of the fallback values had been changed. Use it to refresh the look of controls that may rely on the fallback theme items.
属性说明
float
fallback_base_scale = 1.0
The fallback base scale factor of every Control
node and Theme
resource. Used when no other value is available to the control.
See also Theme.default_base_scale
.
Font
fallback_font
The fallback font of every Control
node and Theme
resource. Used when no other value is available to the control.
See also Theme.default_font
.
int
fallback_font_size = 16
The fallback font size of every Control
node and Theme
resource. Used when no other value is available to the control.
See also Theme.default_font_size
.
Texture2D
fallback_icon
The fallback icon of every Control
node and Theme
resource. Used when no other value is available to the control.
StyleBox
fallback_stylebox
The fallback stylebox of every Control
node and Theme
resource. Used when no other value is available to the control.
方法说明
Theme
get_default_theme ( )
Returns a reference to the default engine Theme
. This theme resource is responsible for the out-of-the-box look of Control
nodes and cannot be overridden.
Theme
get_project_theme ( )
Returns a reference to the custom project Theme
. This theme resources allows to override the default engine theme for every control node in the project.
To set the project theme, see ProjectSettings.gui/theme/custom
.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。