Scene base class.
More...
#include <Scene.h>
|
| | Scene (Game *game) |
| | Construct a new Scene object.
|
| |
|
virtual | ~Scene () |
| | Destroy the Scene object.
|
| |
| void | addObject (std::shared_ptr< Object > object) |
| | Add object to scene for drawing.
|
| |
| void | insertObject (std::shared_ptr< Object > object, int position) |
| | Add object to scene for drawing to specific position.
|
| |
| void | removeObject (std::shared_ptr< Object > object) |
| | Remove object from scene.
|
| |
| void | setCamera (const int x, const int y) |
| | Set the Camera object to specific position.
|
| |
| virtual void | onEnter () |
| | Called when scene become activated.
|
| |
| virtual void | onExit () |
| | CAlled when scene become deactivated.
|
| |
| virtual void | onEvent (const SDL_Event &event) |
| | Trigger on SDL2 event if scene is active.
|
| |
| virtual void | update (const unsigned int delta) |
| | Trigger on update if scene is active.
|
| |
|
void | draw () const |
| | Draw objects on the screen.
|
| |
|
SDL_Rect | getCamera () const |
| | Returns the current camera position.
|
| |
| virtual bool | wantsNetworkInputPolling () const |
| | Returns true when this scene wants Game to poll and send multiplayer input every sim tick.
|
| |
| virtual void | onNetInputQueued (uint32_t inputSeq, uint8_t buttons) |
| | Called after Game samples and queues a local input for multiplayer scenes.
|
| |
◆ Scene()
| bomberman::Scene::Scene |
( |
Game * |
game | ) |
|
Construct a new Scene object.
- Parameters
-
◆ addObject()
| void bomberman::Scene::addObject |
( |
std::shared_ptr< Object > |
object | ) |
|
Add object to scene for drawing.
- Parameters
-
◆ insertObject()
| void bomberman::Scene::insertObject |
( |
std::shared_ptr< Object > |
object, |
|
|
int |
position |
|
) |
| |
Add object to scene for drawing to specific position.
- Parameters
-
| object | |
| position | - position where to insert object |
◆ onEnter()
| void bomberman::Scene::onEnter |
( |
| ) |
|
|
virtual |
◆ onEvent()
| void bomberman::Scene::onEvent |
( |
const SDL_Event & |
event | ) |
|
|
virtual |
◆ onExit()
| void bomberman::Scene::onExit |
( |
| ) |
|
|
virtual |
◆ onNetInputQueued()
| void bomberman::Scene::onNetInputQueued |
( |
uint32_t |
inputSeq, |
|
|
uint8_t |
buttons |
|
) |
| |
|
virtual |
Called after Game samples and queues a local input for multiplayer scenes.
inputSeq is the local sequence assigned by NetClient. Scenes that do not care about local prediction can ignore this hook.
Reimplemented in bomberman::MultiplayerLevelScene.
◆ removeObject()
| void bomberman::Scene::removeObject |
( |
std::shared_ptr< Object > |
object | ) |
|
Remove object from scene.
- Parameters
-
◆ setCamera()
| void bomberman::Scene::setCamera |
( |
const int |
x, |
|
|
const int |
y |
|
) |
| |
Set the Camera object to specific position.
- Parameters
-
| x | - position x |
| y | - position y |
◆ update()
| void bomberman::Scene::update |
( |
const unsigned int |
delta | ) |
|
|
virtual |
◆ wantsNetworkInputPolling()
| virtual bool bomberman::Scene::wantsNetworkInputPolling |
( |
| ) |
const |
|
inlinevirtual |
The documentation for this class was generated from the following files: