The Director is a singleton (accessed via Director.Instance) that manages the scene stack and calls the update loop of the Scheduler and ActionManager. More...
Public Member Functions | |
void | Dispose () |
Dispose implementation. | |
void | ReplaceScene (Scene new_scene) |
Replace current scene by an other one. | |
void | PushScene (Scene new_scene) |
Push a new scene on the scene stack. | |
void | PopScene () |
Pop the top scene on the scene stack (sets previous scene). | |
void | Pause () |
Pause everything. | |
void | Resume () |
Resume everything. | |
void | Dump () |
Print some debug information, content might vary in the future. | |
void | Update () |
The main stepping function, that you must call once a frame. | |
void | Render () |
The main render function, that you must call once a frame. | |
void | PostSwap () |
A post swap callback that you must call after SwapBuffers(). | |
void | RunWithScene (Scene scene, bool manual_loop=false) |
This function must be called once by user, to tell the system which Scene object it should start with. | |
Static Public Member Functions | |
static void | Initialize (uint sprites_capacity=500, uint draw_helpers_capacity=400, Sce.PlayStation.Core.Graphics.GraphicsContext context=null) |
Initialize GameEngine2D. | |
static void | Terminate () |
Terminate GameEngine2D. | |
Public Attributes | |
GraphicsContextAlpha | GL |
The graphics context + matrix stack. | |
SpriteRenderer | SpriteRenderer |
The main SpriteRenderer object. | |
DrawHelpers | DrawHelpers |
Some draw helpers for debug draw. | |
uint | DebugFlags = 0 |
Some debug flags to enable logging, debug draw, camera navigation etc. | |
Properties | |
double | DirectorTime [get] |
A timer that gets incremented everytime Update gets called. | |
static Director | Instance [get] |
The director singleton. | |
Scene | CurrentScene [get] |
Get the currently running Scene object. |
The Director is a singleton (accessed via Director.Instance) that manages the scene stack and calls the update loop of the Scheduler and ActionManager.
Its Update/Render/PostSwap functions must be called manually once in the user main loop, if you are managing the main loop yourself. It also holds a graphics context (GL), a SpriteRenderer object (that is mostly for internal used but that you can also use directly), and a DrawHelpers that is mosty used internally when drawing debug information.
static void Initialize | ( | uint | sprites_capacity = 500 , |
uint | draw_helpers_capacity = 400 , |
||
Sce.PlayStation.Core.Graphics.GraphicsContext | context = null |
||
) | [static] |
Initialize GameEngine2D.
sprites_capacity | The maximum number of sprites, passed to SpriteRenderer's constructor. |
draw_helpers_capacity | The maximum number of vertices that we can use in DrawHelpers. |
context | The core graphics context. |