The Scene object is a base class to construct a Scene upon. The scene is basically a view that can be swapped at runtime with other scenes. It is supposed to contain other Graphic Objects inside of it, since it won't draw anything on its own. The draw method is simply calling the draw method for each child object.
More...
#include <GraphicsScene.h>
The Scene object is a base class to construct a Scene upon. The scene is basically a view that can be swapped at runtime with other scenes. It is supposed to contain other Graphic Objects inside of it, since it won't draw anything on its own. The draw method is simply calling the draw method for each child object.
◆ GraphicsScene() [1/3]
| GraphicsScene::GraphicsScene |
( |
| ) |
|
◆ GraphicsScene() [2/3]
◆ GraphicsScene() [3/3]
◆ ~GraphicsScene()
| GraphicsScene::~GraphicsScene |
( |
| ) |
|
|
virtual |
◆ addObject()
Add an object to the scene. *** Once added, the object is bound to the scene and it will take care of deleting the object when destroyed ***.
- Parameters
-
◆ addObjects() [1/2]
| void GraphicsScene::addObjects |
( |
GraphicsObject ** |
toadd, |
|
|
size_t |
number |
|
) |
| |
Add an array of objects to the scene.
- Parameters
-
| toadd | The array of objects |
| number | The number of objects |
◆ addObjects() [2/2]
| void GraphicsScene::addObjects |
( |
const std::vector< GraphicsObject *> & |
toadd | ) |
|
Add a vector of objects.
- Parameters
-
| toadd | The vector of objects |
◆ clearObjects()
| void GraphicsScene::clearObjects |
( |
| ) |
|
Removes all the objects from the scene, taking ownership back on them.
◆ draw()
| void GraphicsScene::draw |
( |
uint32_t |
time | ) |
|
|
overridevirtual |
The draw method. It will be called once per frame for each object in a scene.
- Parameters
-
| time | A time parameter (as given by SDL_GetTicks) for time-based animation purposes |
Implements GraphicsObject.
◆ getObjects()
| const std::vector< GraphicsObject * > GraphicsScene::getObjects |
( |
| ) |
const |
◆ operator=()
◆ removeObject() [1/2]
Removes an object from the scene. *** You take ownership of the object back, so the scene won't delete it anymore ***.
- Parameters
-
| toremove | The object to remove |
◆ removeObject() [2/2]
| void GraphicsScene::removeObject |
( |
int |
index | ) |
|
Removes an object at the given index.
- Parameters
-
| index | The inner index of the object |
◆ show()
| void GraphicsScene::show |
( |
| ) |
|
The documentation for this class was generated from the following files: