[DOCS] Write TextureButton, review and finish TextureProgress
This commit is contained in:
parent
195b12212d
commit
f50bac71df
2 changed files with 39 additions and 16 deletions
|
|
@ -1,11 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="TextureButton" inherits="BaseButton" category="Core" version="3.0.alpha.custom_build">
|
||||
<brief_description>
|
||||
Button that can be themed with textures.
|
||||
Texture-based button. Supports Pressed, Hover, Disabled and Focused states.
|
||||
</brief_description>
|
||||
<description>
|
||||
Button that can be themed with textures. This is like a regular [Button] but can be themed by assigning textures to it. This button is intended to be easy to theme, however a regular button can expand (that uses styleboxes) and still be better if the interface is expect to have internationalization of texts.
|
||||
Only the normal texture is required, the others are optional.
|
||||
[code]TextureButton[/code] has the same functionality as [Button], except it uses sprites instead of Godot's [Theme] resource. It is faster to create, but it doesn't support localization like more complex Controls.
|
||||
The Normal state's texture is required. Others are optional.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
|
@ -127,36 +127,51 @@
|
|||
</methods>
|
||||
<members>
|
||||
<member name="expand" type="bool" setter="set_expand" getter="get_expand">
|
||||
If [code]true[/code] the texture stretches to the edges of the node's bounding rectangle using the [member stretch_mode]. If [code]false[/code] the texture will not scale with the node. Default value: [code]false[/code].
|
||||
</member>
|
||||
<member name="stretch_mode" type="int" setter="set_stretch_mode" getter="get_stretch_mode" enum="TextureButton.StretchMode">
|
||||
Controls the texture's behavior when you resize the node's bounding rectangle, [b]only if[/b] [member expand] is [code]true[/code]. Set it to one of the [code]STRETCH_*[/code] constants. See the constants to learn more.
|
||||
</member>
|
||||
<member name="texture_click_mask" type="BitMap" setter="set_click_mask" getter="get_click_mask">
|
||||
Pure black and white [Bitmap] image to use for click detection. On the mask, white pixels represent the button's clickable area. Use it to create buttons with curved shapes.
|
||||
</member>
|
||||
<member name="texture_disabled" type="Texture" setter="set_disabled_texture" getter="get_disabled_texture">
|
||||
Texture to display when the node is disabled. See [member BaseButton.disabled].
|
||||
</member>
|
||||
<member name="texture_focused" type="Texture" setter="set_focused_texture" getter="get_focused_texture">
|
||||
Texture to display when the node has mouse or keyboard focus.
|
||||
</member>
|
||||
<member name="texture_hover" type="Texture" setter="set_hover_texture" getter="get_hover_texture">
|
||||
Texture to display when the mouse hovers the node.
|
||||
</member>
|
||||
<member name="texture_normal" type="Texture" setter="set_normal_texture" getter="get_normal_texture">
|
||||
Texture to display by default, when the node is [b]not[/b] in the disabled, focused, hover or pressed state.
|
||||
</member>
|
||||
<member name="texture_pressed" type="Texture" setter="set_pressed_texture" getter="get_pressed_texture">
|
||||
Texture to display on mouse down over the node, if the node has keyboard focus and the player presses the enter key or if the player presses the [member BaseButton.shortcut] key.
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
<constant name="STRETCH_SCALE" value="0">
|
||||
Scale to fit the node's bounding rectangle.
|
||||
</constant>
|
||||
<constant name="STRETCH_TILE" value="1">
|
||||
Tile inside the node's bounding rectangle.
|
||||
</constant>
|
||||
<constant name="STRETCH_KEEP" value="2">
|
||||
The texture keeps its original size and stays in the bounding rectangle's top-left corner.
|
||||
</constant>
|
||||
<constant name="STRETCH_KEEP_CENTERED" value="3">
|
||||
The texture keeps its original size and stays centered in the node's bounding rectangle.
|
||||
</constant>
|
||||
<constant name="STRETCH_KEEP_ASPECT" value="4">
|
||||
Scale the texture to fit the node's bounding rectangle, but maintain the texture's aspect ratio.
|
||||
</constant>
|
||||
<constant name="STRETCH_KEEP_ASPECT_CENTERED" value="5">
|
||||
Scale the texture to fit the node's bounding rectangle, center it, and maintain its aspect ratio.
|
||||
</constant>
|
||||
<constant name="STRETCH_KEEP_ASPECT_COVERED" value="6">
|
||||
Scale the texture so that the shorter side fits the bounding rectangle. The other side clips to the node's limits.
|
||||
</constant>
|
||||
</constants>
|
||||
</class>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue