diff options
Diffstat (limited to 'doc/classes')
-rw-r--r-- | doc/classes/Image.xml | 67 | ||||
-rw-r--r-- | doc/classes/LineEdit.xml | 58 | ||||
-rw-r--r-- | doc/classes/RichTextLabel.xml | 1 | ||||
-rw-r--r-- | doc/classes/TranslationServer.xml | 8 |
4 files changed, 95 insertions, 39 deletions
diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index 2e76eb6d0b..905a844094 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -4,7 +4,7 @@ Image datatype. </brief_description> <description> - Native image datatype. Contains image data, which can be converted to a texture, and several functions to interact with it. + Native image datatype. Contains image data, which can be converted to a [Texture], and several functions to interact with it. The maximum width and height for an [code]Image[/code] is 16384 pixels. </description> <tutorials> </tutorials> @@ -21,7 +21,7 @@ <argument index="2" name="dst" type="Vector2"> </argument> <description> - Alpha-blends a "src_rect" [Rect2] from "src" [code]Image[/code] to this [code]Image[/code] on coordinates "dest". + Alpha-blends [code]src_rect[/code] from [code]src[/code] image to this image at coordinates [code]dest[/code]. </description> </method> <method name="blend_rect_mask"> @@ -36,7 +36,7 @@ <argument index="3" name="dst" type="Vector2"> </argument> <description> - Alpha-blends a "src_rect" [Rect2] from "src" [code]Image[/code] to this [code]Image[/code] using a "mask" [code]Image[/code] on coordinates "dest". Alpha channels are required for both "src" and "mask", dest pixels and src pixels will blend if the corresponding mask pixel's alpha value is not 0. "src" [code]Image[/code] and "mask" [code]Image[/code] *must* have the same size (width and height) but they can have different formats + Alpha-blends [code]src_rect[/code] from [code]src[/code] image to this image using [code]mask[/code] image at coordinates [code]dst[/code]. Alpha channels are required for both [code]src[/code] and [code]mask[/code]. [code]dst[/code] pixels and [code]src[/code] pixels will blend if the corresponding mask pixel's alpha value is not 0. [code]src[/code] image and [code]mask[/code] image [b]must[/b] have the same size (width and height) but they can have different formats. </description> </method> <method name="blit_rect"> @@ -49,7 +49,7 @@ <argument index="2" name="dst" type="Vector2"> </argument> <description> - Copy a "src_rect" [Rect2] from "src" [code]Image[/code] to this [code]Image[/code] on coordinates "dest". + Copies [code]src_rect[/code] from [code]src[/code] image to this image at coordinates [code]dst[/code]. </description> </method> <method name="blit_rect_mask"> @@ -64,13 +64,14 @@ <argument index="3" name="dst" type="Vector2"> </argument> <description> - Blits a "src_rect" [Rect2] from "src" [code]Image[/code] to this [code]Image[/code] using a "mask" [code]Image[/code] on coordinates "dest". Alpha channel is required for "mask", will copy src pixel onto dest if the corresponding mask pixel's alpha value is not 0. "src" [code]Image[/code] and "mask" [code]Image[/code] *must* have the same size (width and height) but they can have different formats + Blits [code]src_rect[/code] area from [code]src[/code] image to this image at the coordinates given by [code]dst[/code]. [code]src[/code] pixel is copied onto [code]dst[/code] if the corresponding [code]mask[/code] pixel's alpha value is not 0. [code]src[/code] image and [code]mask[/code] image [b]must[/b] have the same size (width and height) but they can have different formats. </description> </method> <method name="clear_mipmaps"> <return type="void"> </return> <description> + Removes the image's mipmaps. </description> </method> <method name="compress"> @@ -83,6 +84,7 @@ <argument index="2" name="lossy_quality" type="float"> </argument> <description> + Compresses the image to use less memory. Can not directly access pixel data while the image is compressed. Returns error if the chosen compression mode is not available. See [code]COMPRESS_*[/code] constants. </description> </method> <method name="convert"> @@ -91,6 +93,7 @@ <argument index="0" name="format" type="int" enum="Image.Format"> </argument> <description> + Converts the image's format. See [code]FORMAT_*[/code] constants. </description> </method> <method name="copy_from"> @@ -99,6 +102,7 @@ <argument index="0" name="src" type="Image"> </argument> <description> + Copies [code]src[/code] image to this image. </description> </method> <method name="create"> @@ -113,7 +117,7 @@ <argument index="3" name="format" type="int" enum="Image.Format"> </argument> <description> - Create an empty image of a specific size and format. + Creates an empty image of given size and format. See [code]FORMAT_*[/code] constants. If [code]use_mipmaps[/code] is true then generate mipmaps for this image. See the [code]generate_mipmaps[/code] method. </description> </method> <method name="create_from_data"> @@ -130,6 +134,7 @@ <argument index="4" name="data" type="PoolByteArray"> </argument> <description> + Creates a new image of given size and format. See [code]FORMAT_*[/code] constants. Fills the image with the given raw data. If [code]use_mipmaps[/code] is true then generate mipmaps for this image. See the [code]generate_mipmaps[/code] method. </description> </method> <method name="crop"> @@ -140,24 +145,28 @@ <argument index="1" name="height" type="int"> </argument> <description> + Crops the image to the given [code]width[/code] and [code]height[/code]. If the specified size is larger than the current size, the extra area is filled with black pixels. </description> </method> <method name="decompress"> <return type="int" enum="Error"> </return> <description> + Decompresses the image if it is compressed. Returns an error if decompress function is not available. </description> </method> <method name="detect_alpha" qualifiers="const"> <return type="int" enum="Image.AlphaMode"> </return> <description> + Returns ALPHA_BLEND if the image has data for alpha values. Returns ALPHA_BIT if all the alpha values are below a certain threshold or the maximum value. Returns ALPHA_NONE if no data for alpha values is found. </description> </method> <method name="expand_x2_hq2x"> <return type="void"> </return> <description> + Stretches the image and enlarges it by a factor of 2. No interpolation is done. </description> </method> <method name="fill"> @@ -166,52 +175,56 @@ <argument index="0" name="color" type="Color"> </argument> <description> - Fills an [code]Image[/code] with a specified [Color] + Fills the image with a given [Color]. </description> </method> <method name="fix_alpha_edges"> <return type="void"> </return> <description> + Blends low-alpha pixels with nearby pixels. </description> </method> <method name="flip_x"> <return type="void"> </return> <description> + Flips the image horizontally. </description> </method> <method name="flip_y"> <return type="void"> </return> <description> + Flips the image vertically. </description> </method> <method name="generate_mipmaps"> <return type="int" enum="Error"> </return> <description> + Generates mipmaps for the image. Mipmaps are pre-calculated and lower resolution copies of the image. Mipmaps are automatically used if the image needs to be scaled down when rendered. This improves image quality and the performance of the rendering. Returns an error if the image is compressed, in a custom format or if the image's width/height is 0. </description> </method> <method name="get_data" qualifiers="const"> <return type="PoolByteArray"> </return> <description> - Return the raw data of the [code]Image[/code]. + Returns the image's raw data. </description> </method> <method name="get_format" qualifiers="const"> <return type="int" enum="Image.Format"> </return> <description> - Return the format of the [code]Image[/code], one of [code]Image[/code].FORMAT_*. + Returns the image's raw data. </description> </method> <method name="get_height" qualifiers="const"> <return type="int"> </return> <description> - Return the height of the [code]Image[/code]. + Returns the image's height. </description> </method> <method name="get_mipmap_offset" qualifiers="const"> @@ -220,6 +233,7 @@ <argument index="0" name="mipmap" type="int"> </argument> <description> + Returns the offset where the image's mipmap with index [code]mipmap[/code] is stored in the [code]data[/code] dictionary. </description> </method> <method name="get_pixel" qualifiers="const"> @@ -230,6 +244,7 @@ <argument index="1" name="y" type="int"> </argument> <description> + Returns the color of the pixel at [code](x, y)[/code] if the image is locked. If the image is unlocked it always returns a [Color] with the value [code](0, 0, 0, 1.0)[/code]. </description> </method> <method name="get_rect" qualifiers="const"> @@ -238,51 +253,56 @@ <argument index="0" name="rect" type="Rect2"> </argument> <description> - Return a new [code]Image[/code] that is a copy of "area" in this [code]Image[/code]. + Returns a new image that is a copy of the image's area specified with [code]rect[/code]. </description> </method> <method name="get_size" qualifiers="const"> <return type="Vector2"> </return> <description> + Returns the image's size (width and height). </description> </method> <method name="get_used_rect" qualifiers="const"> <return type="Rect2"> </return> <description> - Return the area of this [code]Image[/code] that is used/visibly colored/opaque. + Returns a [Rect2] enclosing the visible portion of the image. </description> </method> <method name="get_width" qualifiers="const"> <return type="int"> </return> <description> - Return the width of the [code]Image[/code]. + Returns the image's width. </description> </method> <method name="has_mipmaps" qualifiers="const"> <return type="bool"> </return> <description> + Returns [code]true[/code] if the image has generated mipmaps. </description> </method> <method name="is_compressed" qualifiers="const"> <return type="bool"> </return> <description> + Returns [code]true[/code] if the image is compressed. </description> </method> <method name="is_empty" qualifiers="const"> <return type="bool"> </return> <description> + Returns [code]true[/code] if the image has no data. </description> </method> <method name="is_invisible" qualifiers="const"> <return type="bool"> </return> <description> + Returns [code]true[/code] if all the image's pixels have an alpha value of 0. Returns [code]false[/code] if any pixel has an alpha value higher than 0. </description> </method> <method name="load"> @@ -291,25 +311,28 @@ <argument index="0" name="path" type="String"> </argument> <description> - Load an [code]Image[/code]. + Loads an image from file [code]path[/code]. </description> </method> <method name="lock"> <return type="void"> </return> <description> + Locks the data and prevents changes. </description> </method> <method name="normalmap_to_xy"> <return type="void"> </return> <description> + Converts the image's data to represent coordinates on a 3D plane. This is used when the image represents a normalmap. A normalmap can add lots of detail to a 3D surface without increasing the polygon count. </description> </method> <method name="premultiply_alpha"> <return type="void"> </return> <description> + Multiplies color values with alpha values. Resulting color values for a pixel are [code](color * alpha)/256[/code]. </description> </method> <method name="resize"> @@ -322,6 +345,7 @@ <argument index="2" name="interpolation" type="int" enum="Image.Interpolation" default="1"> </argument> <description> + Resizes the image to the given [code]width[/code] and [code]height[/code]. New pixels are calculated using [code]interpolation[/code]. See [code]interpolation[/code] constants. </description> </method> <method name="resize_to_po2"> @@ -330,6 +354,7 @@ <argument index="0" name="square" type="bool" default="false"> </argument> <description> + Resizes the image to the nearest power of 2 for the width and height. If [code]square[/code] is [code]true[/code] then set width and height to be the same. </description> </method> <method name="save_png" qualifiers="const"> @@ -338,7 +363,7 @@ <argument index="0" name="path" type="String"> </argument> <description> - Save this [code]Image[/code] as a png. + Saves the image as a PNG file to [code]path[/code]. </description> </method> <method name="set_pixel"> @@ -351,29 +376,41 @@ <argument index="2" name="color" type="Color"> </argument> <description> + Sets the [Color] of the pixel at [code](x, y)[/code] if the image is unlocked. Example: + [code] + var img = Image.new() + img.lock() + img.set_pixel(x, y, color) # Does not have an effect + img.unlock() + img.set_pixel(x, y, color) # Works + [/code]. </description> </method> <method name="shrink_x2"> <return type="void"> </return> <description> + Shrinks the image by a factor of 2. </description> </method> <method name="srgb_to_linear"> <return type="void"> </return> <description> + Converts the raw data from the sRGB colorspace to a linear scale. </description> </method> <method name="unlock"> <return type="void"> </return> <description> + Unlocks the data for writing access. </description> </method> </methods> <members> <member name="data" type="Dictionary" setter="_set_data" getter="_get_data"> + Holds all of the image's color data in a given format. See [code]FORMAT_*[/code] constants. </member> </members> <constants> diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index 50bff87a80..850f724714 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -17,14 +17,14 @@ <argument index="0" name="text" type="String"> </argument> <description> - Append text at cursor, scrolling the [code]LineEdit[/code] when needed. + Adds [code]text[/code] after the cursor. If the resulting value is longer than [member max_length], nothing happens. </description> </method> <method name="clear"> <return type="void"> </return> <description> - Clear the [code]LineEdit[/code] text. + Erases the [LineEdit] text. </description> </method> <method name="cursor_get_blink_enabled" qualifiers="const"> @@ -70,7 +70,7 @@ <return type="int"> </return> <description> - Return the cursor position inside the [code]LineEdit[/code]. + Returns the cursor position inside the [code]LineEdit[/code]. </description> </method> <method name="get_expand_to_text_length" qualifiers="const"> @@ -90,7 +90,7 @@ <return type="PopupMenu"> </return> <description> - Return the [PopupMenu] of this [code]LineEdit[/code]. + Returns the [PopupMenu] of this [code]LineEdit[/code]. By default, this menu is displayed when right-clicking on the [LineEdit]. </description> </method> <method name="get_placeholder" qualifiers="const"> @@ -134,7 +134,7 @@ <argument index="0" name="option" type="int"> </argument> <description> - Execute a given action as defined in the MENU_* enum. + Executes a given action as defined in the MENU_* enum. </description> </method> <method name="select"> @@ -145,11 +145,12 @@ <argument index="1" name="to" type="int" default="-1"> </argument> <description> - Select the text inside [code]LineEdit[/code] by the given character positions. [code]from[/code] is default to the beginning. [code]to[/code] is default to the end. + Selects characters inside [LineEdit] between [code]from[/code] and [code]to[/code]. By default [code]from[/code] is at the beginning and [code]to[/code] at the end. [codeblock] - select() # select all - select(5) # select from the fifth character to the end. - select(2, 5) # select from the second to the fifth character. + text = "Welcome" + select() # Welcome + select(4) # ome + select(2, 5) # lco [/codeblock] </description> </method> @@ -157,7 +158,7 @@ <return type="void"> </return> <description> - Select the whole string. + Selects the whole [String]. </description> </method> <method name="set_align"> @@ -175,7 +176,7 @@ <argument index="0" name="position" type="int"> </argument> <description> - Set the cursor position inside the [code]LineEdit[/code], causing it to scroll if needed. + Sets the cursor position inside the [code]LineEdit[/code]. The text may scroll if needed. </description> </method> <method name="set_editable"> @@ -243,26 +244,37 @@ </methods> <members> <member name="align" type="int" setter="set_align" getter="get_align" enum="LineEdit.Align"> + Text alignment as defined in the ALIGN_* enum. </member> <member name="caret_blink" type="bool" setter="cursor_set_blink_enabled" getter="cursor_get_blink_enabled"> + If [code]true[/code] the caret (visual cursor) blinks. </member> <member name="caret_blink_speed" type="float" setter="cursor_set_blink_speed" getter="cursor_get_blink_speed"> + Duration (in seconds) of a caret's blinking cycle. </member> <member name="editable" type="bool" setter="set_editable" getter="is_editable"> + If [code]false[/code] existing text cannot be modified and new text cannot be added. </member> <member name="expand_to_len" type="bool" setter="set_expand_to_text_length" getter="get_expand_to_text_length"> + If [code]true[/code] the [LineEdit] width will increase to stay longer than the [member text]. It will [b]not[/b] compress if the [member text] is shortened. </member> <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" enum="Control.FocusMode"> + Defines how the [LineEdit] can grab focus (Keyboard and mouse, only keyboard, or none). See [code]enum FocusMode[/code] in [Control] for details. </member> <member name="max_length" type="int" setter="set_max_length" getter="get_max_length"> + Maximum amount of characters that can be entered inside the [LineEdit]. If [code]0[/code], there is no limit. </member> <member name="placeholder_alpha" type="float" setter="set_placeholder_alpha" getter="get_placeholder_alpha"> + Opacity of the [member placeholder_text]. From [code]0[/code] to [code]1[/code]. </member> <member name="placeholder_text" type="String" setter="set_placeholder" getter="get_placeholder"> + Text shown when the [LineEdit] is empty. It is [b]not[/b] the [LineEdit]'s default value (see [member text]). </member> <member name="secret" type="bool" setter="set_secret" getter="is_secret"> + If [code]true[/code] every character is shown as "*". </member> <member name="text" type="String" setter="set_text" getter="get_text"> + String value of the [LineEdit]. </member> </members> <signals> @@ -270,47 +282,47 @@ <argument index="0" name="text" type="String"> </argument> <description> - When the text changes, this signal is emitted. + Emitted when the text changes. </description> </signal> <signal name="text_entered"> <argument index="0" name="text" type="String"> </argument> <description> - This signal is emitted when the user presses KEY_ENTER on the [code]LineEdit[/code]. This signal is often used as an alternate confirmation mechanism in dialogs. + Emitted when the user presses KEY_ENTER on the [code]LineEdit[/code]. </description> </signal> </signals> <constants> <constant name="ALIGN_LEFT" value="0"> - Align left. + Aligns the text on the left hand side of the [LineEdit]. </constant> <constant name="ALIGN_CENTER" value="1"> - Align center. + Centers the text in the middle of the [LineEdit]. </constant> <constant name="ALIGN_RIGHT" value="2"> - Align right. + Aligns the text on the right hand side of the [LineEdit]. </constant> <constant name="ALIGN_FILL" value="3"> - Align fill. + Stretches whitespaces to fit the [LineEdit]'s width. </constant> <constant name="MENU_CUT" value="0"> - Cut (Copy and clear). + Cuts (Copies and clears) the selected text. </constant> <constant name="MENU_COPY" value="1"> - Copy the selected text. + Copies the selected text. </constant> <constant name="MENU_PASTE" value="2"> - Paste the clipboard text over the selected text. + Pastes the clipboard text over the selected text (or at the cursor's position). </constant> <constant name="MENU_CLEAR" value="3"> - Clear the text. + Erases the whole [Linedit] text. </constant> <constant name="MENU_SELECT_ALL" value="4"> - Select all text. + Selects the whole [Linedit] text. </constant> <constant name="MENU_UNDO" value="5"> - Undo an action. + Undoes the previous action. </constant> <constant name="MENU_MAX" value="6"> </constant> diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index 7f9955d29b..cc644f34cb 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -31,7 +31,6 @@ <return type="int" enum="Error"> </return> <argument index="0" name="bbcode" type="String"> - Adds BBCode to the text label. </argument> <description> </description> diff --git a/doc/classes/TranslationServer.xml b/doc/classes/TranslationServer.xml index 974b0e283f..1657541c19 100644 --- a/doc/classes/TranslationServer.xml +++ b/doc/classes/TranslationServer.xml @@ -30,6 +30,14 @@ <description> </description> </method> + <method name="get_locale_name" qualifiers="const"> + <return type="String"> + </return> + <argument index="0" name="locale" type="String"> + </argument> + <description> + </description> + </method> <method name="remove_translation"> <return type="void"> </return> |