Gly Game Engine 0.0.11
Game engine in lua
Loading...
Searching...
No Matches
Node

Functions

local function emit (application, key, a, b, c, d, e, f)
 send event to node
 
local function load (application)
 create new node
 
local function spawn (application)
 register node to event bus
 
local function kill (application)
 unregister node from event bus
 
local function pause (application, key)
 disable node callback
 
local function resume (application, key)
 enable node callback
 

Detailed Description

Warning
This is an advanced API!
only for advanced programmers, You might be lost if you are a beginner.

Event Direct Message

Event Bus Registering

Parents
  • Root
    std.node.spawn(node_1)
    std.node.spawn(node_3)
  • Node 1
    std.node.spawn(node_2)
Custom Events
Engine Events

Function Documentation

◆ emit()

local function emit ( application ,
key ,
a ,
b ,
c ,
d ,
e ,
f  )
Tip
You can send message to "not spawned" node, as if he were an orphan.
Alternatives
  • std.node.emit_root send event to first node.
  • std.node.emit_parent send event to the node that registered current.

◆ kill()

local function kill ( application )
Example
if std.milis > minigame_limit_time then
std.node.kill(minigame)
end

◆ load()

local function load ( application )
Note
When build the main game file, it will be directly affected by the build.
Parameters
[in]application
Returns
node
Example
local game = std.node.load('examples/awesome/game.lua')
print(game.meta.title)

◆ pause()

local function pause ( application ,
key  )

stop receive specific event int the application

Example
if not paused and std.key.press.menu then
std.node.pause(minigame, 'loop')
end

◆ resume()

local function resume ( application ,
key  )

return to receiving specific event in the application

Example
if paused and std.key.press.menu then
std.node.resume(minigame, 'loop')
end

◆ spawn()

local function spawn ( application )
Parameters
[in/out]application
Example
local game = std.node.load('examples/awesome/game.lua')
std.node.spawn(game)