0.2.0-dev Download ZIP
122 lines ·6.8 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="StyleBoxTexture" inherits="StyleBox" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | A texture-based nine-patch [StyleBox]. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | 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. |
| 8 | </description> |
| 9 | <tutorials> |
| 10 | </tutorials> |
| 11 | <methods> |
| 12 | <method name="get_expand_margin" qualifiers="const"> |
| 13 | <return type="float" /> |
| 14 | <param index="0" name="margin" type="int" enum="Side" /> |
| 15 | <description> |
| 16 | Returns the expand margin size of the specified [enum Side]. |
| 17 | </description> |
| 18 | </method> |
| 19 | <method name="get_texture_margin" qualifiers="const"> |
| 20 | <return type="float" /> |
| 21 | <param index="0" name="margin" type="int" enum="Side" /> |
| 22 | <description> |
| 23 | Returns the margin size of the specified [enum Side]. |
| 24 | </description> |
| 25 | </method> |
| 26 | <method name="set_expand_margin"> |
| 27 | <return type="void" /> |
| 28 | <param index="0" name="margin" type="int" enum="Side" /> |
| 29 | <param index="1" name="size" type="float" /> |
| 30 | <description> |
| 31 | Sets the expand margin to [param size] pixels for the specified [enum Side]. |
| 32 | </description> |
| 33 | </method> |
| 34 | <method name="set_expand_margin_all"> |
| 35 | <return type="void" /> |
| 36 | <param index="0" name="size" type="float" /> |
| 37 | <description> |
| 38 | Sets the expand margin to [param size] pixels for all sides. |
| 39 | </description> |
| 40 | </method> |
| 41 | <method name="set_texture_margin"> |
| 42 | <return type="void" /> |
| 43 | <param index="0" name="margin" type="int" enum="Side" /> |
| 44 | <param index="1" name="size" type="float" /> |
| 45 | <description> |
| 46 | Sets the margin to [param size] pixels for the specified [enum Side]. |
| 47 | </description> |
| 48 | </method> |
| 49 | <method name="set_texture_margin_all"> |
| 50 | <return type="void" /> |
| 51 | <param index="0" name="size" type="float" /> |
| 52 | <description> |
| 53 | Sets the margin to [param size] pixels for all sides. |
| 54 | </description> |
| 55 | </method> |
| 56 | </methods> |
| 57 | <members> |
| 58 | <member name="axis_stretch_horizontal" type="int" setter="set_h_axis_stretch_mode" getter="get_h_axis_stretch_mode" enum="StyleBoxTexture.AxisStretchMode" default="0"> |
| 59 | Controls how the stylebox's texture will be stretched or tiled horizontally. |
| 60 | </member> |
| 61 | <member name="axis_stretch_vertical" type="int" setter="set_v_axis_stretch_mode" getter="get_v_axis_stretch_mode" enum="StyleBoxTexture.AxisStretchMode" default="0"> |
| 62 | Controls how the stylebox's texture will be stretched or tiled vertically. |
| 63 | </member> |
| 64 | <member name="draw_center" type="bool" setter="set_draw_center" getter="is_draw_center_enabled" default="true"> |
| 65 | If [code]true[/code], the nine-patch texture's center tile will be drawn. |
| 66 | </member> |
| 67 | <member name="expand_margin_bottom" type="float" setter="set_expand_margin" getter="get_expand_margin" default="0.0"> |
| 68 | Expands the bottom margin of this style box when drawing, causing it to be drawn larger than requested. |
| 69 | </member> |
| 70 | <member name="expand_margin_left" type="float" setter="set_expand_margin" getter="get_expand_margin" default="0.0"> |
| 71 | Expands the left margin of this style box when drawing, causing it to be drawn larger than requested. |
| 72 | </member> |
| 73 | <member name="expand_margin_right" type="float" setter="set_expand_margin" getter="get_expand_margin" default="0.0"> |
| 74 | Expands the right margin of this style box when drawing, causing it to be drawn larger than requested. |
| 75 | </member> |
| 76 | <member name="expand_margin_top" type="float" setter="set_expand_margin" getter="get_expand_margin" default="0.0"> |
| 77 | Expands the top margin of this style box when drawing, causing it to be drawn larger than requested. |
| 78 | </member> |
| 79 | <member name="modulate_color" type="Color" setter="set_modulate" getter="get_modulate" default="Color(1, 1, 1, 1)"> |
| 80 | Modulates the color of the texture when this style box is drawn. |
| 81 | </member> |
| 82 | <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2(0, 0, 0, 0)"> |
| 83 | The region to use from the [member texture]. |
| 84 | This is equivalent to first wrapping the [member texture] in an [AtlasTexture] with the same region. |
| 85 | If empty ([code]Rect2(0, 0, 0, 0)[/code]), the whole [member texture] is used. |
| 86 | </member> |
| 87 | <member name="texture" type="Texture2D" setter="set_texture" getter="get_texture"> |
| 88 | The texture to use when drawing this style box. |
| 89 | </member> |
| 90 | <member name="texture_margin_bottom" type="float" setter="set_texture_margin" getter="get_texture_margin" default="0.0"> |
| 91 | Increases the bottom margin of the 3×3 texture box. |
| 92 | A higher value means more of the source texture is considered to be part of the bottom border of the 3×3 box. |
| 93 | This is also the value used as fallback for [member StyleBox.content_margin_bottom] if it is negative. |
| 94 | </member> |
| 95 | <member name="texture_margin_left" type="float" setter="set_texture_margin" getter="get_texture_margin" default="0.0"> |
| 96 | Increases the left margin of the 3×3 texture box. |
| 97 | A higher value means more of the source texture is considered to be part of the left border of the 3×3 box. |
| 98 | This is also the value used as fallback for [member StyleBox.content_margin_left] if it is negative. |
| 99 | </member> |
| 100 | <member name="texture_margin_right" type="float" setter="set_texture_margin" getter="get_texture_margin" default="0.0"> |
| 101 | Increases the right margin of the 3×3 texture box. |
| 102 | A higher value means more of the source texture is considered to be part of the right border of the 3×3 box. |
| 103 | This is also the value used as fallback for [member StyleBox.content_margin_right] if it is negative. |
| 104 | </member> |
| 105 | <member name="texture_margin_top" type="float" setter="set_texture_margin" getter="get_texture_margin" default="0.0"> |
| 106 | Increases the top margin of the 3×3 texture box. |
| 107 | A higher value means more of the source texture is considered to be part of the top border of the 3×3 box. |
| 108 | This is also the value used as fallback for [member StyleBox.content_margin_top] if it is negative. |
| 109 | </member> |
| 110 | </members> |
| 111 | <constants> |
| 112 | <constant name="AXIS_STRETCH_MODE_STRETCH" value="0" enum="AxisStretchMode"> |
| 113 | Stretch the stylebox's texture. This results in visible distortion unless the texture size matches the stylebox's size perfectly. |
| 114 | </constant> |
| 115 | <constant name="AXIS_STRETCH_MODE_TILE" value="1" enum="AxisStretchMode"> |
| 116 | Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system. |
| 117 | </constant> |
| 118 | <constant name="AXIS_STRETCH_MODE_TILE_FIT" value="2" enum="AxisStretchMode"> |
| 119 | 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. |
| 120 | </constant> |
| 121 | </constants> |
| 122 | </class> |