Terms - JanSharp/JanSharpsGuiLibrary GitHub Wiki
Instances
Mostly referred to as insts.
They are instances of classes, which means they inherit all functions and data the class has defined.
Instances are wrappers around actual LuaGuiElement
s; No instance can exist without a corresponding LuaGuiElement
.
Also no more than 1 instance can refer to the same LuaGuiElement
.
Class
Classes define behavior of their instances. They
- define the layout of
LuaGuiElement
s - handle gui events
- handle class events
- can define extra behavior/functions for their instances to use
Gui Events
All events which start with on_gui
, except on_gui_opened
and on_gui_closed
. When event handlers are defined, the _gui
part gets cut out of the name for simplicity.
(The on_click
function of a class would handle the defines.events.on_gui_click
event.)
Class events
- on_elem_created(self :
GuiClassInst
): do something upon creation before children get added - on_create(self :
GuiClassInst
): do something upon creation after children got added - on_destroy(self :
GuiClassInst
): do something upon deletion
To know when exactly these events get fired, see Gui Handler (specifically create_base and destroy).