diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/Array.xml | 2 | ||||
-rw-r--r-- | doc/classes/Control.xml | 65 | ||||
-rw-r--r-- | doc/classes/ImageTexture.xml | 6 | ||||
-rw-r--r-- | doc/classes/PackedByteArray.xml | 2 | ||||
-rw-r--r-- | doc/classes/PackedColorArray.xml | 2 | ||||
-rw-r--r-- | doc/classes/PackedFloat32Array.xml | 2 | ||||
-rw-r--r-- | doc/classes/PackedFloat64Array.xml | 2 | ||||
-rw-r--r-- | doc/classes/PackedInt32Array.xml | 2 | ||||
-rw-r--r-- | doc/classes/PackedInt64Array.xml | 2 | ||||
-rw-r--r-- | doc/classes/PackedStringArray.xml | 2 | ||||
-rw-r--r-- | doc/classes/PackedVector2Array.xml | 2 | ||||
-rw-r--r-- | doc/classes/PackedVector3Array.xml | 2 | ||||
-rw-r--r-- | doc/classes/Tabs.xml | 3 | ||||
-rw-r--r-- | doc/classes/TextParagraph.xml | 14 | ||||
-rw-r--r-- | doc/classes/TextServer.xml | 25 | ||||
-rw-r--r-- | doc/classes/Texture2D.xml | 2 | ||||
-rw-r--r-- | doc/classes/Theme.xml | 2 | ||||
-rw-r--r-- | doc/classes/Viewport.xml | 4 | ||||
-rw-r--r-- | doc/classes/bool.xml | 4 | ||||
-rw-r--r-- | doc/classes/float.xml | 45 | ||||
-rw-r--r-- | doc/classes/int.xml | 98 |
21 files changed, 265 insertions, 23 deletions
diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index dcfb91eb61..f3cecc081a 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -328,7 +328,7 @@ [b]Note:[/b] On large arrays, this method will be slower if the inserted element is close to the beginning of the array (index 0). This is because all elements placed after the newly inserted element have to be reindexed. </description> </method> - <method name="invert"> + <method name="reverse"> <return type="void"> </return> <description> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index b22878e56a..c0f918a01f 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -150,7 +150,6 @@ </argument> <description> Overrides the [Color] with given [code]name[/code] in the [member theme] resource the control uses. - [b]Note:[/b] Unlike other theme overrides, there is no way to undo a color override without manually assigning the previous color. [b]Example of overriding a label's color and resetting it later:[/b] [codeblocks] [gdscript] @@ -178,7 +177,7 @@ <argument index="1" name="constant" type="int"> </argument> <description> - Overrides an integer constant with given [code]name[/code] in the [member theme] resource the control uses. If the [code]constant[/code] is [code]0[/code], the override is cleared and the constant from assigned [Theme] is used. + Overrides an integer constant with given [code]name[/code] in the [member theme] resource the control uses. </description> </method> <method name="add_theme_font_override"> @@ -189,7 +188,7 @@ <argument index="1" name="font" type="Font"> </argument> <description> - Overrides the font with given [code]name[/code] in the [member theme] resource the control uses. If [code]font[/code] is [code]null[/code] or invalid, the override is cleared and the font from assigned [Theme] is used. + Overrides the font with given [code]name[/code] in the [member theme] resource the control uses. </description> </method> <method name="add_theme_font_size_override"> @@ -200,7 +199,7 @@ <argument index="1" name="font_size" type="int"> </argument> <description> - Overrides the font size with given [code]name[/code] in the [member theme] resource the control uses. If [code]font_size[/code] is [code]-1[/code], the override is cleared and the font size from assigned [Theme] is used. + Overrides the font size with given [code]name[/code] in the [member theme] resource the control uses. </description> </method> <method name="add_theme_icon_override"> @@ -211,7 +210,7 @@ <argument index="1" name="texture" type="Texture2D"> </argument> <description> - Overrides the icon with given [code]name[/code] in the [member theme] resource the control uses. If [code]icon[/code] is [code]null[/code] or invalid, the override is cleared and the icon from assigned [Theme] is used. + Overrides the icon with given [code]name[/code] in the [member theme] resource the control uses. </description> </method> <method name="add_theme_stylebox_override"> @@ -222,7 +221,7 @@ <argument index="1" name="stylebox" type="StyleBox"> </argument> <description> - Overrides the [StyleBox] with given [code]name[/code] in the [member theme] resource the control uses. If [code]stylebox[/code] is empty or invalid, the override is cleared and the [StyleBox] from assigned [Theme] is used. + Overrides the [StyleBox] with given [code]name[/code] in the [member theme] resource the control uses. [b]Example of modifying a property in a StyleBox by duplicating it:[/b] [codeblocks] [gdscript] @@ -730,6 +729,60 @@ Give up the focus. No other control will be able to receive keyboard input. </description> </method> + <method name="remove_theme_color_override"> + <return type="void"> + </return> + <argument index="0" name="name" type="StringName"> + </argument> + <description> + Removes a theme override for a [Color] with the given [code]name[/code]. + </description> + </method> + <method name="remove_theme_constant_override"> + <return type="void"> + </return> + <argument index="0" name="name" type="StringName"> + </argument> + <description> + Removes a theme override for a constant with the given [code]name[/code]. + </description> + </method> + <method name="remove_theme_font_override"> + <return type="void"> + </return> + <argument index="0" name="name" type="StringName"> + </argument> + <description> + Removes a theme override for a [Font] with the given [code]name[/code]. + </description> + </method> + <method name="remove_theme_font_size_override"> + <return type="void"> + </return> + <argument index="0" name="name" type="StringName"> + </argument> + <description> + Removes a theme override for a font size with the given [code]name[/code]. + </description> + </method> + <method name="remove_theme_icon_override"> + <return type="void"> + </return> + <argument index="0" name="name" type="StringName"> + </argument> + <description> + Removes a theme override for an icon with the given [code]name[/code]. + </description> + </method> + <method name="remove_theme_stylebox_override"> + <return type="void"> + </return> + <argument index="0" name="name" type="StringName"> + </argument> + <description> + Removes a theme override for a [StyleBox] with the given [code]name[/code]. + </description> + </method> <method name="set_anchor"> <return type="void"> </return> diff --git a/doc/classes/ImageTexture.xml b/doc/classes/ImageTexture.xml index 2bea482bc1..5fef56e354 100644 --- a/doc/classes/ImageTexture.xml +++ b/doc/classes/ImageTexture.xml @@ -18,11 +18,11 @@ var texture = load("res://icon.png") $Sprite2D.texture = texture [/codeblock] - This is because images have to be imported as [StreamTexture2D] first to be loaded with [method @GDScript.load]. If you'd still like to load an image file just like any other [Resource], import it as an [Image] resource instead, and then load it normally using the [method @GDScript.load] method. - But do note that the image data can still be retrieved from an imported texture as well using the [method Texture2D.get_data] method, which returns a copy of the data: + This is because images have to be imported as a [StreamTexture2D] first to be loaded with [method @GDScript.load]. If you'd still like to load an image file just like any other [Resource], import it as an [Image] resource instead, and then load it normally using the [method @GDScript.load] method. + [b]Note:[/b] The image can be retrieved from an imported texture using the [method Texture2D.get_image] method, which returns a copy of the image: [codeblock] var texture = load("res://icon.png") - var image : Image = texture.get_data() + var image : Image = texture.get_image() [/codeblock] An [ImageTexture] is not meant to be operated from within the editor interface directly, and is mostly useful for rendering images on screen dynamically via code. If you need to generate images procedurally from within the editor, consider saving and importing images as custom texture resources implementing a new [EditorImportPlugin]. [b]Note:[/b] The maximum texture size is 16384×16384 pixels due to graphics hardware limitations. diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml index 3c7f0f4fad..a668c09fda 100644 --- a/doc/classes/PackedByteArray.xml +++ b/doc/classes/PackedByteArray.xml @@ -157,7 +157,7 @@ Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). </description> </method> - <method name="invert"> + <method name="reverse"> <return type="void"> </return> <description> diff --git a/doc/classes/PackedColorArray.xml b/doc/classes/PackedColorArray.xml index abfedc84cc..99b0f0486a 100644 --- a/doc/classes/PackedColorArray.xml +++ b/doc/classes/PackedColorArray.xml @@ -79,7 +79,7 @@ Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). </description> </method> - <method name="invert"> + <method name="reverse"> <return type="void"> </return> <description> diff --git a/doc/classes/PackedFloat32Array.xml b/doc/classes/PackedFloat32Array.xml index 8918312dc7..99c2d3cf7e 100644 --- a/doc/classes/PackedFloat32Array.xml +++ b/doc/classes/PackedFloat32Array.xml @@ -80,7 +80,7 @@ Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). </description> </method> - <method name="invert"> + <method name="reverse"> <return type="void"> </return> <description> diff --git a/doc/classes/PackedFloat64Array.xml b/doc/classes/PackedFloat64Array.xml index fbb832299e..5a6d4a48c4 100644 --- a/doc/classes/PackedFloat64Array.xml +++ b/doc/classes/PackedFloat64Array.xml @@ -80,7 +80,7 @@ Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). </description> </method> - <method name="invert"> + <method name="reverse"> <return type="void"> </return> <description> diff --git a/doc/classes/PackedInt32Array.xml b/doc/classes/PackedInt32Array.xml index ecef2d508b..a6cf311bc2 100644 --- a/doc/classes/PackedInt32Array.xml +++ b/doc/classes/PackedInt32Array.xml @@ -80,7 +80,7 @@ Inserts a new integer at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). </description> </method> - <method name="invert"> + <method name="reverse"> <return type="void"> </return> <description> diff --git a/doc/classes/PackedInt64Array.xml b/doc/classes/PackedInt64Array.xml index 19619d60cf..05c7c0e072 100644 --- a/doc/classes/PackedInt64Array.xml +++ b/doc/classes/PackedInt64Array.xml @@ -80,7 +80,7 @@ Inserts a new integer at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). </description> </method> - <method name="invert"> + <method name="reverse"> <return type="void"> </return> <description> diff --git a/doc/classes/PackedStringArray.xml b/doc/classes/PackedStringArray.xml index c241573b93..9a2ea21624 100644 --- a/doc/classes/PackedStringArray.xml +++ b/doc/classes/PackedStringArray.xml @@ -80,7 +80,7 @@ Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). </description> </method> - <method name="invert"> + <method name="reverse"> <return type="void"> </return> <description> diff --git a/doc/classes/PackedVector2Array.xml b/doc/classes/PackedVector2Array.xml index 9138dc68e1..7549d4a029 100644 --- a/doc/classes/PackedVector2Array.xml +++ b/doc/classes/PackedVector2Array.xml @@ -80,7 +80,7 @@ Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). </description> </method> - <method name="invert"> + <method name="reverse"> <return type="void"> </return> <description> diff --git a/doc/classes/PackedVector3Array.xml b/doc/classes/PackedVector3Array.xml index 0a3b0cf2c0..a55d2eeaed 100644 --- a/doc/classes/PackedVector3Array.xml +++ b/doc/classes/PackedVector3Array.xml @@ -79,7 +79,7 @@ Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). </description> </method> - <method name="invert"> + <method name="reverse"> <return type="void"> </return> <description> diff --git a/doc/classes/Tabs.xml b/doc/classes/Tabs.xml index 24c114c18b..79fa8896e3 100644 --- a/doc/classes/Tabs.xml +++ b/doc/classes/Tabs.xml @@ -254,6 +254,9 @@ </method> </methods> <members> + <member name="clip_tabs" type="bool" setter="set_clip_tabs" getter="get_clip_tabs" default="true"> + If [code]true[/code], tabs overflowing this node's width will be hidden, displaying two navigation buttons instead. Otherwise, this node's minimum size is updated so that all tabs are visible. + </member> <member name="current_tab" type="int" setter="set_current_tab" getter="get_current_tab" default="0"> Select tab at index [code]tab_idx[/code]. </member> diff --git a/doc/classes/TextParagraph.xml b/doc/classes/TextParagraph.xml index 69bf823ccd..8df53b8423 100644 --- a/doc/classes/TextParagraph.xml +++ b/doc/classes/TextParagraph.xml @@ -289,6 +289,20 @@ Returns the size of the bounding box of the paragraph. </description> </method> + <method name="get_spacing_bottom" qualifiers="const"> + <return type="int"> + </return> + <description> + Returns extra spacing at the bottom of the line. See [member Font.extra_spacing_bottom]. + </description> + </method> + <method name="get_spacing_top" qualifiers="const"> + <return type="int"> + </return> + <description> + Returns extra spacing at the top of the line. See [member Font.extra_spacing_top]. + </description> + </method> <method name="hit_test" qualifiers="const"> <return type="int"> </return> diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml index 4a41b68fee..fe63e434c9 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -258,6 +258,22 @@ Returns advance of the glyph. </description> </method> + <method name="font_get_glyph_contours" qualifiers="const"> + <return type="Dictionary"> + </return> + <argument index="0" name="font" type="RID"> + </argument> + <argument index="1" name="size" type="int"> + </argument> + <argument index="2" name="index" type="int"> + </argument> + <description> + Returns outline contours of the glyph in a Dictionary. + [code]points[/code] - [PackedVector3Array], containing outline points. [code]x[/code] and [code]y[/code] are point coordinates. [code]z[/code] is the type of the point, using the [enum ContourPointTag] values. + [code]contours[/code] - [PackedInt32Array], containing indices the end points of each contour. + [code]orientation[/code] - [bool], contour orientation. If [code]true[/code], clockwise contours must be filled. + </description> + </method> <method name="font_get_glyph_index" qualifiers="const"> <return type="int"> </return> @@ -1301,5 +1317,14 @@ <constant name="FEATURE_USE_SUPPORT_DATA" value="128" enum="Feature"> TextServer require external data file for some features. </constant> + <constant name="CONTOUR_CURVE_TAG_ON" value="1" enum="ContourPointTag"> + Contour point is on the curve. + </constant> + <constant name="CONTOUR_CURVE_TAG_OFF_CONIC" value="0" enum="ContourPointTag"> + Contour point isn't on the curve, but serves as a control point for a conic (quadratic) Bézier arc. + </constant> + <constant name="CONTOUR_CURVE_TAG_OFF_CUBIC" value="2" enum="ContourPointTag"> + Contour point isn't on the curve, but serves as a control point for a cubic Bézier arc. + </constant> </constants> </class> diff --git a/doc/classes/Texture2D.xml b/doc/classes/Texture2D.xml index 2270b95c63..b648098a94 100644 --- a/doc/classes/Texture2D.xml +++ b/doc/classes/Texture2D.xml @@ -63,7 +63,7 @@ Draws a part of the texture using a [CanvasItem] with the [RenderingServer] API. </description> </method> - <method name="get_data" qualifiers="const"> + <method name="get_image" qualifiers="const"> <return type="Image"> </return> <description> diff --git a/doc/classes/Theme.xml b/doc/classes/Theme.xml index ad22573eb8..3173dddb42 100644 --- a/doc/classes/Theme.xml +++ b/doc/classes/Theme.xml @@ -278,7 +278,7 @@ </description> </method> <method name="get_theme_item" qualifiers="const"> - <return type="StyleBox"> + <return type="Variant"> </return> <argument index="0" name="data_type" type="int" enum="Theme.DataType"> </argument> diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 8120ae539e..471d21374d 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -80,9 +80,9 @@ </return> <description> Returns the viewport's texture. - [b]Note:[/b] Due to the way OpenGL works, the resulting [ViewportTexture] is flipped vertically. You can use [method Image.flip_y] on the result of [method Texture2D.get_data] to flip it back, for example: + [b]Note:[/b] Due to the way OpenGL works, the resulting [ViewportTexture] is flipped vertically. You can use [method Image.flip_y] on the result of [method Texture2D.get_image] to flip it back, for example: [codeblock] - var img = get_viewport().get_texture().get_data() + var img = get_viewport().get_texture().get_image() img.flip_y() [/codeblock] </description> diff --git a/doc/classes/bool.xml b/doc/classes/bool.xml index 8da1eb3c88..48f336d58c 100644 --- a/doc/classes/bool.xml +++ b/doc/classes/bool.xml @@ -132,6 +132,7 @@ <argument index="0" name="right" type="bool"> </argument> <description> + Returns [code]true[/code] if two bools are different, i.e. one is [code]true[/code] and the other is [code]false[/code]. </description> </method> <method name="operator <" qualifiers="operator"> @@ -140,6 +141,7 @@ <argument index="0" name="right" type="bool"> </argument> <description> + Returns [code]true[/code] if left operand is [code]false[/code] and right operand is [code]true[/code]. </description> </method> <method name="operator ==" qualifiers="operator"> @@ -148,6 +150,7 @@ <argument index="0" name="right" type="bool"> </argument> <description> + Returns [code]true[/code] if two bools are equal, i.e. both are [code]true[/code] or both are [code]false[/code]. </description> </method> <method name="operator >" qualifiers="operator"> @@ -156,6 +159,7 @@ <argument index="0" name="right" type="bool"> </argument> <description> + Returns [code]true[/code] if left operand is [code]true[/code] and right operand is [code]false[/code]. </description> </method> </methods> diff --git a/doc/classes/float.xml b/doc/classes/float.xml index 85fe31eec8..11f6d91b05 100644 --- a/doc/classes/float.xml +++ b/doc/classes/float.xml @@ -49,6 +49,7 @@ <argument index="0" name="right" type="float"> </argument> <description> + Returns [code]true[/code] if two floats are different from each other. </description> </method> <method name="operator !=" qualifiers="operator"> @@ -57,6 +58,7 @@ <argument index="0" name="right" type="int"> </argument> <description> + Returns [code]true[/code] if the integer has different value than the float. </description> </method> <method name="operator *" qualifiers="operator"> @@ -65,6 +67,7 @@ <argument index="0" name="right" type="float"> </argument> <description> + Multiplies two [float]s. </description> </method> <method name="operator *" qualifiers="operator"> @@ -73,6 +76,10 @@ <argument index="0" name="right" type="Vector2"> </argument> <description> + Multiplies each component of the [Vector2] by the given [float]. + [codeblock] + print(2.5 * Vector2(1, 1)) # Vector2(2.5, 2.5) + [/codeblock] </description> </method> <method name="operator *" qualifiers="operator"> @@ -81,6 +88,10 @@ <argument index="0" name="right" type="Vector2i"> </argument> <description> + Multiplies each component of the [Vector2i] by the given [float]. + [codeblock] + print(2.0 * Vector2i(1, 1)) # Vector2i(2.0, 2.0) + [/codeblock] </description> </method> <method name="operator *" qualifiers="operator"> @@ -89,6 +100,7 @@ <argument index="0" name="right" type="Vector3"> </argument> <description> + Multiplies each component of the [Vector3] by the given [float]. </description> </method> <method name="operator *" qualifiers="operator"> @@ -97,6 +109,7 @@ <argument index="0" name="right" type="Vector3i"> </argument> <description> + Multiplies each component of the [Vector3i] by the given [float]. </description> </method> <method name="operator *" qualifiers="operator"> @@ -105,6 +118,7 @@ <argument index="0" name="right" type="Quat"> </argument> <description> + Multiplies each component of the [Quat] by the given [float]. </description> </method> <method name="operator *" qualifiers="operator"> @@ -113,6 +127,10 @@ <argument index="0" name="right" type="Color"> </argument> <description> + Multiplies each component of the [Color] by the given [float]. + [codeblock] + print(1.5 * Color(0.5, 0.5, 0.5)) # Color(0.75, 0.75, 0.75) + [/codeblock] </description> </method> <method name="operator *" qualifiers="operator"> @@ -121,12 +139,17 @@ <argument index="0" name="right" type="int"> </argument> <description> + Multiplies a [float] and an [int]. The result is a [float]. </description> </method> <method name="operator +" qualifiers="operator"> <return type="float"> </return> <description> + Unary plus operator. Doesn't have any effect. + [codeblock] + var a = +2.5 # a is 2.5. + [/codeblock] </description> </method> <method name="operator +" qualifiers="operator"> @@ -135,6 +158,7 @@ <argument index="0" name="right" type="float"> </argument> <description> + Adds two floats. </description> </method> <method name="operator +" qualifiers="operator"> @@ -143,12 +167,18 @@ <argument index="0" name="right" type="int"> </argument> <description> + Adds a [float] and an [int]. The result is a [float]. </description> </method> <method name="operator -" qualifiers="operator"> <return type="float"> </return> <description> + Unary minus operator. Negates the number. + [codeblock] + var a = -2.5 # a is -2.5. + print(-a) # 2.5 + [/codeblock] </description> </method> <method name="operator -" qualifiers="operator"> @@ -157,6 +187,7 @@ <argument index="0" name="right" type="float"> </argument> <description> + Subtracts a float from a float. </description> </method> <method name="operator -" qualifiers="operator"> @@ -165,6 +196,7 @@ <argument index="0" name="right" type="int"> </argument> <description> + Subtracts an [int] from a [float]. The result is a [float]. </description> </method> <method name="operator /" qualifiers="operator"> @@ -173,6 +205,7 @@ <argument index="0" name="right" type="float"> </argument> <description> + Divides two floats. </description> </method> <method name="operator /" qualifiers="operator"> @@ -181,6 +214,7 @@ <argument index="0" name="right" type="int"> </argument> <description> + Divides a [float] by an [int]. The result is a [float]. </description> </method> <method name="operator <" qualifiers="operator"> @@ -189,6 +223,7 @@ <argument index="0" name="right" type="float"> </argument> <description> + Returns [code]true[/code] the left float is less than the right one. </description> </method> <method name="operator <" qualifiers="operator"> @@ -197,6 +232,7 @@ <argument index="0" name="right" type="int"> </argument> <description> + Returns [code]true[/code] if this [float] is less than the given [int]. </description> </method> <method name="operator <=" qualifiers="operator"> @@ -205,6 +241,7 @@ <argument index="0" name="right" type="float"> </argument> <description> + Returns [code]true[/code] the left integer is less than or equal to the right one. </description> </method> <method name="operator <=" qualifiers="operator"> @@ -213,6 +250,7 @@ <argument index="0" name="right" type="int"> </argument> <description> + Returns [code]true[/code] if this [float] is less than or equal to the given [int]. </description> </method> <method name="operator ==" qualifiers="operator"> @@ -221,6 +259,8 @@ <argument index="0" name="right" type="float"> </argument> <description> + Returns [code]true[/code] if both floats are exactly equal. + [b]Note:[/b] Due to floating-point precision errors, consider using [method @GlobalScope.is_equal_approx] or [method @GlobalScope.is_zero_approx] instead, which are more reliable. </description> </method> <method name="operator ==" qualifiers="operator"> @@ -229,6 +269,7 @@ <argument index="0" name="right" type="int"> </argument> <description> + Returns [code]true[/code] if the [float] and the given [int] are equal. </description> </method> <method name="operator >" qualifiers="operator"> @@ -237,6 +278,7 @@ <argument index="0" name="right" type="float"> </argument> <description> + Returns [code]true[/code] the left float is greater than the right one. </description> </method> <method name="operator >" qualifiers="operator"> @@ -245,6 +287,7 @@ <argument index="0" name="right" type="int"> </argument> <description> + Returns [code]true[/code] if this [float] is greater than the given [int]. </description> </method> <method name="operator >=" qualifiers="operator"> @@ -253,6 +296,7 @@ <argument index="0" name="right" type="float"> </argument> <description> + Returns [code]true[/code] the left float is greater than or equal to the right one. </description> </method> <method name="operator >=" qualifiers="operator"> @@ -261,6 +305,7 @@ <argument index="0" name="right" type="int"> </argument> <description> + Returns [code]true[/code] if this [float] is greater than or equal to the given [int]. </description> </method> </methods> diff --git a/doc/classes/int.xml b/doc/classes/int.xml index a63c509937..119cdf8eeb 100644 --- a/doc/classes/int.xml +++ b/doc/classes/int.xml @@ -79,6 +79,7 @@ <argument index="0" name="right" type="float"> </argument> <description> + Returns [code]true[/code] if operands are different from each other. </description> </method> <method name="operator !=" qualifiers="operator"> @@ -87,6 +88,7 @@ <argument index="0" name="right" type="int"> </argument> <description> + Returns [code]true[/code] if operands are different from each other. </description> </method> <method name="operator %" qualifiers="operator"> @@ -95,6 +97,12 @@ <argument index="0" name="right" type="int"> </argument> <description> + Returns the result of the modulo operator for two integers, i.e. the remainder after dividing both numbers. + [codeblock] + print(5 % 2) # 1 + print(12 % 4) # 0 + print(12 % 2) # 2 + [/codeblock] </description> </method> <method name="operator &" qualifiers="operator"> @@ -103,6 +111,18 @@ <argument index="0" name="right" type="int"> </argument> <description> + Returns the result of bitwise [code]AND[/code] operation for two integers. + [codeblock] + print(3 & 1) # 1 + print(11 & 3) # 3 + [/codeblock] + It's useful to retrieve binary flags from a variable. + [codeblock] + var flags = 5 + # Do something if the first bit is enabled. + if flags & 1: + do_stuff() + [/codeblock] </description> </method> <method name="operator *" qualifiers="operator"> @@ -111,6 +131,7 @@ <argument index="0" name="right" type="float"> </argument> <description> + Multiplies an [int] and a [float]. The result is a [float]. </description> </method> <method name="operator *" qualifiers="operator"> @@ -119,6 +140,7 @@ <argument index="0" name="right" type="int"> </argument> <description> + Multiplies two [int]s. </description> </method> <method name="operator *" qualifiers="operator"> @@ -127,6 +149,10 @@ <argument index="0" name="right" type="Vector2"> </argument> <description> + Multiplies each component of the vector by the given integer. + [codeblock] + print(2 * Vector2(1, 1)) # Vector2(2, 2) + [/codeblock] </description> </method> <method name="operator *" qualifiers="operator"> @@ -135,6 +161,7 @@ <argument index="0" name="right" type="Vector2i"> </argument> <description> + Multiplies each component of the integer vector by the given integer. </description> </method> <method name="operator *" qualifiers="operator"> @@ -143,6 +170,7 @@ <argument index="0" name="right" type="Vector3"> </argument> <description> + Multiplies each component of the vector by the given integer. </description> </method> <method name="operator *" qualifiers="operator"> @@ -151,6 +179,7 @@ <argument index="0" name="right" type="Vector3i"> </argument> <description> + Multiplies each component of the integer vector by the given integer. </description> </method> <method name="operator *" qualifiers="operator"> @@ -159,6 +188,7 @@ <argument index="0" name="right" type="Quat"> </argument> <description> + Multiplies each component of the quaternion by the given integer. </description> </method> <method name="operator *" qualifiers="operator"> @@ -167,12 +197,20 @@ <argument index="0" name="right" type="Color"> </argument> <description> + Multiplies each component of the color by the given integer. + [codeblock] + print(2 * Color(0.5, 0.5, 0.5)) # Color(1, 1, 1) + [/codeblock] </description> </method> <method name="operator +" qualifiers="operator"> <return type="int"> </return> <description> + Unary plus operator. Doesn't have any effect. + [codeblock] + var a = +1 # a is 1. + [/codeblock] </description> </method> <method name="operator +" qualifiers="operator"> @@ -181,6 +219,7 @@ <argument index="0" name="right" type="float"> </argument> <description> + Adds an [int] to a [float]. The result is a [float]. </description> </method> <method name="operator +" qualifiers="operator"> @@ -189,12 +228,18 @@ <argument index="0" name="right" type="int"> </argument> <description> + Adds two integers. </description> </method> <method name="operator -" qualifiers="operator"> <return type="int"> </return> <description> + Unary minus operator. Negates the number. + [codeblock] + var a = -1 # a is -1. + print(-a) # 1 + [/codeblock] </description> </method> <method name="operator -" qualifiers="operator"> @@ -203,6 +248,7 @@ <argument index="0" name="right" type="float"> </argument> <description> + Subtracts a [float] from an [int]. The result is a [float]. </description> </method> <method name="operator -" qualifiers="operator"> @@ -211,6 +257,7 @@ <argument index="0" name="right" type="int"> </argument> <description> + Subtracts two integers. </description> </method> <method name="operator /" qualifiers="operator"> @@ -219,6 +266,10 @@ <argument index="0" name="right" type="float"> </argument> <description> + Divides an [int] by a [float]. The result is a [float]. + [codeblock] + print(10 / 3.0) # 3.333... + [/codeblock] </description> </method> <method name="operator /" qualifiers="operator"> @@ -227,6 +278,11 @@ <argument index="0" name="right" type="int"> </argument> <description> + Divides two integers. The decimal part of the result is discarded (truncated). + [codeblock] + print(10 / 2) # 5 + print(10 / 3) # 3 + [/codeblock] </description> </method> <method name="operator <" qualifiers="operator"> @@ -235,6 +291,7 @@ <argument index="0" name="right" type="float"> </argument> <description> + Returns [code]true[/code] if this [int] is less than the given [float]. </description> </method> <method name="operator <" qualifiers="operator"> @@ -243,6 +300,7 @@ <argument index="0" name="right" type="int"> </argument> <description> + Returns [code]true[/code] the left integer is less than the right one. </description> </method> <method name="operator <<" qualifiers="operator"> @@ -251,6 +309,11 @@ <argument index="0" name="right" type="int"> </argument> <description> + Performs bitwise shift left operation on the integer. Effectively the same as multiplying by a power of 2. + [codeblock] + print(10 << 1) # 20 + print(10 << 4) # 160 + [/codeblock] </description> </method> <method name="operator <=" qualifiers="operator"> @@ -259,6 +322,7 @@ <argument index="0" name="right" type="float"> </argument> <description> + Returns [code]true[/code] if this [int] is less than or equal to the given [float]. </description> </method> <method name="operator <=" qualifiers="operator"> @@ -267,6 +331,7 @@ <argument index="0" name="right" type="int"> </argument> <description> + Returns [code]true[/code] the left integer is less than or equal to the right one. </description> </method> <method name="operator ==" qualifiers="operator"> @@ -275,6 +340,7 @@ <argument index="0" name="right" type="float"> </argument> <description> + Returns [code]true[/code] if the integer is equal to the given [float]. </description> </method> <method name="operator ==" qualifiers="operator"> @@ -283,6 +349,7 @@ <argument index="0" name="right" type="int"> </argument> <description> + Returns [code]true[/code] if both integers are equal. </description> </method> <method name="operator >" qualifiers="operator"> @@ -291,6 +358,7 @@ <argument index="0" name="right" type="float"> </argument> <description> + Returns [code]true[/code] if this [int] is greater than the given [float]. </description> </method> <method name="operator >" qualifiers="operator"> @@ -299,6 +367,7 @@ <argument index="0" name="right" type="int"> </argument> <description> + Returns [code]true[/code] the left integer is greater than the right one. </description> </method> <method name="operator >=" qualifiers="operator"> @@ -307,6 +376,7 @@ <argument index="0" name="right" type="float"> </argument> <description> + Returns [code]true[/code] if this [int] is greater than or equal to the given [float]. </description> </method> <method name="operator >=" qualifiers="operator"> @@ -315,6 +385,7 @@ <argument index="0" name="right" type="int"> </argument> <description> + Returns [code]true[/code] the left integer is greater than or equal to the right one. </description> </method> <method name="operator >>" qualifiers="operator"> @@ -323,6 +394,11 @@ <argument index="0" name="right" type="int"> </argument> <description> + Performs bitwise shift right operation on the integer. Effectively the same as dividing by a power of 2. + [codeblock] + print(10 >> 1) # 5 + print(10 >> 2) # 2 + [/codeblock] </description> </method> <method name="operator ^" qualifiers="operator"> @@ -331,6 +407,11 @@ <argument index="0" name="right" type="int"> </argument> <description> + Returns the result of bitwise [code]XOR[/code] operation for two integers. + [codeblock] + print(5 ^ 1) # 4 + print(4 ^ 7) # 3 + [/codeblock] </description> </method> <method name="operator |" qualifiers="operator"> @@ -339,12 +420,29 @@ <argument index="0" name="right" type="int"> </argument> <description> + Returns the result of bitwise [code]OR[/code] operation for two integers. + [codeblock] + print(2 | 4) # 6 + print(1 | 3) # 3 + [/codeblock] + It's useful to store binary flags in a variable. + [codeblock] + var flags = 0 + # Turn first and third bit on. + flags |= 1 + flags |= 4 + [/codeblock] </description> </method> <method name="operator ~" qualifiers="operator"> <return type="int"> </return> <description> + Returns the result of bitwise [code]NOT[/code] operation for the integer. It's effectively equal to [code]-int + 1[/code]. + [codeblock] + print(~4) # -3 + print(~7) # -6 + [/codeblock] </description> </method> </methods> |