summaryrefslogtreecommitdiff
path: root/doc/classes/StyleBoxTexture.xml
blob: 92939dfbf589c2d632663226929a4fca94518610 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?xml version="1.0" encoding="UTF-8" ?>
<class name="StyleBoxTexture" inherits="StyleBox" version="4.0">
	<brief_description>
		Texture-based nine-patch [StyleBox].
	</brief_description>
	<description>
		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.
	</description>
	<tutorials>
	</tutorials>
	<methods>
		<method name="get_expand_margin_size" qualifiers="const">
			<return type="float" />
			<argument index="0" name="margin" type="int" enum="Side" />
			<description>
				Returns the expand margin size of the specified [enum Side].
			</description>
		</method>
		<method name="get_margin_size" qualifiers="const">
			<return type="float" />
			<argument index="0" name="margin" type="int" enum="Side" />
			<description>
				Returns the margin size of the specified [enum Side].
			</description>
		</method>
		<method name="set_expand_margin_all">
			<return type="void" />
			<argument index="0" name="size" type="float" />
			<description>
				Sets the expand margin to [code]size[/code] pixels for all margins.
			</description>
		</method>
		<method name="set_expand_margin_individual">
			<return type="void" />
			<argument index="0" name="size_left" type="float" />
			<argument index="1" name="size_top" type="float" />
			<argument index="2" name="size_right" type="float" />
			<argument index="3" name="size_bottom" type="float" />
			<description>
				Sets the expand margin for each margin to [code]size_left[/code], [code]size_top[/code], [code]size_right[/code], and [code]size_bottom[/code] pixels.
			</description>
		</method>
		<method name="set_expand_margin_size">
			<return type="void" />
			<argument index="0" name="margin" type="int" enum="Side" />
			<argument index="1" name="size" type="float" />
			<description>
				Sets the expand margin to [code]size[/code] pixels for the specified [enum Side].
			</description>
		</method>
		<method name="set_margin_size">
			<return type="void" />
			<argument index="0" name="margin" type="int" enum="Side" />
			<argument index="1" name="size" type="float" />
			<description>
				Sets the margin to [code]size[/code] pixels for the specified [enum Side].
			</description>
		</method>
	</methods>
	<members>
		<member name="axis_stretch_horizontal" type="int" setter="set_h_axis_stretch_mode" getter="get_h_axis_stretch_mode" enum="StyleBoxTexture.AxisStretchMode" default="0">
			Controls how the stylebox's texture will be stretched or tiled horizontally. See [enum AxisStretchMode] for possible values.
		</member>
		<member name="axis_stretch_vertical" type="int" setter="set_v_axis_stretch_mode" getter="get_v_axis_stretch_mode" enum="StyleBoxTexture.AxisStretchMode" default="0">
			Controls how the stylebox's texture will be stretched or tiled vertically. See [enum AxisStretchMode] for possible values.
		</member>
		<member name="draw_center" type="bool" setter="set_draw_center" getter="is_draw_center_enabled" default="true">
			If [code]true[/code], the nine-patch texture's center tile will be drawn.
		</member>
		<member name="expand_margin_bottom" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" default="0.0">
			Expands the bottom margin of this style box when drawing, causing it to be drawn larger than requested.
		</member>
		<member name="expand_margin_left" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" default="0.0">
			Expands the left margin of this style box when drawing, causing it to be drawn larger than requested.
		</member>
		<member name="expand_margin_right" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" default="0.0">
			Expands the right margin of this style box when drawing, causing it to be drawn larger than requested.
		</member>
		<member name="expand_margin_top" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" default="0.0">
			Expands the top margin of this style box when drawing, causing it to be drawn larger than requested.
		</member>
		<member name="margin_bottom" type="float" setter="set_margin_size" getter="get_margin_size" default="0.0">
			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.
			This is also the value used as fallback for [member StyleBox.content_margin_bottom] if it is negative.
		</member>
		<member name="margin_left" type="float" setter="set_margin_size" getter="get_margin_size" default="0.0">
			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.
			This is also the value used as fallback for [member StyleBox.content_margin_left] if it is negative.
		</member>
		<member name="margin_right" type="float" setter="set_margin_size" getter="get_margin_size" default="0.0">
			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.
			This is also the value used as fallback for [member StyleBox.content_margin_right] if it is negative.
		</member>
		<member name="margin_top" type="float" setter="set_margin_size" getter="get_margin_size" default="0.0">
			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.
			This is also the value used as fallback for [member StyleBox.content_margin_top] if it is negative.
		</member>
		<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)">
			Species a sub-region of the texture to use.
			This is equivalent to first wrapping the texture in an [AtlasTexture] with the same region.
		</member>
		<member name="texture" type="Texture2D" setter="set_texture" getter="get_texture">
			The texture to use when drawing this style box.
		</member>
	</members>
	<constants>
		<constant name="AXIS_STRETCH_MODE_STRETCH" value="0" enum="AxisStretchMode">
			Stretch the stylebox's texture. This results in visible distortion unless the texture size matches the stylebox's size perfectly.
		</constant>
		<constant name="AXIS_STRETCH_MODE_TILE" value="1" enum="AxisStretchMode">
			Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system.
		</constant>
		<constant name="AXIS_STRETCH_MODE_TILE_FIT" value="2" enum="AxisStretchMode">
			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.
		</constant>
	</constants>
</class>