From f1a76a88207d6eab65b32bcfaecc231b7e38c978 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Tue, 3 Dec 2019 15:46:11 +0100 Subject: [PATCH] Improve the StyleBox class documentations --- doc/classes/StyleBoxFlat.xml | 18 +++++++++++++++--- doc/classes/StyleBoxLine.xml | 7 +++++++ doc/classes/StyleBoxTexture.xml | 15 ++++++++++++++- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/doc/classes/StyleBoxFlat.xml b/doc/classes/StyleBoxFlat.xml index 05ee79eef2e..46b11ac0104 100644 --- a/doc/classes/StyleBoxFlat.xml +++ b/doc/classes/StyleBoxFlat.xml @@ -1,14 +1,14 @@ - Customizable Stylebox with a given set of parameters. (no texture required) + Customizable [StyleBox] with a given set of parameters (no texture required). - 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 @@ + Returns the given [code]margin[/code]'s border width. See [enum Margin] for possible values. + Returns the smallest border width out of all four borders. @@ -44,6 +46,7 @@ + Returns the given [code]corner[/code]'s radius. See [enum Corner] for possible values. @@ -52,6 +55,7 @@ + Returns the size of the given [code]margin[/code]'s expand margin. See [enum Margin] for possible values. @@ -62,6 +66,7 @@ + Sets the border width to [code]width[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values. @@ -70,6 +75,7 @@ + Sets the border width to [code]width[/code] pixels for all margins. @@ -80,6 +86,7 @@ + Sets the corner radius to [code]radius[/code] pixels for the given [code]corner[/code]. See [enum Corner] for possible values. @@ -88,6 +95,7 @@ + Sets the corner radius to [code]radius[/code] pixels for all corners. @@ -102,6 +110,7 @@ + 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. @@ -112,6 +121,7 @@ + Sets the expand margin to [code]size[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values. @@ -120,6 +130,7 @@ + Sets the expand margin to [code]size[/code] pixels for all margins. @@ -134,6 +145,7 @@ + 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. diff --git a/doc/classes/StyleBoxLine.xml b/doc/classes/StyleBoxLine.xml index c0745c5f392..b5da81de79e 100644 --- a/doc/classes/StyleBoxLine.xml +++ b/doc/classes/StyleBoxLine.xml @@ -1,8 +1,10 @@ + [StyleBox] that displays a single line. + [StyleBox] that displays a single line of a given color and thickness. It can be used to draw things like separators. @@ -10,14 +12,19 @@ + The line's color. + 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. + 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. + The line's thickness in pixels. + If [code]true[/code], the line will be vertical. If [code]false[/code], the line will be horizontal. diff --git a/doc/classes/StyleBoxTexture.xml b/doc/classes/StyleBoxTexture.xml index d5efc808460..af4186dcb6f 100644 --- a/doc/classes/StyleBoxTexture.xml +++ b/doc/classes/StyleBoxTexture.xml @@ -15,6 +15,7 @@ + Returns the size of the given [code]margin[/code]'s expand margin. See [enum Margin] for possible values. @@ -23,6 +24,7 @@ + Returns the size of the given [code]margin[/code]. See [enum Margin] for possible values. @@ -31,6 +33,7 @@ + Sets the expand margin to [code]size[/code] pixels for all margins. @@ -45,6 +48,7 @@ + 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. @@ -55,6 +59,7 @@ + Sets the expand margin to [code]size[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values. @@ -65,15 +70,19 @@ + Sets the margin to [code]size[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values. + Controls how the stylebox's texture will be stretched or tiled horizontally. See [enum AxisStretchMode] for possible values. + Controls how the stylebox's texture will be stretched or tiled vertically. See [enum AxisStretchMode] for possible values. + If [code]true[/code], the nine-patch texture's center tile will be drawn. 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. - 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. @@ -124,15 +133,19 @@ + Emitted when the stylebox's texture is changed. + Stretch the stylebox's texture. This results in visible distortion unless the texture size matches the stylebox's size perfectly. + Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system. + 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.