From 3a4ec88b37d50837ef9e1cfa57f004b9bd36715d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 27 Apr 2016 23:58:24 +0200 Subject: Classref: Document Button and ButtonArray Also bind relevant constants and define some object types and better argument names for the docs. --- doc/base/classes.xml | 62 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 23 deletions(-) (limited to 'doc') diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 70fcb31656..7bc8c42592 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -5684,12 +5684,14 @@ + Set the icon that will be displayed next to the text inside the button area. + Return the button icon. @@ -5717,23 +5719,34 @@ + Set the text alignment policy, using one of the ALIGN_* constants. + Return the text alignment policy. - Return the state of the [i]flat[/i] property (see [method set_flat]) + Return the state of the [i]flat[/i] property (see [method set_flat]). + + Align the text to the left. + + + Center the text. + + + Align the text to the right. + @@ -5765,57 +5778,60 @@ Array of Buttons. - Array of Buttons. A Button array is useful to have an array of buttons laid out vertically or horizontally. Only one can be selected. This is useful for joy pad based interfaces and option menus. + Array of Buttons. A ButtonArray is useful to have an array of buttons laid out vertically or horizontally. Only one button can be selected, and is referenced by its index in the array (first button is 0, second button is 1, etc.). + This is useful [i]e.g.[/i] for joypad-friendly interfaces and option menus. - Add a new button. + Append a new button to the array, with the specified text. - + + Append a new button to the array, with the specified icon and text. - + + Define the text of the specified button. - + - + - Set the icon of an existing button. + Set the icon of the specified button. - + - Return the text of an existing button. + Return the text of the specified button. - + - + - Return the icon of an existing button. + Return the icon of the specified button. @@ -5829,42 +5845,42 @@ - Return the currently selected button in the array. + Return the index of the currently selected button in the array. - Return the currently hovered button in the array. + Return the index of the currently hovered button in the array. - + - Select a button in the array. + Select a button in the array based on the given index. - + - Remove a button in the array, by index. + Remove the specified button in the array. - Clear the button array. + Remove all buttons from the array. - + - A Button was selected (returns the index). + A button has been selected, its index is given as the argument. @@ -43309,7 +43325,7 @@ This method controls whether the position between two cached points is interpola Holds an [Object], but does not contribute to the reference count if the object is a reference. - A weakref can hold a [Reference], without contributing to the reference counter. A weakref can be created from an [Object] using [method @GDScript.weakref]. If this object is not a reference, weakref still works, however, it does not have any effect on the object. Weakrefs are useful in cases where multiple classes have variables that refer to eachother. Without weakrefs, using these classes could lead to memory leaks, since both references keep eachother from being released. Making part of the variables a weakref can prevent this cyclic dependency, and allows the references to be released. + A weakref can hold a [Reference], without contributing to the reference counter. A weakref can be created from an [Object] using [method @GDScript.weakref]. If this object is not a reference, weakref still works, however, it does not have any effect on the object. Weakrefs are useful in cases where multiple classes have variables that refer to eachother. Without weakrefs, using these classes could lead to memory leaks, since both references keep eachother from being released. Making part of the variables a weakref can prevent this cyclic dependency, and allows the references to be released. -- cgit v1.2.3