Improve the StyleBox class documentations
This commit is contained in:
parent
2b824b4e45
commit
f1a76a8820
|
@ -1,14 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="StyleBoxFlat" inherits="StyleBox" category="Core" version="3.2">
|
||||
<brief_description>
|
||||
Customizable Stylebox with a given set of parameters. (no texture required)
|
||||
Customizable [StyleBox] with a given set of parameters (no texture required).
|
||||
</brief_description>
|
||||
<description>
|
||||
This stylebox can be used to achieve all kinds of looks without the need of a texture. Those properties are customizable:
|
||||
This [StyleBox] can be used to achieve all kinds of looks without the need of a texture. Those properties are customizable:
|
||||
- Color
|
||||
- Border width (individual width for each border)
|
||||
- Rounded corners (individual radius for each corner)
|
||||
- Shadow
|
||||
- Shadow (with blur and offset)
|
||||
Setting corner radius to high values is allowed. As soon as corners would overlap, the stylebox will switch to a relative system. Example:
|
||||
[codeblock]
|
||||
height = 30
|
||||
|
@ -30,12 +30,14 @@
|
|||
<argument index="0" name="margin" type="int" enum="Margin">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the given [code]margin[/code]'s border width. See [enum Margin] for possible values.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_border_width_min" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<description>
|
||||
Returns the smallest border width out of all four borders.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_corner_radius" qualifiers="const">
|
||||
|
@ -44,6 +46,7 @@
|
|||
<argument index="0" name="corner" type="int" enum="Corner">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the given [code]corner[/code]'s radius. See [enum Corner] for possible values.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_expand_margin" qualifiers="const">
|
||||
|
@ -52,6 +55,7 @@
|
|||
<argument index="0" name="margin" type="int" enum="Margin">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the size of the given [code]margin[/code]'s expand margin. See [enum Margin] for possible values.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_border_width">
|
||||
|
@ -62,6 +66,7 @@
|
|||
<argument index="1" name="width" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Sets the border width to [code]width[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_border_width_all">
|
||||
|
@ -70,6 +75,7 @@
|
|||
<argument index="0" name="width" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Sets the border width to [code]width[/code] pixels for all margins.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_corner_radius">
|
||||
|
@ -80,6 +86,7 @@
|
|||
<argument index="1" name="radius" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Sets the corner radius to [code]radius[/code] pixels for the given [code]corner[/code]. See [enum Corner] for possible values.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_corner_radius_all">
|
||||
|
@ -88,6 +95,7 @@
|
|||
<argument index="0" name="radius" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Sets the corner radius to [code]radius[/code] pixels for all corners.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_corner_radius_individual">
|
||||
|
@ -102,6 +110,7 @@
|
|||
<argument index="3" name="radius_bottom_left" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Sets the corner radius for each corner to [code]radius_top_left[/code], [code]radius_top_right[/code], [code]radius_bottom_right[/code], and [code]radius_bottom_left[/code] pixels.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_expand_margin">
|
||||
|
@ -112,6 +121,7 @@
|
|||
<argument index="1" name="size" type="float">
|
||||
</argument>
|
||||
<description>
|
||||
Sets the expand margin to [code]size[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_expand_margin_all">
|
||||
|
@ -120,6 +130,7 @@
|
|||
<argument index="0" name="size" type="float">
|
||||
</argument>
|
||||
<description>
|
||||
Sets the expand margin to [code]size[/code] pixels for all margins.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_expand_margin_individual">
|
||||
|
@ -134,6 +145,7 @@
|
|||
<argument index="3" name="size_bottom" type="float">
|
||||
</argument>
|
||||
<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>
|
||||
</methods>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="StyleBoxLine" inherits="StyleBox" category="Core" version="3.2">
|
||||
<brief_description>
|
||||
[StyleBox] that displays a single line.
|
||||
</brief_description>
|
||||
<description>
|
||||
[StyleBox] that displays a single line of a given color and thickness. It can be used to draw things like separators.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
@ -10,14 +12,19 @@
|
|||
</methods>
|
||||
<members>
|
||||
<member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 0, 0, 0, 1 )">
|
||||
The line's color.
|
||||
</member>
|
||||
<member name="grow_begin" type="float" setter="set_grow_begin" getter="get_grow_begin" default="1.0">
|
||||
The number of pixels the line will extend before the [StyleBoxLine]'s bounds. If set to a negative value, the line will begin inside the [StyleBoxLine]'s bounds.
|
||||
</member>
|
||||
<member name="grow_end" type="float" setter="set_grow_end" getter="get_grow_end" default="1.0">
|
||||
The number of pixels the line will extend past the [StyleBoxLine]'s bounds. If set to a negative value, the line will end inside the [StyleBoxLine]'s bounds.
|
||||
</member>
|
||||
<member name="thickness" type="int" setter="set_thickness" getter="get_thickness" default="1">
|
||||
The line's thickness in pixels.
|
||||
</member>
|
||||
<member name="vertical" type="bool" setter="set_vertical" getter="is_vertical" default="false">
|
||||
If [code]true[/code], the line will be vertical. If [code]false[/code], the line will be horizontal.
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
<argument index="0" name="margin" type="int" enum="Margin">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the size of the given [code]margin[/code]'s expand margin. See [enum Margin] for possible values.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_margin_size" qualifiers="const">
|
||||
|
@ -23,6 +24,7 @@
|
|||
<argument index="0" name="margin" type="int" enum="Margin">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the size of the given [code]margin[/code]. See [enum Margin] for possible values.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_expand_margin_all">
|
||||
|
@ -31,6 +33,7 @@
|
|||
<argument index="0" name="size" type="float">
|
||||
</argument>
|
||||
<description>
|
||||
Sets the expand margin to [code]size[/code] pixels for all margins.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_expand_margin_individual">
|
||||
|
@ -45,6 +48,7 @@
|
|||
<argument index="3" name="size_bottom" type="float">
|
||||
</argument>
|
||||
<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">
|
||||
|
@ -55,6 +59,7 @@
|
|||
<argument index="1" name="size" type="float">
|
||||
</argument>
|
||||
<description>
|
||||
Sets the expand margin to [code]size[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_margin_size">
|
||||
|
@ -65,15 +70,19 @@
|
|||
<argument index="1" name="size" type="float">
|
||||
</argument>
|
||||
<description>
|
||||
Sets the margin to [code]size[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values.
|
||||
</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.
|
||||
|
@ -114,7 +123,7 @@
|
|||
The normal map to use when drawing this style box.
|
||||
</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.
|
||||
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="Texture" setter="set_texture" getter="get_texture">
|
||||
|
@ -124,15 +133,19 @@
|
|||
<signals>
|
||||
<signal name="texture_changed">
|
||||
<description>
|
||||
Emitted when the stylebox's texture is changed.
|
||||
</description>
|
||||
</signal>
|
||||
</signals>
|
||||
<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>
|
||||
|
|
Loading…
Reference in New Issue