GUIButton

new GUIButton(id, options, guimanager, callback, append)

Creates a new GUIButton

Parameters

NameTypeDescription
Name
id
Type
string
Description
The id and name element
Name
options
Type
json
Description
Options of element
Name
guimanager
Type
GUIManager
Description
The gui manager
Name
callback
Type
function
Description
Trigger function by click (optional)
Name
append
Type
bool
Description
is added to the <body>. => True by default (optional)

Options

  • w: width of button (in pixel)
  • h: height of button (in pixel)
  • x: position left of button (in pixel)
  • y: position top of button (in pixel)
  • value: value text button (string) => "Ok" by default
  • backgroundImage: image background of button (string) => null by default
  • backgroundColor: color background of button (string) => "rgba(0.5, 0.5, 0.5, 0.6)" by default
  • borderRadiusButton: radius border of button (string) => "10px" by default
  • borderButton: border of button (string) => "2px solid black" by default
  • colorText: color text of button (string) => "black" by default
  • zIndex: depth of the element (int) => 1 by default
  • tabindex: Tab order of the field.

Methods

setVisible(bool, fade) → void

Set this GUI element to visible or invisible

isVisible() → void

Returns element if is visible or no

dispose() → void

Dispose the GUIButton, and delete element.