2017-09-12 22:42:36 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2017-11-15 18:37:54 +01:00
<class name= "TextureButton" inherits= "BaseButton" category= "Core" version= "3.0-alpha" >
2017-09-12 22:42:36 +02:00
<brief_description >
2017-10-07 09:09:21 +02:00
Texture-based button. Supports Pressed, Hover, Disabled and Focused states.
2017-09-12 22:42:36 +02:00
</brief_description>
<description >
2017-10-07 09:09:21 +02:00
[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.
2017-09-12 22:42:36 +02:00
</description>
<tutorials >
</tutorials>
<demos >
</demos>
<methods >
<method name= "get_click_mask" qualifiers= "const" >
<return type= "BitMap" >
</return>
<description >
</description>
</method>
<method name= "get_disabled_texture" qualifiers= "const" >
<return type= "Texture" >
</return>
<description >
</description>
</method>
<method name= "get_expand" qualifiers= "const" >
<return type= "bool" >
</return>
<description >
</description>
</method>
<method name= "get_focused_texture" qualifiers= "const" >
<return type= "Texture" >
</return>
<description >
</description>
</method>
<method name= "get_hover_texture" qualifiers= "const" >
<return type= "Texture" >
</return>
<description >
</description>
</method>
<method name= "get_normal_texture" qualifiers= "const" >
<return type= "Texture" >
</return>
<description >
</description>
</method>
<method name= "get_pressed_texture" qualifiers= "const" >
<return type= "Texture" >
</return>
<description >
</description>
</method>
<method name= "get_stretch_mode" qualifiers= "const" >
<return type= "int" enum= "TextureButton.StretchMode" >
</return>
<description >
</description>
</method>
<method name= "set_click_mask" >
<return type= "void" >
</return>
<argument index= "0" name= "mask" type= "BitMap" >
</argument>
<description >
</description>
</method>
<method name= "set_disabled_texture" >
<return type= "void" >
</return>
<argument index= "0" name= "texture" type= "Texture" >
</argument>
<description >
</description>
</method>
<method name= "set_expand" >
<return type= "void" >
</return>
<argument index= "0" name= "p_expand" type= "bool" >
</argument>
<description >
</description>
</method>
<method name= "set_focused_texture" >
<return type= "void" >
</return>
<argument index= "0" name= "texture" type= "Texture" >
</argument>
<description >
</description>
</method>
<method name= "set_hover_texture" >
<return type= "void" >
</return>
<argument index= "0" name= "texture" type= "Texture" >
</argument>
<description >
</description>
</method>
<method name= "set_normal_texture" >
<return type= "void" >
</return>
<argument index= "0" name= "texture" type= "Texture" >
</argument>
<description >
</description>
</method>
<method name= "set_pressed_texture" >
<return type= "void" >
</return>
<argument index= "0" name= "texture" type= "Texture" >
</argument>
<description >
</description>
</method>
<method name= "set_stretch_mode" >
<return type= "void" >
</return>
<argument index= "0" name= "p_mode" type= "int" enum= "TextureButton.StretchMode" >
</argument>
<description >
</description>
</method>
</methods>
<members >
2017-09-13 08:49:40 +02:00
<member name= "expand" type= "bool" setter= "set_expand" getter= "get_expand" >
2017-10-07 09:09:21 +02:00
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].
2017-09-12 22:42:36 +02:00
</member>
2017-09-13 08:49:40 +02:00
<member name= "stretch_mode" type= "int" setter= "set_stretch_mode" getter= "get_stretch_mode" enum= "TextureButton.StretchMode" >
2017-10-07 09:09:21 +02:00
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.
2017-09-12 22:42:36 +02:00
</member>
2017-09-13 08:49:40 +02:00
<member name= "texture_click_mask" type= "BitMap" setter= "set_click_mask" getter= "get_click_mask" >
2017-10-07 09:09:21 +02:00
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.
2017-09-12 22:42:36 +02:00
</member>
2017-09-13 08:49:40 +02:00
<member name= "texture_disabled" type= "Texture" setter= "set_disabled_texture" getter= "get_disabled_texture" >
2017-10-07 09:09:21 +02:00
Texture to display when the node is disabled. See [member BaseButton.disabled].
2017-09-12 22:42:36 +02:00
</member>
2017-09-13 08:49:40 +02:00
<member name= "texture_focused" type= "Texture" setter= "set_focused_texture" getter= "get_focused_texture" >
2017-10-07 09:09:21 +02:00
Texture to display when the node has mouse or keyboard focus.
2017-09-12 22:42:36 +02:00
</member>
2017-09-13 08:49:40 +02:00
<member name= "texture_hover" type= "Texture" setter= "set_hover_texture" getter= "get_hover_texture" >
2017-10-07 09:09:21 +02:00
Texture to display when the mouse hovers the node.
2017-09-12 22:42:36 +02:00
</member>
2017-09-13 08:49:40 +02:00
<member name= "texture_normal" type= "Texture" setter= "set_normal_texture" getter= "get_normal_texture" >
2017-10-07 09:09:21 +02:00
Texture to display by default, when the node is [b]not[/b] in the disabled, focused, hover or pressed state.
2017-09-12 22:42:36 +02:00
</member>
2017-09-13 08:49:40 +02:00
<member name= "texture_pressed" type= "Texture" setter= "set_pressed_texture" getter= "get_pressed_texture" >
2017-10-07 09:09:21 +02:00
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.
2017-09-12 22:42:36 +02:00
</member>
</members>
<constants >
<constant name= "STRETCH_SCALE" value= "0" >
2017-10-07 09:09:21 +02:00
Scale to fit the node's bounding rectangle.
2017-09-12 22:42:36 +02:00
</constant>
<constant name= "STRETCH_TILE" value= "1" >
2017-10-07 09:09:21 +02:00
Tile inside the node's bounding rectangle.
2017-09-12 22:42:36 +02:00
</constant>
<constant name= "STRETCH_KEEP" value= "2" >
2017-10-07 09:09:21 +02:00
The texture keeps its original size and stays in the bounding rectangle's top-left corner.
2017-09-12 22:42:36 +02:00
</constant>
<constant name= "STRETCH_KEEP_CENTERED" value= "3" >
2017-10-07 09:09:21 +02:00
The texture keeps its original size and stays centered in the node's bounding rectangle.
2017-09-12 22:42:36 +02:00
</constant>
<constant name= "STRETCH_KEEP_ASPECT" value= "4" >
2017-10-07 09:09:21 +02:00
Scale the texture to fit the node's bounding rectangle, but maintain the texture's aspect ratio.
2017-09-12 22:42:36 +02:00
</constant>
<constant name= "STRETCH_KEEP_ASPECT_CENTERED" value= "5" >
2017-10-07 09:09:21 +02:00
Scale the texture to fit the node's bounding rectangle, center it, and maintain its aspect ratio.
2017-09-12 22:42:36 +02:00
</constant>
<constant name= "STRETCH_KEEP_ASPECT_COVERED" value= "6" >
2017-10-07 09:09:21 +02:00
Scale the texture so that the shorter side fits the bounding rectangle. The other side clips to the node's limits.
2017-09-12 22:42:36 +02:00
</constant>
</constants>
</class>