#include <screen.hpp>
Inherited by GameSession, LevelIntro, TextScroller, TitleScreen, and worldmap::WorldMap.
Public Member Functions | |
virtual | ~Screen () |
virtual void | setup () |
gets called before this screen gets activated (which is at least once before the first draw or update call | |
virtual void | leave () |
gets called when the current screen is temporarily suspended | |
virtual void | draw (DrawingContext &context)=0 |
gets called once per frame. | |
virtual void | update (float elapsed_time)=0 |
gets called for once (per logical) frame. |
Examples of Screens are: The TitleScreen, a WorldMap, a level's GameSession, a TextScroller, ...
Definition at line 28 of file screen.hpp.
virtual Screen::~Screen | ( | ) | [inline, virtual] |
virtual void Screen::setup | ( | ) | [inline, virtual] |
gets called before this screen gets activated (which is at least once before the first draw or update call
Reimplemented in GameSession, LevelIntro, TextScroller, TitleScreen, and worldmap::WorldMap.
Definition at line 38 of file screen.hpp.
Referenced by ScreenManager::handle_screen_switch().
virtual void Screen::leave | ( | ) | [inline, virtual] |
gets called when the current screen is temporarily suspended
Reimplemented in TitleScreen, and worldmap::WorldMap.
Definition at line 41 of file screen.hpp.
virtual void Screen::draw | ( | DrawingContext & | context | ) | [pure virtual] |
gets called once per frame.
The screen should draw itself in this function. State changes should not be done in this function, but rather in update
Implemented in GameSession, LevelIntro, TextScroller, TitleScreen, and worldmap::WorldMap.
virtual void Screen::update | ( | float | elapsed_time | ) | [pure virtual] |
gets called for once (per logical) frame.
Screens should do their state updates and logic here
Implemented in GameSession, LevelIntro, TextScroller, TitleScreen, and worldmap::WorldMap.