Examples could be: A highscore screen, a game play screen, a bonus level screen, a weapon shop screen, etc.
The order in which the Screens are to appear is defined by the ActionEngine.
The most important operations are the nextPeriod() operation which is invoked in regular intervals and is supposed to update the internal state of the Screen. And the drawAction() operation which is invoked right afterwards, and is responsible for drawing a visual representation of the current state onto the viewport Canvas.
Definition at line 50 of file Screen.h.
Public Member Functions | |
Lifecycle management | |
Screen () SEC_GAME | |
Construct a new Screen. | |
virtual | ~Screen () SEC_GAME=0 |
Destroy the Screen. | |
virtual void | init (const Canvas *displayCanvas, const Canvas *viewportCanvas) SEC_GAME=0 |
Initialize the internal state of the Screen, and prepare all assets (bitmaps, etc.) CAUTION!!! All bitmaps need to be prepared for the Canvas on which they will later be painted. | |
Control flow | |
virtual Boolean | nextPeriod () SEC_GAME=0 |
Progress to the next period. | |
virtual UInt32 | getAdvanceTimeInterval () SEC_GAME |
In what intervals shall this screen be updated? | |
virtual UInt32 | getPauseLengthBeforeResuming () SEC_GAME |
How long shall the engine freeze the screen after resuming from a pause? | |
Visual representation | |
virtual void | getDisplayProperties (DisplayProperties &displayProperties) const SEC_GAME |
virtual void | getViewportProperties (const Canvas *displayCanvas, ViewportProperties &viewport) const SEC_GAME=0 |
Return the viewport properties that the screen needs to operate. | |
virtual void | drawBackground (const Canvas *viewportCanvas) const SEC_GAME=0 |
Draw the background of the viewport canvas. | |
virtual void | drawAction (const Canvas *viewportCanvas, RectangleType *dirtyRectangle) SEC_GAME=0 |
Draw the visual appearance of the action onto the viewport canvas. | |
virtual void | drawFixedOverlays (const Canvas *displayCanvas) const SEC_GAME=0 |
Draw any static imagery which lies outside the viewport region. | |
virtual void | drawDynamicOverlays (const Canvas *displayCanvas) const SEC_GAME=0 |
Draw any dynamic imagery which lies outside the viewport region. | |
Input management | |
virtual void | receiveEvent (const EventType *evtPtr) SEC_GAME=0 |
Receive an input event. | |
Screen properties | |
virtual bool | enableMenu () const SEC_GAME |
Indicates whether the screen wants a menu. |
|
Construct a new Screen.
|
|
Destroy the Screen.
|
|
Initialize the internal state of the Screen, and prepare all assets (bitmaps, etc.) No mixing is allowed! |
|
Progress to the next period. Update the internal state of your Screen, but DO NOT DRAW ANYTHING!. Only draw in your drawXXX() operations.
|
|
In what intervals shall this screen be updated?
|
|
How long shall the engine freeze the screen after resuming from a pause?
|
|
|
|
Return the viewport properties that the screen needs to operate.
|
|
Draw the background of the viewport canvas. It is assumed that this operation fills the entire viewport region with an image. |
|
Draw the visual appearance of the action onto the viewport canvas.
|
|
Draw any static imagery which lies outside the viewport region.
|
|
Draw any dynamic imagery which lies outside the viewport region.
|
|
Receive an input event. The Screen can freely decide whether it wants to react to it, or not. |
|
Indicates whether the screen wants a menu.
|