SuperTuxKart
Public Member Functions | Private Member Functions | Private Attributes | List of all members
RaceGUIOverworld Class Reference

Handles the in-race GUI (messages, mini-map, rankings, timer, etc...) More...

#include <race_gui_overworld.hpp>

Inheritance diagram for RaceGUIOverworld:
Inheritance graph
[legend]

Public Member Functions

 RaceGUIOverworld ()
 The constructor is called before anything is attached to the scene node. More...
 
virtual void renderGlobal (float dt)
 Render all global parts of the race gui, i.e. More...
 
virtual void renderPlayerView (const Camera *camera, float dt)
 Render the details for a single player, i.e. More...
 
const OverworldChallengegetCurrentChallenge () const
 Returns the currently selected challenge data (or NULL if no is selected). More...
 
virtual const core::dimension2du getMiniMapSize () const
 Returns the size of the texture on which to render the minimap to. More...
 
virtual void calculateMinimapSize ()
 
- Public Member Functions inherited from RaceGUIBase
virtual ~RaceGUIBase ()
 The destructor removes the marker texture and the referee scene node.
 
virtual void init ()
 This is a second initialisation call (after the constructor) for the race gui. More...
 
virtual void reset ()
 This is called when restarting a race. More...
 
virtual void addMessage (const irr::core::stringw &m, const AbstractKart *kart, float time, const video::SColor &color=video::SColor(255, 255, 0, 255), bool important=true, bool big_font=false, bool outline=false)
 Adds a message to the message queue. More...
 
virtual void update (float dt)
 Update, called once per frame. More...
 
virtual void preRenderCallback (const Camera *camera)
 This function is called just before rendering the view for each kart. More...
 
virtual void clearAllMessages ()
 
void drawGlobalPlayerIcons (int bottom_margin)
 Draw players icons and, depending on the current mode, their time or their score (battle lives, egg collected, etc.).
 
void drawPlayerIcon (AbstractKart *kart, int x, int y, int w, bool is_local)
 Draw one player icon Takes care of icon looking different due to plumber, squashing, ...
 
virtual void drawEnergyMeter (int x, int y, const AbstractKart *kart, const core::recti &viewport, const core::vector2df &scaling)
 
void cleanupMessages (const float dt)
 Removes messages which have been displayed long enough. More...
 
void removeReferee ()
 
RaceGUIMultitouchgetMultitouchGUI ()
 
void recreateMultitouchGUI ()
 

Private Member Functions

void drawGlobalMiniMap ()
 Display items that are shown once only (for all karts). More...
 
void drawTrophyPoints ()
 Displays the number of challenge trophies.
 

Private Attributes

Materialm_speed_meter_icon
 
Materialm_speed_bar_icon
 
bool m_close_to_a_challenge
 
video::ITexture * m_trophy [4]
 
video::ITexture * m_lock
 
video::ITexture * m_open_challenge
 
video::ITexture * m_locked_bonus
 
video::ITexture * m_icons [7]
 
int m_minimap_challenge_size
 The size of a single marker on the screen for AI karts, need not be a power of 2. More...
 
int m_minimap_player_size
 The size of a single marker on the screen or player karts, need not be a power of 2. More...
 
int m_map_rendered_width
 The width of the rendered mini map in pixels, must be a power of 2. More...
 
int m_map_rendered_height
 The height of the rendered mini map in pixels, must be a power of 2. More...
 
int m_map_width
 Width of the map in pixels on the screen, need not be a power of 2. More...
 
int m_map_height
 Height of the map in pixels on the screen, need not be a power of 2. More...
 
int m_map_left
 Distance of map from left side of screen. More...
 
bool m_is_minimap_initialized
 True if the minimap is initialized.
 
int m_map_bottom
 Distance of map from bottom of screen. More...
 
int m_trophy_points_width
 
const ChallengeDatam_active_challenge
 The latest challenge approached by the kart.
 
core::stringw m_challenge_description
 
const OverworldChallengem_current_challenge
 The current challenge over which the mouse is hovering. More...
 

Additional Inherited Members

- Public Attributes inherited from RaceGUIBase
bool m_enabled
 
- Protected Types inherited from RaceGUIBase
enum  PlungerState { PLUNGER_STATE_INIT, PLUNGER_STATE_SLOW_1, PLUNGER_STATE_SLOW_2, PLUNGER_STATE_FAST }
 State of the plunger: From the 'init' states the plunger switches between two slow moving states ('shakily moving') till the end of the plunger time is nearly reached, then it goes to a very fast moving state ('plunger blown off'). More...
 
- Protected Member Functions inherited from RaceGUIBase
void createRegularPolygon (unsigned int n, float radius, const core::vector2df &center, const video::SColor &color, video::S3DVertex *v, unsigned short int *index)
 Creates the 2D vertices for a regular polygon. More...
 
void drawAllMessages (const AbstractKart *kart, const core::recti &viewport, const core::vector2df &scaling)
 Displays all messages in the message queue.
 
void drawPowerupIcons (const AbstractKart *kart, const core::recti &viewport, const core::vector2df &scaling)
 Draws the powerup icons on the screen (called once for each player). More...
 
void drawGlobalMusicDescription ()
 Displays the description given for the music currently being played. More...
 
void drawGlobalReadySetGo ()
 Draws the ready-set-go message on the screen.
 
void drawGlobalGoal ()
 
void drawPlungerInFace (const Camera *camera, float dt)
 Draws the plunger-in-face if necessary. More...
 
void ignoreUnimportantMessages ()
 Instructs the base gui to ignore unimportant messages (like item messages).
 
- Protected Attributes inherited from RaceGUIBase
enum RaceGUIBase::PlungerState m_plunger_state
 
float m_plunger_move_time
 How long the plunger should stay in the current state. More...
 
core::vector2di m_plunger_offset
 Offset of the plunger. More...
 
core::vector2df m_plunger_speed
 
video::ITexture * m_gauge_empty
 The size of a single marker in pixels, must be a power of 2. More...
 
video::ITexture * m_gauge_full
 Default texture for nitro gauge. More...
 
video::ITexture * m_gauge_full_bright
 Highlight gauge, used when a kart uses nitro. More...
 
video::ITexture * m_gauge_goal
 
video::ITexture * m_icons_frame
 The frame around player karts in the mini map. More...
 
video::ITexture * m_lap_flag
 Texture for the lap icon.
 
RaceGUIMultitouchm_multitouch_gui
 
float m_dist_show_overlap
 Distance on track to begin showing overlap in drawGlobalPlayerIcons.
 
float m_icons_inertia
 can be zero
 
std::vector< core::vector2d< s32 > > m_previous_icons_position
 can be zero More...
 
std::vector< KartIconDisplayInfom_kart_display_infos
 This vector is passed to world to be filled with the current race data information. More...
 

Detailed Description

Handles the in-race GUI (messages, mini-map, rankings, timer, etc...)

Constructor & Destructor Documentation

◆ RaceGUIOverworld()

RaceGUIOverworld::RaceGUIOverworld ( )

The constructor is called before anything is attached to the scene node.

So rendering to a texture can be done here. But world is not yet fully created, so only the race manager can be accessed safely.

Member Function Documentation

◆ drawGlobalMiniMap()

void RaceGUIOverworld::drawGlobalMiniMap ( )
private

Display items that are shown once only (for all karts).

Draws the mini map and the position of all karts on it.

◆ getCurrentChallenge()

const OverworldChallenge* RaceGUIOverworld::getCurrentChallenge ( ) const
inline

Returns the currently selected challenge data (or NULL if no is selected).

◆ getMiniMapSize()

virtual const core::dimension2du RaceGUIOverworld::getMiniMapSize ( ) const
inlinevirtual

Returns the size of the texture on which to render the minimap to.

Implements RaceGUIBase.

◆ renderGlobal()

void RaceGUIOverworld::renderGlobal ( float  dt)
virtual

Render all global parts of the race gui, i.e.

things that are only displayed once even in splitscreen.

Parameters
dtTimestep sized.

Reimplemented from RaceGUIBase.

◆ renderPlayerView()

void RaceGUIOverworld::renderPlayerView ( const Camera camera,
float  dt 
)
virtual

Render the details for a single player, i.e.

speed, energy, collectibles, ...

Parameters
kartPointer to the kart for which to render the view.

Reimplemented from RaceGUIBase.

Member Data Documentation

◆ m_current_challenge

const OverworldChallenge* RaceGUIOverworld::m_current_challenge
private

The current challenge over which the mouse is hovering.

◆ m_map_bottom

int RaceGUIOverworld::m_map_bottom
private

Distance of map from bottom of screen.

◆ m_map_height

int RaceGUIOverworld::m_map_height
private

Height of the map in pixels on the screen, need not be a power of 2.

◆ m_map_left

int RaceGUIOverworld::m_map_left
private

Distance of map from left side of screen.

◆ m_map_rendered_height

int RaceGUIOverworld::m_map_rendered_height
private

The height of the rendered mini map in pixels, must be a power of 2.

◆ m_map_rendered_width

int RaceGUIOverworld::m_map_rendered_width
private

The width of the rendered mini map in pixels, must be a power of 2.

◆ m_map_width

int RaceGUIOverworld::m_map_width
private

Width of the map in pixels on the screen, need not be a power of 2.

◆ m_minimap_challenge_size

int RaceGUIOverworld::m_minimap_challenge_size
private

The size of a single marker on the screen for AI karts, need not be a power of 2.

◆ m_minimap_player_size

int RaceGUIOverworld::m_minimap_player_size
private

The size of a single marker on the screen or player karts, need not be a power of 2.


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