gui
Contents
| Name | Description |
|---|---|
| newbutton( dimensions , default_text [, parent ] ) | Creates a new button. |
| newcheckbox( dimensions , default_text [, parent ] ) | Creates a new checkbox. |
| newcolorselector( title [, parent ] ) | Creates a new Color selector. |
| neweditbox( dimensions [, parent ] [, default_text ] ) | Creates a new text entry box. |
| newfileopendialog( [ title ] [, path ] [, parent ] [, modal ] ) | Creates a new dialog to open a file. |
| newiguiimage( position , alpha , texture [, parent ] ) | Creates a new guielement with an image. |
| newlabel( pos , text [, parent ] ) | Creates a new label to display text. |
| newspinbox( dimensions [, default_text ] [, parent ] [, border ] ) | Creates a new spinbox |
| newtreeview( rect [, parent ] [, draw_background ] [, vertical_scroll ] [, horizonal_scroll ] ) | Creates a new tree view. |
| newwindow( dimensions , title_text [, parent ] ) | Creates a new gui window . |
| scrh( ) | Get the height of the screen. |
| scrw( ) | Get the width of the screen. |
newbutton( rect dimensions , string default_text [ , iguielement parent ] )
Creates a new button.
Buttons may have the following fields set for callbacks:
.onClick(self)
It may additionally call any iguielement callbacks
Parameters
-
dimensions (rect)
The rectangle to place the button at. If the box has a parent,
-
default_text (string)
The default text to have in the button
-
parent (optional) (iguielement)
The parent element of the button.
Returns
-
The button element
Defined at client/lua_api/gui/iguibutton.cpp:41
newcheckbox( rect dimensions , string default_text [ , iguielement parent ] )
Creates a new checkbox.
Creates a new checkbox that can be checked and unchecked. Checkboxes may have the following fields, which they will call for callbacks:
.onCheck(self)
It may additionally call any iguielement callbacks
Parameters
-
dimensions (rect)
The rectangle to place the box at. If the box has a parent,
-
default_text (string)
The default text to have in the edit box
-
parent (optional) (iguielement)
The parent element of the edit box
Returns
-
The edit box element
Defined at client/lua_api/gui/iguicheckbox.cpp:32
newcolorselector( string title [ , iguielement parent ] )
Creates a new Color selector.
Creates a dialog box that allows the user to select a color. TODO:Broken?
Parameters
-
title (string)
The title for this color selector
-
parent (optional) (iguielement)
The parent element of the edit box
Returns
-
The color selector element
Defined at client/lua_api/gui/iguicolorselector.cpp:26
neweditbox( rect dimensions [ , iguielement parent ] [ , string default_text ] )
Creates a new text entry box.
Parameters
-
dimensions (rect)
The rectangle to place the box at. If the box has a parent, it is offset from the upper-left of the parent element.
-
parent (optional) (iguielement)
The parent element of the edit box
-
default_text (optional) (string)
The default text to have in the edit box
Returns
-
The edit box element
Defined at client/lua_api/gui/iguieditbox.cpp:28
newfileopendialog( [ string title ] [ , string path ] [ , iguielement parent ] [ , boolean modal ] )
Creates a new dialog to open a file.
The file creation window may have the following fields set for callbacks:
.onDirectorySelect(self)
.onFileSelect(self)
.onCanceled(self)
Parameters
-
title (optional) (string)
The rectangle to place the button at. If the box has a parent,
-
path (optional) (string)
The path to open the file dialog to
-
parent (optional) (iguielement)
The parent element of the button.
-
modal (optional) (boolean)
If other gui elements can be interacted with before this element is closed
Returns
-
The button element
Defined at client/lua_api/gui/iguifiledialog.cpp:41
newiguiimage( vector2d position , number alpha , itexture texture [ , iguielement parent ] )
Creates a new guielement with an image.
The size of the iguielement is the same as the itexture used for its creation.
Parameters
-
position (vector2d)
The upper-left hand corner of the element. The element is offset from the upper-left of the parent element.
-
alpha (number)
The transparency of the element.
-
texture (itexture)
The texture to display on this element.
-
parent (optional) (iguielement)
The parent element of the button.
Returns
-
The button element
Defined at client/lua_api/gui/iguiimage.cpp:36
newlabel( rect pos , string text [ , iguielement parent ] )
Creates a new label to display text.
Creates a label to display text with the front set in the engine.
Parameters
-
pos (rect)
The position of the label, reletive to the upper-left of it's
-
text (string)
The text to display on this label.
-
parent (optional) (iguielement)
The parent element of the button.
Returns
-
The label element
Defined at client/lua_api/gui/iguilabel.cpp:34
newspinbox( rect dimensions [ , string default_text ] [ , iguielement parent ] [ , boolean border ] )
Creates a new spinbox
Creates a gui element that has up and down arrows to control the value, and is editable by the user.
Parameters
-
dimensions (rect)
The rectangle to place the button at. If the box has a parent, it is offset from the upper-left of the parent element.
-
default_text (optional) (string)
The default text to display in the spinbox.
-
parent (optional) (iguielement)
The parent element of the button.
-
border (optional) (boolean)
Display a border around the spinbox
Returns
-
The button element
Defined at client/lua_api/gui/iguispinbox.cpp:30
newtreeview( dimensions rect [ , iguielement parent ] [ , boolean draw_background ] [ , boolean vertical_scroll ] [ , boolean horizonal_scroll ] )
Creates a new tree view.
Creates a tree view where nodes can be expanded to show extra information, or more subtrees.
Parameters
-
rect (dimensions)
The rectangle to place the tree view at. If the box has a parent, it is offset from the upper-left of the parent element.
-
parent (optional) (iguielement)
The parent element of the button.
-
draw_background (optional) (boolean)
Should we draw a background for the tree view?
-
vertical_scroll (optional) (boolean)
Should there be a vertical scroll bar?
-
horizonal_scroll (optional) (boolean)
Should there be a horizontal scroll bar?
Returns
-
The tree view element
Defined at client/lua_api/gui/iguitreeview.cpp:30
newwindow( rect dimensions , string title_text [ , iguielement parent ] )
Creates a new gui window .
Parameters
-
dimensions (rect)
The rectangle to create the window at.
-
title_text (string)
The text to show in the title bar of the window
-
parent (optional) (iguielement)
The parent element of the window.
Returns
-
The window element
Defined at client/lua_api/gui/iguiwindow.cpp:32
scrh( )
Get the height of the screen.
Get the height of the screen in pixels. This should have been set with the options in deviceinit.lua, but may change of the course of the application's life (ex, if the user resizes the screen)
Returns
-
The height of the screen
Defined at client/lua_api/load_gui.cpp:64
scrw( )
Get the width of the screen.
Get the width of the screen in pixels. This should have been set with the options in deviceinit.lua, but may change of the course of the application's life (ex, if the user resizes the screen)
Returns
-
The width of the screen
Defined at client/lua_api/load_gui.cpp:55