supertux
Public Member Functions | List of all members
Screen Class Referenceabstract

Abstract base class for code the MainLoop runs exclusively and full-screen. More...

#include <screen.hpp>

Inheritance diagram for Screen:
Inheritance graph
[legend]

Public Member Functions

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 (Compositor &compositor)=0
 gets called once per frame. More...
 
virtual void update (float dt_sec, const Controller &controller)=0
 gets called for once (per logical) frame. More...
 
virtual IntegrationStatus get_status () const =0
 Gives details about what the user is doing right now. More...
 

Detailed Description

Abstract base class for code the MainLoop runs exclusively and full-screen.

Examples of Screens are: The TitleScreen, a WorldMap, a level's GameSession, a TextScroller, ...

Member Function Documentation

◆ draw()

virtual void Screen::draw ( Compositor compositor)
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, Editor, worldmap::WorldSelect, ParticleEditor, TitleScreen, LevelIntro, LevelsetScreen, TextScrollerScreen, and worldmap::WorldMapScreen.

◆ get_status()

virtual IntegrationStatus Screen::get_status ( ) const
pure virtual

Gives details about what the user is doing right now.

Returns
activity details for presence integrations

Implemented in GameSession, Editor, ParticleEditor, worldmap::WorldSelect, TitleScreen, LevelsetScreen, LevelIntro, TextScrollerScreen, and worldmap::WorldMapScreen.

◆ update()

virtual void Screen::update ( float  dt_sec,
const Controller controller 
)
pure virtual

gets called for once (per logical) frame.

Screens should do their state updates and logic here

Implemented in GameSession, Editor, worldmap::WorldSelect, ParticleEditor, TitleScreen, LevelIntro, LevelsetScreen, TextScrollerScreen, and worldmap::WorldMapScreen.


The documentation for this class was generated from the following file: