From 9e93f5b478c8ee15dcec54df90e74dca09245a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20GULLY?= Date: Mon, 9 Oct 2017 12:49:12 +0200 Subject: [PATCH] [DOCS] Review and improve 17 classes (#11890) --- doc/classes/AcceptDialog.xml | 2 + doc/classes/Array.xml | 1 + doc/classes/BitMap.xml | 3 + doc/classes/CanvasModulate.xml | 5 +- doc/classes/ColorRect.xml | 4 ++ doc/classes/ConvexPolygonShape.xml | 5 +- doc/classes/ConvexPolygonShape2D.xml | 5 +- doc/classes/Directory.xml | 1 + doc/classes/File.xml | 92 ++++++++++++++-------------- doc/classes/FuncRef.xml | 5 +- doc/classes/Gradient.xml | 4 +- doc/classes/GridContainer.xml | 1 + doc/classes/ImageTexture.xml | 3 +- doc/classes/ImmediateGeometry.xml | 19 +++--- doc/classes/Label.xml | 23 +++---- doc/classes/LargeTexture.xml | 22 ++++--- doc/classes/Light2D.xml | 14 +++-- 17 files changed, 120 insertions(+), 89 deletions(-) diff --git a/doc/classes/AcceptDialog.xml b/doc/classes/AcceptDialog.xml index 4244e66a35a..f87a40b8aaa 100644 --- a/doc/classes/AcceptDialog.xml +++ b/doc/classes/AcceptDialog.xml @@ -92,8 +92,10 @@ + If [code]true[/code] the dialog is hidden when accepted. Default value: [code]true[/code]. + The text displayed by this dialog. diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 9542c83eaf0..47100f23b8e 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -104,6 +104,7 @@ + Returns a copy of this [code]Array[/code]. diff --git a/doc/classes/BitMap.xml b/doc/classes/BitMap.xml index d872d0892d8..63e6a5f6827 100644 --- a/doc/classes/BitMap.xml +++ b/doc/classes/BitMap.xml @@ -77,6 +77,9 @@ + Returns a [Dictionary] with two keys : + [code]data[/code] : [PoolByteArray] with [code]true[/code]/[code]false[/code] [code]BitMap[/code] data. + [code]size[/code] : The [code]Bitmap[/code]'s size. diff --git a/doc/classes/CanvasModulate.xml b/doc/classes/CanvasModulate.xml index f0e3132da54..b4b20e29f94 100644 --- a/doc/classes/CanvasModulate.xml +++ b/doc/classes/CanvasModulate.xml @@ -1,10 +1,10 @@ - Tint the entire canvas + Tint the entire canvas. - CanvasModulate tints the canvas elements using its assigned color + [code]CanvasModulate[/code] tints the canvas elements using its assigned [code]color[/code]. @@ -30,6 +30,7 @@ + The tint color to apply. diff --git a/doc/classes/ColorRect.xml b/doc/classes/ColorRect.xml index 90e88603b08..6e70a1e8b74 100644 --- a/doc/classes/ColorRect.xml +++ b/doc/classes/ColorRect.xml @@ -38,6 +38,10 @@ + The color to fill the [code]ColorRect[/code]. + [codeblock] + $ColorRect.color = Color(1, 0, 0, 1) # Set ColorRect node's color to red + [/codeblock] diff --git a/doc/classes/ConvexPolygonShape.xml b/doc/classes/ConvexPolygonShape.xml index 9a7cb0d475b..822b99547e8 100644 --- a/doc/classes/ConvexPolygonShape.xml +++ b/doc/classes/ConvexPolygonShape.xml @@ -1,10 +1,10 @@ - Convex Polygon Shape. + Convex polygon shape for 3D physics. - Convex polygon shape resource, which can be set into a [PhysicsBody] or area. + Convex polygon shape resource, which can be added to a [PhysicsBody] or area. @@ -28,6 +28,7 @@ + The list of 3D points forming the convex polygon shape. diff --git a/doc/classes/ConvexPolygonShape2D.xml b/doc/classes/ConvexPolygonShape2D.xml index c5b6d900416..0cb4f4045b5 100644 --- a/doc/classes/ConvexPolygonShape2D.xml +++ b/doc/classes/ConvexPolygonShape2D.xml @@ -16,7 +16,7 @@ - Return a list of points in either clockwise or counter clockwise order, forming a convex polygon. + Returns a list of points in either clockwise or counter clockwise order, forming a convex polygon. @@ -34,12 +34,13 @@ - Set a list of points in either clockwise or counter clockwise order, forming a convex polygon. + Sets a list of points in either clockwise or counter clockwise order, forming a convex polygon. + The polygon's list of vertices. Can be in either clockwise or counterclockwise order. diff --git a/doc/classes/Directory.xml b/doc/classes/Directory.xml index ee0b873084b..c3c4c7a8ac3 100644 --- a/doc/classes/Directory.xml +++ b/doc/classes/Directory.xml @@ -85,6 +85,7 @@ + Returns the currently opened directory's drive index. See [method get_drive] to convert returned index to the name of the drive. diff --git a/doc/classes/File.xml b/doc/classes/File.xml index fd71f42a046..6272d4105c4 100644 --- a/doc/classes/File.xml +++ b/doc/classes/File.xml @@ -30,14 +30,14 @@ - Close the currently opened file. + Closes the currently opened file. - Returns [code]true[/code] if the file cursor reached the end of the file. + Returns [code]true[/code] if the file cursor has reached the end of the file. @@ -46,42 +46,42 @@ - Returns [code]true[/code] if the file in the specified path exists. + Returns [code]true[/code] if the file exists in the given path. - Get the next 16 bits from the file as an integer. + Returns the next 16 bits from the file as an integer. - Get the next 32 bits from the file as an integer. + Returns the next 32 bits from the file as an integer. - Get the next 64 bits from the file as an integer. + Returns the next 64 bits from the file as an integer. - Get the next 8 bits from the file as an integer. + Returns the next 8 bits from the file as an integer. - Get the whole file as a [String]. + Returns the whole file as a [String]. @@ -90,7 +90,7 @@ - Get next len bytes of the file as a [PoolByteArray]. + Returns next [code]len[/code] bytes of the file as a [PoolByteArray]. @@ -99,14 +99,14 @@ - Get the next value of the file in CSV (Comma Separated Values) format. You can pass a different delimiter to use other than the default "," (comma). + Returns the next value of the file in CSV (Comma Separated Values) format. You can pass a different delimiter to use other than the default "," (comma). - Get the next 64 bits from the file as a floating point number. + Returns the next 64 bits from the file as a floating point number. @@ -120,14 +120,14 @@ - Get the last error that happened when trying to perform operations. Compare with the [code]ERR_FILE_*[/code] constants from [@Global Scope]. + Returns the last error that happened when trying to perform operations. Compare with the [code]ERR_FILE_*[/code] constants from [@Global Scope]. - Get the next 32 bits from the file as a floating point number. + Returns the next 32 bits from the file as a floating point number. @@ -141,7 +141,7 @@ - Get the next line of the file as a [String]. + Returns the next line of the file as a [String]. @@ -150,7 +150,7 @@ - Returns a MD5 String representing the file at the given path or an empty [String] on failure. + Returns an MD5 String representing the file at the given path or an empty [String] on failure. @@ -159,28 +159,28 @@ - Returns the modified time in unix timestamp of the [code]file[/code] or returns a [String] "ERROR IN [code]file[/code]". This unix timestamp can be converted to datetime by using [method OS.get_datetime_from_unix_time]. + Returns the last time the [code]file[/code] was modified in unix timestamp format or returns a [String] "ERROR IN [code]file[/code]". This unix timestamp can be converted to datetime by using [method OS.get_datetime_from_unix_time]. - Get a [String] saved in Pascal format from the file. + Returns a [String] saved in Pascal format from the file. - Returns the file cursor position. + Returns the file cursor's position. - Get the next bits from the file as a floating point number. + Returns the next bits from the file as a floating point number. @@ -189,14 +189,14 @@ - Returns a SHA-256 String representing the file at the given path or an empty [String] on failure. + Returns a SHA-256 [String] representing the file at the given path or an empty [String] on failure. - Get the next Variant value from the file. + Returns the next [Variant] value from the file. @@ -214,7 +214,7 @@ - Open the file for writing or reading, depending on the flags. + Opens the file for writing or reading, depending on the flags. @@ -227,7 +227,7 @@ - Open a compressed file for reading or writing. The compression_mode can be set as one of the COMPRESSION_* constants. + Opens a compressed file for reading or writing. Use COMPRESSION_* constants to set [code]compression_mode[/code]. @@ -240,7 +240,7 @@ - Open an encrypted file in write or read mode. You need to pass a binary key to encrypt/decrypt it. + Opens an encrypted file in write or read mode. You need to pass a binary key to encrypt/decrypt it. @@ -253,7 +253,7 @@ - Open an encrypted file in write or read mode. You need to pass a password to encrypt/decrypt it. + Opens an encrypted file in write or read mode. You need to pass a password to encrypt/decrypt it. @@ -271,7 +271,7 @@ - Change the file reading/writing cursor to the specified position (in bytes from the end of the file). Note that this is an offset, so you should use negative numbers or the cursor will be at the end of the file. + Changes the file reading/writing cursor to the specified position (in bytes from the end of the file). Note that this is an offset, so you should use negative numbers or the cursor will be at the end of the file. @@ -290,7 +290,7 @@ - Store an integer as 16 bits in the file. + Stores an integer as 16 bits in the file. @@ -299,7 +299,7 @@ - Store an integer as 32 bits in the file. + Stores an integer as 32 bits in the file. @@ -308,7 +308,7 @@ - Store an integer as 64 bits in the file. + Stores an integer as 64 bits in the file. @@ -317,7 +317,7 @@ - Store an integer as 8 bits in the file. + Stores an integer as 8 bits in the file. @@ -326,7 +326,7 @@ - Store the given array of bytes in the file. + Stores the given array of bytes in the file. @@ -335,7 +335,7 @@ - Store a floating point number as 64 bits in the file. + Stores a floating point number as 64 bits in the file. @@ -344,7 +344,7 @@ - Store a floating point number as 32 bits in the file. + Stores a floating point number as 32 bits in the file. @@ -353,7 +353,7 @@ - Store the given [String] as a line in the file. + Stores the given [String] as a line in the file. @@ -362,7 +362,7 @@ - Store the given [String] as a line in the file in Pascal format (i.e. also store the length of the string). + Stores the given [String] as a line in the file in Pascal format (i.e. also store the length of the string). @@ -371,7 +371,7 @@ - Store a floating point number in the file. + Stores a floating point number in the file. @@ -380,7 +380,7 @@ - Store the given [String] in the file. + Stores the given [String] in the file. @@ -389,34 +389,34 @@ - Store any Variant value in the file. + Stores any Variant value in the file. - Open the file for read operations. + Opens the file for read operations. - Open the file for write operations. Create it if the file does not exist and truncate if it exists. + Opens the file for write operations. Create it if the file does not exist and truncate if it exists. - Open the file for read and write operations. Does not truncate the file. + Opens the file for read and write operations. Does not truncate the file. - Open the file for read and write operations. Create it if the file does not exist and truncate if it exists. + Opens the file for read and write operations. Create it if the file does not exist and truncate if it exists. - Use the FastLZ compression method. + Uses the FastLZ compression method. - Use the Deflate compression method. + Uses the Deflate compression method. - Use the Zstd compression method. + Uses the Zstd compression method. - Use the GZip compression method. + Uses the gzip compression method. diff --git a/doc/classes/FuncRef.xml b/doc/classes/FuncRef.xml index a7593dc2a1f..1277cef77d0 100644 --- a/doc/classes/FuncRef.xml +++ b/doc/classes/FuncRef.xml @@ -16,6 +16,7 @@ + Calls the referenced function previously set by [method set_function] or [method @GDScript.funcref]. @@ -24,7 +25,7 @@ - Set the name of the function to call on the object, without parentheses or any parameters. + The name of the referenced function to call on the object, without parentheses or any parameters. @@ -33,7 +34,7 @@ - Set the object on which to call the referenced function. This object must be of a type actually inheriting from [Object], not a built-in type such as [int], [Vector2] or [Dictionary]. + The object containing the referenced function. This object must be of a type actually inheriting from [Object], not a built-in type such as [int], [Vector2] or [Dictionary]. diff --git a/doc/classes/Gradient.xml b/doc/classes/Gradient.xml index f97908b0a2f..e086ae86b1a 100644 --- a/doc/classes/Gradient.xml +++ b/doc/classes/Gradient.xml @@ -1,7 +1,7 @@ - Color interpolator node + Color interpolator node. Given a set of colors, this node will interpolate them in order, meaning, that if you have color 1, color 2 and color3, the ramp will interpolate (generate the colors between two colors) from color 1 to color 2 and from color 2 to color 3. Initially the ramp will have 2 colors (black and white), one (black) at ramp lower offset offset 0 and the other (white) at the ramp higher offset 1. @@ -122,8 +122,10 @@ + Gradient's colors returned as a [PoolColorArray]. + Gradient's offsets returned as a [PoolRealArray]. diff --git a/doc/classes/GridContainer.xml b/doc/classes/GridContainer.xml index ca7b868cd8d..30976eff99e 100644 --- a/doc/classes/GridContainer.xml +++ b/doc/classes/GridContainer.xml @@ -30,6 +30,7 @@ + The number of columns in the [code]GridContainer[/code]. If modified, [code]GridContainer[/code] reorders its children to accommodate the new layout. diff --git a/doc/classes/ImageTexture.xml b/doc/classes/ImageTexture.xml index 4fcdf684c08..fdaee798db3 100644 --- a/doc/classes/ImageTexture.xml +++ b/doc/classes/ImageTexture.xml @@ -4,7 +4,7 @@ A [Texture] based on an [Image]. - A [Texture] based on an [Image]. Can be created from an [Image]. + A [Texture] based on an [Image]. Can be created from an [Image] with [method create_from_image]. @@ -93,6 +93,7 @@ + Resizes the [code]ImageTexture[/code] to the specified dimensions. diff --git a/doc/classes/ImmediateGeometry.xml b/doc/classes/ImmediateGeometry.xml index b12f9c99a99..cd7074aeaf4 100644 --- a/doc/classes/ImmediateGeometry.xml +++ b/doc/classes/ImmediateGeometry.xml @@ -1,9 +1,10 @@ - Node to draw simple geometry from code, ala OpenGL 1.x + Draws simple geometry from code. + Draws simple geometry from code. Uses a drawing mode similar to OpenGL 1.x. @@ -31,7 +32,7 @@ - Add a vertex with the currently set color/uv/etc. + Adds a vertex with the currently set color/uv/etc. @@ -50,14 +51,14 @@ - Clear everything that was drawn using begin/end. + Clears everything that was drawn using begin/end. - Call this when done adding a batch of geometry, otherwise it can't be displayed. + Ends a drawing context and displays the results. @@ -66,7 +67,7 @@ - Set the color that the next vertex will use to be drawn. + The current drawing color. @@ -75,7 +76,7 @@ - Set the normal that the next vertex will use to be drawn. + The next vertex's normal. @@ -84,7 +85,7 @@ - Set the tangent (and binormal facing) that the next vertex will use to be drawn. + The next vertex's tangent (and binormal facing). @@ -93,7 +94,7 @@ - Set the UV that the next vertex will use to be drawn. + The next vertex's UV. @@ -102,7 +103,7 @@ - Set the second layer of UV that the next vertex will use to be drawn. + The next vertex's second layer UV. diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml index 8c5e69b407c..1d1ce63a583 100644 --- a/doc/classes/Label.xml +++ b/doc/classes/Label.xml @@ -15,7 +15,7 @@ - Return the alignment mode (any of the ALIGN_* enumeration values). + Returns the alignment mode (any of the ALIGN_* enumeration values). @@ -36,76 +36,77 @@ - Return the the number of lines to skipped before displaying. + Returns the the number of lines to skip before displaying. - Return the restricted number of lines to display. Returns -1 if unrestricted. + Returns the maximum number of lines to display. Returns -1 if unrestricted. - Return the restricted number of characters to display (as a percentage of the total text). + Returns the maximum number of characters to display as a percentage of the total text. - Return the label text. Text can contain newlines. + Returns the label text. Text can contain newlines. - Return the total length of the text. + Returns the total length of the text. - Return the vertical alignment mode (any of the VALIGN_* enumeration values). + Returns the vertical alignment mode (any of the VALIGN_* enumeration values). - Return the restricted number of characters to display. Returns -1 if unrestricted. + Returns the restricted number of characters to display. Returns -1 if unrestricted. + Returns the number of lines shown. Useful if the [code]Label[/code] 's height cannot currently display all lines. - Return the state of the [i]autowrap[/i] mode (see [method set_autowrap]). + Returns [code]true[/code] if [i]autowrap[/i] mode (see [method set_autowrap]). - Return [code]true[/code] if text would be cut off if it is too wide. + Returns [code]true[/code] if text would be cut off if it is too wide. - Return [code]true[/code] if text is displayed in all capitals. + Returns [code]true[/code] if text is displayed in all capitals. diff --git a/doc/classes/LargeTexture.xml b/doc/classes/LargeTexture.xml index e4cabdc5562..f5416488f6e 100644 --- a/doc/classes/LargeTexture.xml +++ b/doc/classes/LargeTexture.xml @@ -5,7 +5,7 @@ A Texture capable of storing many smaller Textures with offsets. - You can dynamically add pieces(Textures) to this fLargeTexture] using different offsets. + You can dynamically add pieces([Texture]) to this [code]LargeTexture[/code] using different offsets. @@ -20,21 +20,21 @@ - Add another [Texture] to this [LargeTexture], starting on offset "ofs". + Add another [Texture] to this [code]LargeTexture[/code], starting on offset "ofs". - Clear the [LargeTexture]. + Clears the [code]LargeTexture[/code]. - Return the number of pieces currently in this [LargeTexture]. + Returns the number of pieces currently in this [code]LargeTexture[/code]. @@ -43,7 +43,7 @@ - Return the offset of the piece with index "idx". + Returns the offset of the piece with index "idx". @@ -52,7 +52,7 @@ - Return the [Texture] of the piece with index "idx". + Returns the [Texture] of the piece with index "idx". @@ -63,7 +63,7 @@ - Set the offset of the piece with index "idx" to "ofs". + Sets the offset of the piece with index "idx" to "ofs". @@ -74,7 +74,7 @@ - Set the [Texture] of the piece with index "idx" to "ofs". + Sets the [Texture] of the piece with index "idx" to "ofs". @@ -83,12 +83,16 @@ - Set the size of this [LargeTexture]. + Sets the size of this [code]LargeTexture[/code]. + Returns an [Array] with offsets and textures data of each added piece. Schema is [offsets1, texture1, offsets2, texture2, large_texture_size]. + [code]offsets[/code] : [Vector2] offsets of the texture piece. + [code]second[/code] : [StreamTexture] data of the texture piece. + [code]last entry[/code] : [Vector2] size of the entire large texture. diff --git a/doc/classes/Light2D.xml b/doc/classes/Light2D.xml index 7ce7cef7c11..05054e06fd1 100644 --- a/doc/classes/Light2D.xml +++ b/doc/classes/Light2D.xml @@ -1,10 +1,10 @@ - Node that casts light in a 2D environment. + Casts light in a 2D environment. - Node that casts light in a 2D environment. Light is defined by a (usually grayscale) texture, a color, an energy value, a mode (see constants), and various other parameters (range and shadows-related). Note that Light2D can be used as a mask. + Casts light in a 2D environment. Light is defined by a (usually grayscale) texture, a color, an energy value, a mode (see constants), and various other parameters (range and shadows-related). Note that Light2D can be used as a mask. @@ -385,7 +385,7 @@ If [code]true[/code] the Light2D will cast shadows. Default value: [code]false[/code]. - Shadow filter type. May be one of [code][None, PCF5, PCF9, PCF13][/code]. Default value: [code]None[/code]. + Shadow filter type. Use SHADOW_FILTER_* constants to set [code]shadow_filter[/code]. Default value: [code]None[/code]. Smoothing value for shadows. @@ -408,7 +408,7 @@ Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behaviour of a light. - Subtract the value of pixels corresponding to the Light2D to the values of pixels under it, resulting in inversed light effect. + Subtracts the value of pixels corresponding to the Light2D to the values of pixels under it, resulting in inversed light effect. Mix the value of pixels corresponding to the Light2D to the values of pixels under it by linear interpolation. @@ -417,16 +417,22 @@ The light texture of the Light2D is used as a mask, hiding or revealing parts of the screen underneath depending on the value of each pixel of the light (mask) texture. + No filter applies to the shadow map. See [method shadow_filter]. + Percentage closer filtering (3 samples) applies to the shadow map. See [method shadow_filter]. + Percentage closer filtering (5 samples) applies to the shadow map. See [method shadow_filter]. + Percentage closer filtering (7 samples) applies to the shadow map. See [method shadow_filter]. + Percentage closer filtering (9 samples) applies to the shadow map. See [method shadow_filter]. + Percentage closer filtering (13 samples) applies to the shadow map. See [method shadow_filter].