Gly Game Engine 0.0.11
Game engine in lua
|
Functions | |
local function | abort () |
stop current signal | |
local function | emit (key, a, b, c, d, e, f) |
send unique event | |
local function | trigger (key) |
sender event function | |
local function | listen (key, handler_func) |
subscribe event | |
You can get inspired by some explanations about how the event bus works in the JavaScript framework called Vue, it is very similar, but there is only 1 global bus that the engine itself uses to work.
broadcasts some event to all nodes.
The event system is also used to control events from the engine itself, where the core triggers an action and it is propagated to the internal modules, and to the game and its components (nodes).
local function abort | ( | ) |
This interrupts the signal to the next nodes, this also applies to the engine itself and prevents lifecycle events.
local function emit | ( | key | , |
a | , | ||
b | , | ||
c | , | ||
d | , | ||
e | , | ||
f | ) |
broadcast message for all nodes.
draw
event.abcdef
is faster to implement and execute. If you need more parameters than that, the problem is in your code. local function listen | ( | key | , |
handler_func | ) |
std
std
and data
std
and engine
key
topic, because applies to all events. local function trigger | ( | key | ) |