Scene class that represents a scene in the game.
More...
#include <Scene.hpp>
|
| Scene (int width, int height) |
| Construct a new Scene object with the given width and height.
|
|
| Scene (const Scene &scene) |
| Construct a new Scene object from an existing scene.
|
|
void | StartUp (SDL_Renderer *renderer) |
| Start up the scene. OnStart is called here.
|
|
void | Shutdown () |
| Shutdown the scene.
|
|
void | Input (float deltaTime) |
| Handle input.
|
|
void | Update (float deltaTime) |
| Update the game state.
|
|
void | Render () |
| Render the game.
|
|
void | SetSceneActive (bool active) |
| Set the scene to be active or inactive.
|
|
bool | IsSceneActive () const |
| Check if the scene is active.
|
|
void | AddGameEntity (std::shared_ptr< GameEntity > entity) |
| Add a game entity to the scene.
|
|
std::vector< std::shared_ptr< GameEntity > > | GetEntities () |
| Get the entities in the scene.
|
|
void | SetBackgroundColor (std::string color) |
| Set the background color of the scene.
|
|
void | SetBackgroundTexture (std::string filepath) |
|
void | ClearBackgroundTexture () |
|
int | GetWidth () const |
| Get the width of the scene.
|
|
int | GetHeight () const |
| Get the height of the scene.
|
|
SDL_Renderer * | GetRenderer () const |
|
Scene class that represents a scene in the game.
◆ Scene() [1/2]
Scene::Scene |
( |
int | width, |
|
|
int | height ) |
Construct a new Scene object with the given width and height.
- Parameters
-
width | The width of the scene |
height | The height of the scene |
◆ Scene() [2/2]
Scene::Scene |
( |
const Scene & | scene | ) |
|
Construct a new Scene object from an existing scene.
- Parameters
-
◆ AddGameEntity()
void Scene::AddGameEntity |
( |
std::shared_ptr< GameEntity > | entity | ) |
|
Add a game entity to the scene.
- Parameters
-
◆ GetEntities()
std::vector< std::shared_ptr< GameEntity > > Scene::GetEntities |
( |
| ) |
|
|
inline |
Get the entities in the scene.
- Returns
- std::vector<std::shared_ptr<GameEntity>>
◆ GetHeight()
int Scene::GetHeight |
( |
| ) |
const |
|
inline |
Get the height of the scene.
- Returns
- int The height of the scene
◆ GetWidth()
int Scene::GetWidth |
( |
| ) |
const |
|
inline |
Get the width of the scene.
- Returns
- int The width of the scene
◆ Input()
void Scene::Input |
( |
float | deltaTime | ) |
|
Handle input.
- Parameters
-
deltaTime | Time since last frame |
◆ IsSceneActive()
bool Scene::IsSceneActive |
( |
| ) |
const |
Check if the scene is active.
- Returns
- true
-
false
◆ SetBackgroundColor()
void Scene::SetBackgroundColor |
( |
std::string | color | ) |
|
Set the background color of the scene.
- Parameters
-
color | Color of the background |
◆ SetSceneActive()
void Scene::SetSceneActive |
( |
bool | active | ) |
|
Set the scene to be active or inactive.
- Parameters
-
active | True if the scene should be active, false otherwise |
◆ StartUp()
void Scene::StartUp |
( |
SDL_Renderer * | renderer | ) |
|
Start up the scene. OnStart is called here.
- Parameters
-
◆ Update()
void Scene::Update |
( |
float | deltaTime | ) |
|
Update the game state.
- Parameters
-
deltaTime | Time since last frame |
The documentation for this struct was generated from the following file: