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
Returns

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
Returns

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
Returns

Defined at client/lua_api/gui/iguicolorselector.cpp:26


neweditbox( rect dimensions [ , iguielement parent ] [ , string default_text ] )

Creates a new text entry box.

Parameters
Returns

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
Returns

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
Returns

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
Returns

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
Returns

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
Returns

Defined at client/lua_api/gui/iguitreeview.cpp:30


newwindow( rect dimensions , string title_text [ , iguielement parent ] )

Creates a new gui window .

Parameters
Returns

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

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

Defined at client/lua_api/load_gui.cpp:55