jade-engine
0.0
|
#include <IScene.h>
Public Member Functions | |
virtual void | SpriteHovered (Sprite *oldSprite, Sprite *newSprite) |
virtual void | Start () |
virtual void | PreUpdate () |
virtual void | Update () |
bool | GetInitialized () const |
void | SetInitialized (const bool initialized) |
bool | GetActive () const |
void | SetActive (const bool active) |
Interface for Scene classes.
Scene is a high-level building block of a game in Jade engine. It is a collection of game objects that are updated and rendered at the same time, and usually contains logic that operates on those game objects.
All game objects created while a scene is active, such as during it's Start() function will be considered part of that scene and will stop being updated and rendered when a new scene is played. Exception to that are objects created with kObjectLayer_Persistent_UI ObjectLayer which are always rendered and updated.
All scenes must inherit from IScene and can override the public virtual functions in order receive callbacks from the Jade engine.
Template for new scene:
|
inline |
Returns whether this scene is currently active, i.e. its Update() is being called every frame.
|
inline |
Returns whether this scene was already initialized, i.e. its Start() was already called.
|
inlinevirtual |
Triggered ever frame by the Jade Engine while this scene is active.
To obtain delta time since last frame use GTime.deltaTime.
The trigger order is the following: IScene::PreUpdate -> IGameObject::Load -> IGameObject::Update -> IScene::Update -> IGameObject::Load -> IGameObject::Render.
|
inline |
Set this scene as active, i.e. its Update() will being called every frame.
|
inline |
Set this scene as initialized, i.e. next GGame.PlayScene will now longer trigger Start().
|
inlinevirtual |
Triggered the first time this scene is played.
An ideal callback to initialize the scene's game objects. Only triggered once, i.e. second call to GGame.PlayScene with this scene will not trigger Start(). Start() will be triggered immediately when GGame.PlayScene is called while the first Update() will happen next frame.
Reimplemented in JadeEngine::OptionsMenuScene, JadeEngine::MainMenuScene, and JadeEngine::PoweredByJadeEngineScene.
|
inlinevirtual |
Triggered every frame by the Jade Engine while this scene is active.
To obtain delta time since last frame use GTime.deltaTime.
The trigger order is the following: IScene::PreUpdate -> IGameObject::Load -> IGameObject::Update -> IScene::Update -> IGameObject::Load -> IGameObject::Render.
Reimplemented in JadeEngine::OptionsMenuScene, JadeEngine::MainMenuScene, and JadeEngine::PoweredByJadeEngineScene.