2017-09-13 04:42:36 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-07-06 16:08:05 +08:00
<class name= "StyleBoxTexture" inherits= "StyleBox" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2017-09-13 04:42:36 +08:00
<brief_description >
2023-04-30 22:26:09 +08:00
A texture-based nine-patch [StyleBox].
2017-09-13 04:42:36 +08:00
</brief_description>
<description >
2023-04-30 22:26:09 +08:00
A texture-based nine-patch [StyleBox], in a way similar to [NinePatchRect]. This stylebox performs a 3× 3 scaling of a texture, where only the center cell is fully stretched. This makes it possible to design bordered styles regardless of the stylebox's size.
2017-09-13 04:42:36 +08:00
</description>
<tutorials >
</tutorials>
<methods >
2023-01-20 00:14:09 +08:00
<method name= "get_expand_margin" qualifiers= "const" >
2021-07-30 21:28:05 +08:00
<return type= "float" />
2022-08-07 02:11:48 +08:00
<param index= "0" name= "margin" type= "int" enum= "Side" />
2019-06-27 22:10:09 +08:00
<description >
2020-12-23 00:24:29 +08:00
Returns the expand margin size of the specified [enum Side].
2019-06-27 22:10:09 +08:00
</description>
</method>
2023-01-20 00:14:09 +08:00
<method name= "get_texture_margin" qualifiers= "const" >
2021-07-30 21:28:05 +08:00
<return type= "float" />
2022-08-07 02:11:48 +08:00
<param index= "0" name= "margin" type= "int" enum= "Side" />
2019-06-27 22:10:09 +08:00
<description >
2020-12-23 00:24:29 +08:00
Returns the margin size of the specified [enum Side].
2019-06-27 22:10:09 +08:00
</description>
</method>
2023-01-20 00:14:09 +08:00
<method name= "set_expand_margin" >
2021-07-30 21:28:05 +08:00
<return type= "void" />
2023-01-20 00:14:09 +08:00
<param index= "0" name= "margin" type= "int" enum= "Side" />
<param index= "1" name= "size" type= "float" />
2017-09-13 04:42:36 +08:00
<description >
2023-01-20 00:14:09 +08:00
Sets the expand margin to [param size] pixels for the specified [enum Side].
2017-09-13 04:42:36 +08:00
</description>
</method>
2023-01-20 00:14:09 +08:00
<method name= "set_expand_margin_all" >
2021-07-30 21:28:05 +08:00
<return type= "void" />
2023-01-20 00:14:09 +08:00
<param index= "0" name= "size" type= "float" />
2019-06-27 22:10:09 +08:00
<description >
2023-02-20 11:18:57 +08:00
Sets the expand margin to [param size] pixels for all sides.
2019-06-27 22:10:09 +08:00
</description>
</method>
2023-01-20 00:14:09 +08:00
<method name= "set_texture_margin" >
2021-07-30 21:28:05 +08:00
<return type= "void" />
2022-08-07 02:11:48 +08:00
<param index= "0" name= "margin" type= "int" enum= "Side" />
<param index= "1" name= "size" type= "float" />
2019-06-27 22:10:09 +08:00
<description >
2022-08-10 10:00:19 +08:00
Sets the margin to [param size] pixels for the specified [enum Side].
2019-06-27 22:10:09 +08:00
</description>
</method>
2023-01-20 00:14:09 +08:00
<method name= "set_texture_margin_all" >
2022-03-12 12:38:44 +08:00
<return type= "void" />
<param index= "0" name= "size" type= "float" />
<description >
Sets the margin to [param size] pixels for all sides.
</description>
</method>
2017-09-13 04:42:36 +08:00
</methods>
<members >
2019-06-29 18:38:01 +08:00
<member name= "axis_stretch_horizontal" type= "int" setter= "set_h_axis_stretch_mode" getter= "get_h_axis_stretch_mode" enum= "StyleBoxTexture.AxisStretchMode" default= "0" >
2019-12-03 22:46:11 +08:00
Controls how the stylebox's texture will be stretched or tiled horizontally. See [enum AxisStretchMode] for possible values.
2017-09-13 04:42:36 +08:00
</member>
2019-06-29 18:38:01 +08:00
<member name= "axis_stretch_vertical" type= "int" setter= "set_v_axis_stretch_mode" getter= "get_v_axis_stretch_mode" enum= "StyleBoxTexture.AxisStretchMode" default= "0" >
2019-12-03 22:46:11 +08:00
Controls how the stylebox's texture will be stretched or tiled vertically. See [enum AxisStretchMode] for possible values.
2017-09-13 04:42:36 +08:00
</member>
2019-06-29 18:38:01 +08:00
<member name= "draw_center" type= "bool" setter= "set_draw_center" getter= "is_draw_center_enabled" default= "true" >
2019-12-03 22:46:11 +08:00
If [code]true[/code], the nine-patch texture's center tile will be drawn.
2017-09-13 04:42:36 +08:00
</member>
2023-01-20 00:14:09 +08:00
<member name= "expand_margin_bottom" type= "float" setter= "set_expand_margin" getter= "get_expand_margin" default= "0.0" >
2019-06-22 07:04:47 +08:00
Expands the bottom margin of this style box when drawing, causing it to be drawn larger than requested.
2017-09-13 04:42:36 +08:00
</member>
2023-01-20 00:14:09 +08:00
<member name= "expand_margin_left" type= "float" setter= "set_expand_margin" getter= "get_expand_margin" default= "0.0" >
2019-06-22 07:04:47 +08:00
Expands the left margin of this style box when drawing, causing it to be drawn larger than requested.
2017-09-13 04:42:36 +08:00
</member>
2023-01-20 00:14:09 +08:00
<member name= "expand_margin_right" type= "float" setter= "set_expand_margin" getter= "get_expand_margin" default= "0.0" >
2019-06-22 07:04:47 +08:00
Expands the right margin of this style box when drawing, causing it to be drawn larger than requested.
2017-09-13 04:42:36 +08:00
</member>
2023-01-20 00:14:09 +08:00
<member name= "expand_margin_top" type= "float" setter= "set_expand_margin" getter= "get_expand_margin" default= "0.0" >
2019-06-22 07:04:47 +08:00
Expands the top margin of this style box when drawing, causing it to be drawn larger than requested.
2017-09-13 04:42:36 +08:00
</member>
2023-01-20 00:14:09 +08:00
<member name= "modulate_color" type= "Color" setter= "set_modulate" getter= "get_modulate" default= "Color(1, 1, 1, 1)" >
Modulates the color of the texture when this style box is drawn.
</member>
<member name= "region_rect" type= "Rect2" setter= "set_region_rect" getter= "get_region_rect" default= "Rect2(0, 0, 0, 0)" >
2024-08-19 00:51:37 +08:00
The region to use from the [member texture].
This is equivalent to first wrapping the [member texture] in an [AtlasTexture] with the same region.
If empty ([code]Rect2(0, 0, 0, 0)[/code]), the whole [member texture] is used.
2023-01-20 00:14:09 +08:00
</member>
<member name= "texture" type= "Texture2D" setter= "set_texture" getter= "get_texture" >
The texture to use when drawing this style box.
</member>
<member name= "texture_margin_bottom" type= "float" setter= "set_texture_margin" getter= "get_texture_margin" default= "0.0" >
2019-06-22 07:04:47 +08:00
Increases the bottom margin of the 3× 3 texture box.
A higher value means more of the source texture is considered to be part of the bottom border of the 3× 3 box.
2019-02-07 00:18:02 +08:00
This is also the value used as fallback for [member StyleBox.content_margin_bottom] if it is negative.
2017-09-13 04:42:36 +08:00
</member>
2023-01-20 00:14:09 +08:00
<member name= "texture_margin_left" type= "float" setter= "set_texture_margin" getter= "get_texture_margin" default= "0.0" >
2019-06-22 07:04:47 +08:00
Increases the left margin of the 3× 3 texture box.
A higher value means more of the source texture is considered to be part of the left border of the 3× 3 box.
2019-02-07 00:18:02 +08:00
This is also the value used as fallback for [member StyleBox.content_margin_left] if it is negative.
2017-09-13 04:42:36 +08:00
</member>
2023-01-20 00:14:09 +08:00
<member name= "texture_margin_right" type= "float" setter= "set_texture_margin" getter= "get_texture_margin" default= "0.0" >
2019-06-22 07:04:47 +08:00
Increases the right margin of the 3× 3 texture box.
A higher value means more of the source texture is considered to be part of the right border of the 3× 3 box.
2019-02-07 00:18:02 +08:00
This is also the value used as fallback for [member StyleBox.content_margin_right] if it is negative.
2017-09-13 04:42:36 +08:00
</member>
2023-01-20 00:14:09 +08:00
<member name= "texture_margin_top" type= "float" setter= "set_texture_margin" getter= "get_texture_margin" default= "0.0" >
2019-06-22 07:04:47 +08:00
Increases the top margin of the 3× 3 texture box.
A higher value means more of the source texture is considered to be part of the top border of the 3× 3 box.
2019-02-07 00:18:02 +08:00
This is also the value used as fallback for [member StyleBox.content_margin_top] if it is negative.
2017-09-13 04:42:36 +08:00
</member>
</members>
<constants >
2017-11-25 06:16:30 +08:00
<constant name= "AXIS_STRETCH_MODE_STRETCH" value= "0" enum= "AxisStretchMode" >
2019-12-03 22:46:11 +08:00
Stretch the stylebox's texture. This results in visible distortion unless the texture size matches the stylebox's size perfectly.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "AXIS_STRETCH_MODE_TILE" value= "1" enum= "AxisStretchMode" >
2019-12-03 22:46:11 +08:00
Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "AXIS_STRETCH_MODE_TILE_FIT" value= "2" enum= "AxisStretchMode" >
2019-12-03 22:46:11 +08:00
Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system. Unlike [constant AXIS_STRETCH_MODE_TILE], the texture may be slightly stretched to make the nine-patch texture tile seamlessly.
2017-09-13 04:42:36 +08:00
</constant>
</constants>
</class>