Director
Description:
A singleton class manages the game scene trees and provides access to root scene nodes for different game uses.
Usage:
local Director = require("Director")
Director.entry:addChild(node)
clearColor
Type: Field.
Description:
The background color for the game world.
Signature:
clearColor: Color
scheduler
Type: Field.
Description:
Provides access to the game scheduler, which is used for scheduling tasks like animations and gameplay events.
Signature:
scheduler: Scheduler
ui
Type: Readonly Field.
Description:
The root node for 2D user interface elements like buttons and labels.
Signature:
const ui: Node
ui3D
Type: Readonly Field.
Description:
The root node for 3D user interface elements with 3D projection effect.
Signature:
const ui3D: Node
entry
Type: Readonly Field.
Description:
The root node for the starting point of a game.
Signature:
const entry: Node
postNode
Type: Readonly Field.
Description:
The root node for post-rendering scene tree.
Signature:
const postNode: Node
systemScheduler
Type: Readonly Field.
Description:
Provides access to the system scheduler, which is used for low-level system tasks, should not put any game logic in it.
Signature:
const systemScheduler: Scheduler
postScheduler
Type: Readonly Field.
Description:
Provides access to the scheduler used for processing post game logic.
Signature:
const postScheduler: Scheduler
currentCamera
Type: Readonly Field.
Description:
The current active camera in Director's camera stack.
Signature:
const currentCamera: Camera
frustumCulling
Type: Field.
Description:
The flag to enable or disable frustum culling.
Signature:
frustumCulling: boolean