Class: GuiManager

UI.GuiManager

the graphical interface manager of the engine's game object.

new UI.GuiManager (game, utheme)

Name Type Description
game Core.Game the JSCF game object.
utheme Object a UI theme object.

Methods

beautifyObjectString (o)String

beautify child representation
Name Type Description
o object an object
Returns:
Type Description
String a name & type string representation

buildString (e, f)String

builds string description of an object hirarchy
Name Type Description
e object an object (entity, component, other object...)
f String filter string
Returns:
Type Description
String a nice string representation

createButton (name, x, y, w, h, bgcolor, txt, txtstyle, font)Core.Entity

creates rectangular button
Name Type Description
name String button entity name
x Number x position
y Number y position
w Number button width
h Number button height
bgcolor String background color (2d context descriptor)
txt String the text to display on button
txtstyle String text 2d context styling (can be just color)
font String 2d cotext font description
Returns:
Type Description
Core.Entity gui button entity

createContainer (name, x, y, w, h, bgcolor)Core.Entity

creates rectangular container with background
Name Type Description
name String container entity name
x Number x position
y Number y position
w Number container width
h Number container height
bgcolor String background color (2d context descriptor)
Returns:
Type Description
Core.Entity gui container entity

createDefaultButton (x, y, txt, onclick_fn)Core.Entity

creates default gui button
Name Type Description
x Number x position
y Number y position
txt String the text to display on button
onclick_fn function onclick function
Returns:
Type Description
Core.Entity default gui button entity

createDefaultContainer (x, y)Core.Entity

creates default rectangular container
Name Type Description
x Number x position
y Number y position
Returns:
Type Description
Core.Entity default gui container entity

createDefaultTextBox (x, y, txt)Core.Entity

creates default gui textbox
Name Type Description
x Number x position
y Number y position
txt String text to set in textbox
Returns:
Type Description
Core.Entity default gui textbox entity

createDefaultWindow (x, y)Core.Entity

creates default window
Name Type Description
x Number x coordinate
y Number y coordinate
Returns:
Type Description
Core.Entity the window entity

createLabel (x, y, txt)Core.Entity

creates label (text gui entity)
Name Type Description
x Number x position
y Number y position
txt String the text to display
Returns:
Type Description
Core.Entity the gui label entity

createRectEditor (x, y, style)

create rect editor
Name Type Description
x Number x coordinate
y Number y coordinate
style String context styling

createTextBox (name, x, y, w, h, bgcolor, txt, effect)Core.Entity

creates gui rectangular textbox
Name Type Description
name String textbox entity name
x Number x position
y Number y position
w Number textbox width
h Number textbox height
bgcolor String background color (2d context descriptor)
txt String the text to display on textbox
effect Effect the effect to render with textbox
Returns:
Type Description
Core.Entity gui textbox entity

errorPopup (errMsg)

inserts an error popup to scene
Name Type Description
errMsg String message to show

focus ()

consumes focus (lock-like)

generateUIName (base)

[description]
Name Type Description
base String the base name

getTheme ()UI.Theme

get current theme
Returns:
Type Description
UI.Theme the current theme

insertRectangleEditor ()

inserts rectangle editor to all editable entities

resetFocus ()

resets focus (do not call unless absolutely certain)

setTheme (themeSettings)

Sets theme via json / object settings (not override).
Name Type Description
themeSettings Object the theme settings json / object.