Stage
┗> Object > Class
The Stage object in Kristal is designed to be the highest parent object at all times.
All throughout gameplay, the active stage is Game.stage, while when in the Kristal menu, Kristal.Stage is the stage instead.
Methods
Stage:addToStage(object: Object)
Adds an object and all of its children to this stage
Arguments:
| object: Object | The base class of all objects in Kristal. |
Stage:getObjects(class: Class)
Gets every object attached to this stage that inherits from class
@param class — The included Class to select from
@return matches — All the objects parented to this stage that inherit from class
Arguments:
| class: Class | The included Class to select from |
Returns:
| matches: Class | All the objects parented to this stage that inherit from |
Stage:removeFromStage(object: Object)
Removes an object and all of its children from this stage
Arguments:
| object: Object | The base class of all objects in Kristal. |
Fields
Stage.objects: Object[]
A list of all the objects attached to this stage
Stage.objects_by_class: table<Class, Object[]>
A list of all the objects attached to this stage, sorted by the classes that they include
Stage.objects_to_remove: Object[]
A list of objects pending removal from this stage (removed on the next update tick)
Stage.stage: Stage
The Stage object in Kristal is designed to be the highest parent object at all times.
All throughout gameplay, the active stage is Game.stage, while when in the Kristal menu, Kristal.Stage is the stage instead.