Back to index

extremetuxracer  0.5beta
Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes
SplashScreen Class Reference

#include <splash_screen.h>

Inheritance diagram for SplashScreen:
Inheritance graph
[legend]
Collaboration diagram for SplashScreen:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SplashScreen ()
 ~SplashScreen ()
void loop (float timeStep)
bool mouseButtonReleaseEvent (int button, int x, int y)
bool keyReleaseEvent (SDLKey key)
virtual bool keyboardEvent (SDLKey key, bool release)
virtual bool keyPressEvent (SDLKey key)
virtual bool mouseButtonEvent (int button, int x, int y, bool pressed)
virtual bool mouseButtonPressEvent (int button, int x, int y)

Static Public Attributes

static GameModecurrentMode = NULL
static game_mode_t mode
static game_mode_t prevmode

Protected Member Functions

void drawSnow (float timeStep, bool windy=false)
 custom function for drawing snow in the ui

Private Member Functions

void drawLogo ()

Private Attributes

pp::Labelmp_anykeyLbl

Detailed Description

Definition at line 28 of file splash_screen.h.


Constructor & Destructor Documentation

Definition at line 30 of file splash_screen.cpp.

{             
       pp::Vec2d pos(getparam_x_resolution()/2, 100); //Coordinates are from bottom-left corner of the screen
       
       mp_anykeyLbl = new pp::Label(pos,"event_and_cup_label",_("PRESS ANY KEY TO START"));

       mp_anykeyLbl->alignment.center();  //use the horizontal center of the text as the placement point
       mp_anykeyLbl->alignment.top(); //use the top of the text as the placement point
       
  play_music( "splash_screen" );
}

Here is the call graph for this function:

Definition at line 42 of file splash_screen.cpp.

{
       // there is no need to keep the logo in memory
       if(getparam_y_resolution()>800) {
              unbind_texture( "splash_screen" );
       } else {
              unbind_texture( "splash_screen" );
       }
       flush_textures();
       
       delete mp_anykeyLbl;
}

Here is the call graph for this function:


Member Function Documentation

void SplashScreen::drawLogo ( ) [private]
void GameMode::drawSnow ( float  timeStep,
bool  windy = false 
) [protected, inherited]

custom function for drawing snow in the ui

Definition at line 203 of file loop.cpp.

{
       // check wether ui snow is 
       if(getparam_ui_snow()){
              // update and draw snow
              update_ui_snow( timeStep, windy );
              draw_ui_snow();
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool GameMode::keyboardEvent ( SDLKey  key,
bool  release 
) [inline, virtual, inherited]

Reimplemented in Racing.

Definition at line 90 of file loop.h.

{return false;};
virtual bool GameMode::keyPressEvent ( SDLKey  key) [inline, virtual, inherited]

Reimplemented in EventSelect, EventRaceSelect, RaceSelect, GameOver, CreditsTrans, ConfigMode, Racing, GameTypeSelect, Paused, Credits, and Intro.

Definition at line 91 of file loop.h.

{return false;};
bool SplashScreen::keyReleaseEvent ( SDLKey  key) [virtual]

Reimplemented from GameMode.

Definition at line 95 of file splash_screen.cpp.

Here is the call graph for this function:

void SplashScreen::loop ( float  timeStep) [virtual]

Implements GameMode.

Definition at line 56 of file splash_screen.cpp.

{
       update_audio();

  clear_rendering_context();
  set_gl_options( GUI );
  UIMgr.setupDisplay();

       drawSnow(timeStep);

       {//should this be created in the splash screen constructor?
              
              if(getparam_y_resolution()>760) {
                     pp::Vec2d pos(getparam_x_resolution()/2 - 256, getparam_y_resolution()/2 - 256); //centered
                     pp::Vec2d size(512, 512);
                     ppGL::draw::rect("splash_screen", pos, size);
              } else {
                     pp::Vec2d pos(getparam_x_resolution()/2 - 256, getparam_y_resolution()/2 - 256/2); //centered
                     pp::Vec2d size(512, 256);
                     ppGL::draw::rect("splash_screen_small", pos, size);
              }
       }      

  UIMgr.draw();

  reshape( getparam_x_resolution(), getparam_y_resolution() );
  winsys_swap_buffers();    
}

Here is the call graph for this function:

virtual bool GameMode::mouseButtonEvent ( int  button,
int  x,
int  y,
bool  pressed 
) [inline, virtual, inherited]

Reimplemented in GameOver.

Definition at line 94 of file loop.h.

{return false;};
virtual bool GameMode::mouseButtonPressEvent ( int  button,
int  x,
int  y 
) [inline, virtual, inherited]

Definition at line 95 of file loop.h.

{return false;};
bool SplashScreen::mouseButtonReleaseEvent ( int  button,
int  x,
int  y 
) [virtual]

Reimplemented from GameMode.

Definition at line 87 of file splash_screen.cpp.

Here is the call graph for this function:


Member Data Documentation

GameMode * GameMode::currentMode = NULL [static, inherited]

Definition at line 96 of file loop.h.

game_mode_t GameMode::mode [static, inherited]

Definition at line 99 of file loop.h.

Definition at line 30 of file splash_screen.h.

game_mode_t GameMode::prevmode [static, inherited]

Definition at line 100 of file loop.h.


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