Bläddra i källkod

Improve the StyleBox class documentations

Hugo Locurcio 5 år sedan
förälder
incheckning
f1a76a8820
3 ändrade filer med 36 tillägg och 4 borttagningar
  1. 15 3
      doc/classes/StyleBoxFlat.xml
  2. 7 0
      doc/classes/StyleBoxLine.xml
  3. 14 1
      doc/classes/StyleBoxTexture.xml

+ 15 - 3
doc/classes/StyleBoxFlat.xml

@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <?xml version="1.0" encoding="UTF-8" ?>
 <class name="StyleBoxFlat" inherits="StyleBox" category="Core" version="3.2">
 <class name="StyleBoxFlat" inherits="StyleBox" category="Core" version="3.2">
 	<brief_description>
 	<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>
 	</brief_description>
 	<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
 		- Color
 		- Border width (individual width for each border)
 		- Border width (individual width for each border)
 		- Rounded corners (individual radius for each corner)
 		- 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:
 		Setting corner radius to high values is allowed. As soon as corners would overlap, the stylebox will switch to a relative system. Example:
 		[codeblock]
 		[codeblock]
 		height = 30
 		height = 30
@@ -30,12 +30,14 @@
 			<argument index="0" name="margin" type="int" enum="Margin">
 			<argument index="0" name="margin" type="int" enum="Margin">
 			</argument>
 			</argument>
 			<description>
 			<description>
+				Returns the given [code]margin[/code]'s border width. See [enum Margin] for possible values.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="get_border_width_min" qualifiers="const">
 		<method name="get_border_width_min" qualifiers="const">
 			<return type="int">
 			<return type="int">
 			</return>
 			</return>
 			<description>
 			<description>
+				Returns the smallest border width out of all four borders.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="get_corner_radius" qualifiers="const">
 		<method name="get_corner_radius" qualifiers="const">
@@ -44,6 +46,7 @@
 			<argument index="0" name="corner" type="int" enum="Corner">
 			<argument index="0" name="corner" type="int" enum="Corner">
 			</argument>
 			</argument>
 			<description>
 			<description>
+				Returns the given [code]corner[/code]'s radius. See [enum Corner] for possible values.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="get_expand_margin" qualifiers="const">
 		<method name="get_expand_margin" qualifiers="const">
@@ -52,6 +55,7 @@
 			<argument index="0" name="margin" type="int" enum="Margin">
 			<argument index="0" name="margin" type="int" enum="Margin">
 			</argument>
 			</argument>
 			<description>
 			<description>
+				Returns the size of the given [code]margin[/code]'s expand margin. See [enum Margin] for possible values.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="set_border_width">
 		<method name="set_border_width">
@@ -62,6 +66,7 @@
 			<argument index="1" name="width" type="int">
 			<argument index="1" name="width" type="int">
 			</argument>
 			</argument>
 			<description>
 			<description>
+				Sets the border width to [code]width[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="set_border_width_all">
 		<method name="set_border_width_all">
@@ -70,6 +75,7 @@
 			<argument index="0" name="width" type="int">
 			<argument index="0" name="width" type="int">
 			</argument>
 			</argument>
 			<description>
 			<description>
+				Sets the border width to [code]width[/code] pixels for all margins.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="set_corner_radius">
 		<method name="set_corner_radius">
@@ -80,6 +86,7 @@
 			<argument index="1" name="radius" type="int">
 			<argument index="1" name="radius" type="int">
 			</argument>
 			</argument>
 			<description>
 			<description>
+				Sets the corner radius to [code]radius[/code] pixels for the given [code]corner[/code]. See [enum Corner] for possible values.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="set_corner_radius_all">
 		<method name="set_corner_radius_all">
@@ -88,6 +95,7 @@
 			<argument index="0" name="radius" type="int">
 			<argument index="0" name="radius" type="int">
 			</argument>
 			</argument>
 			<description>
 			<description>
+				Sets the corner radius to [code]radius[/code] pixels for all corners.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="set_corner_radius_individual">
 		<method name="set_corner_radius_individual">
@@ -102,6 +110,7 @@
 			<argument index="3" name="radius_bottom_left" type="int">
 			<argument index="3" name="radius_bottom_left" type="int">
 			</argument>
 			</argument>
 			<description>
 			<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>
 			</description>
 		</method>
 		</method>
 		<method name="set_expand_margin">
 		<method name="set_expand_margin">
@@ -112,6 +121,7 @@
 			<argument index="1" name="size" type="float">
 			<argument index="1" name="size" type="float">
 			</argument>
 			</argument>
 			<description>
 			<description>
+				Sets the expand margin to [code]size[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="set_expand_margin_all">
 		<method name="set_expand_margin_all">
@@ -120,6 +130,7 @@
 			<argument index="0" name="size" type="float">
 			<argument index="0" name="size" type="float">
 			</argument>
 			</argument>
 			<description>
 			<description>
+				Sets the expand margin to [code]size[/code] pixels for all margins.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="set_expand_margin_individual">
 		<method name="set_expand_margin_individual">
@@ -134,6 +145,7 @@
 			<argument index="3" name="size_bottom" type="float">
 			<argument index="3" name="size_bottom" type="float">
 			</argument>
 			</argument>
 			<description>
 			<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>
 			</description>
 		</method>
 		</method>
 	</methods>
 	</methods>

+ 7 - 0
doc/classes/StyleBoxLine.xml

@@ -1,8 +1,10 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <?xml version="1.0" encoding="UTF-8" ?>
 <class name="StyleBoxLine" inherits="StyleBox" category="Core" version="3.2">
 <class name="StyleBoxLine" inherits="StyleBox" category="Core" version="3.2">
 	<brief_description>
 	<brief_description>
+		[StyleBox] that displays a single line.
 	</brief_description>
 	</brief_description>
 	<description>
 	<description>
+		[StyleBox] that displays a single line of a given color and thickness. It can be used to draw things like separators.
 	</description>
 	</description>
 	<tutorials>
 	<tutorials>
 	</tutorials>
 	</tutorials>
@@ -10,14 +12,19 @@
 	</methods>
 	</methods>
 	<members>
 	<members>
 		<member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 0, 0, 0, 1 )">
 		<member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 0, 0, 0, 1 )">
+			The line's color.
 		</member>
 		</member>
 		<member name="grow_begin" type="float" setter="set_grow_begin" getter="get_grow_begin" default="1.0">
 		<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>
 		<member name="grow_end" type="float" setter="set_grow_end" getter="get_grow_end" default="1.0">
 		<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>
 		<member name="thickness" type="int" setter="set_thickness" getter="get_thickness" default="1">
 		<member name="thickness" type="int" setter="set_thickness" getter="get_thickness" default="1">
+			The line's thickness in pixels.
 		</member>
 		</member>
 		<member name="vertical" type="bool" setter="set_vertical" getter="is_vertical" default="false">
 		<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>
 		</member>
 	</members>
 	</members>
 	<constants>
 	<constants>

+ 14 - 1
doc/classes/StyleBoxTexture.xml

@@ -15,6 +15,7 @@
 			<argument index="0" name="margin" type="int" enum="Margin">
 			<argument index="0" name="margin" type="int" enum="Margin">
 			</argument>
 			</argument>
 			<description>
 			<description>
+				Returns the size of the given [code]margin[/code]'s expand margin. See [enum Margin] for possible values.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="get_margin_size" qualifiers="const">
 		<method name="get_margin_size" qualifiers="const">
@@ -23,6 +24,7 @@
 			<argument index="0" name="margin" type="int" enum="Margin">
 			<argument index="0" name="margin" type="int" enum="Margin">
 			</argument>
 			</argument>
 			<description>
 			<description>
+				Returns the size of the given [code]margin[/code]. See [enum Margin] for possible values.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="set_expand_margin_all">
 		<method name="set_expand_margin_all">
@@ -31,6 +33,7 @@
 			<argument index="0" name="size" type="float">
 			<argument index="0" name="size" type="float">
 			</argument>
 			</argument>
 			<description>
 			<description>
+				Sets the expand margin to [code]size[/code] pixels for all margins.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="set_expand_margin_individual">
 		<method name="set_expand_margin_individual">
@@ -45,6 +48,7 @@
 			<argument index="3" name="size_bottom" type="float">
 			<argument index="3" name="size_bottom" type="float">
 			</argument>
 			</argument>
 			<description>
 			<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>
 			</description>
 		</method>
 		</method>
 		<method name="set_expand_margin_size">
 		<method name="set_expand_margin_size">
@@ -55,6 +59,7 @@
 			<argument index="1" name="size" type="float">
 			<argument index="1" name="size" type="float">
 			</argument>
 			</argument>
 			<description>
 			<description>
+				Sets the expand margin to [code]size[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="set_margin_size">
 		<method name="set_margin_size">
@@ -65,15 +70,19 @@
 			<argument index="1" name="size" type="float">
 			<argument index="1" name="size" type="float">
 			</argument>
 			</argument>
 			<description>
 			<description>
+				Sets the margin to [code]size[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values.
 			</description>
 			</description>
 		</method>
 		</method>
 	</methods>
 	</methods>
 	<members>
 	<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">
 		<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>
 		<member name="axis_stretch_vertical" type="int" setter="set_v_axis_stretch_mode" getter="get_v_axis_stretch_mode" enum="StyleBoxTexture.AxisStretchMode" default="0">
 		<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>
 		<member name="draw_center" type="bool" setter="set_draw_center" getter="is_draw_center_enabled" default="true">
 		<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>
 		<member name="expand_margin_bottom" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" default="0.0">
 		<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.
 			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.
 			The normal map to use when drawing this style box.
 		</member>
 		</member>
 		<member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )">
 		<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.
 			This is equivalent to first wrapping the texture in an [AtlasTexture] with the same region.
 		</member>
 		</member>
 		<member name="texture" type="Texture" setter="set_texture" getter="get_texture">
 		<member name="texture" type="Texture" setter="set_texture" getter="get_texture">
@@ -124,15 +133,19 @@
 	<signals>
 	<signals>
 		<signal name="texture_changed">
 		<signal name="texture_changed">
 			<description>
 			<description>
+				Emitted when the stylebox's texture is changed.
 			</description>
 			</description>
 		</signal>
 		</signal>
 	</signals>
 	</signals>
 	<constants>
 	<constants>
 		<constant name="AXIS_STRETCH_MODE_STRETCH" value="0" enum="AxisStretchMode">
 		<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>
 		<constant name="AXIS_STRETCH_MODE_TILE" value="1" enum="AxisStretchMode">
 		<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>
 		<constant name="AXIS_STRETCH_MODE_TILE_FIT" value="2" enum="AxisStretchMode">
 		<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>
 		</constant>
 	</constants>
 	</constants>
 </class>
 </class>