|
| RaceGUI () |
| The constructor is called before anything is attached to the scene node.
|
|
virtual void | init () |
| This is a second initialisation call (after the constructor) for the race gui.
|
|
virtual void | reset () |
| Reset the gui before a race.
|
|
virtual void | renderGlobal (float dt) |
| Render all global parts of the race gui, i.e.
|
|
virtual void | renderPlayerView (const Camera *camera, float dt) |
| Render the details for a single player, i.e.
|
|
virtual const core::dimension2du | getMiniMapSize () const |
| Returns the size of the texture on which to render the minimap to.
|
|
virtual void | initSize () |
| Called when loading the race gui or screen resized.
|
|
virtual void | calculateMinimapSize () |
|
virtual | ~RaceGUIBase () |
| The destructor removes the marker texture and the referee scene node.
|
|
virtual void | renderGlobal (float dt) |
| Updates lightning related information.
|
|
virtual void | init () |
| This is a second initialisation call (after the constructor) for the race gui.
|
|
virtual void | reset () |
| This is called when restarting a race.
|
|
virtual void | renderPlayerView (const Camera *camera, float dt) |
|
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.
|
|
virtual void | update (float dt) |
| Update, called once per frame.
|
|
virtual void | preRenderCallback (const Camera *camera) |
| This function is called just before rendering the view for each kart.
|
|
virtual const core::dimension2du | getMiniMapSize () const =0 |
| Returns the size of the texture on which to render the minimap to.
|
|
virtual void | calculateMinimapSize () |
|
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.
|
|
void | removeReferee () |
|
RaceGUIMultitouch * | getMultitouchGUI () |
|
void | recreateGUI () |
|
virtual void | initSize () |
| Called when loading the race gui or screen resized.
|
|
|
void | drawEnergyMeter (int x, int y, const AbstractKart *kart, const core::recti &viewport, const core::vector2df &scaling) |
| Energy meter that gets filled with nitro.
|
|
void | drawSpeedEnergyRank (const AbstractKart *kart, const core::recti &viewport, const core::vector2df &scaling, float dt) |
| Draws the speedometer, the display of available nitro, and the rank of the kart (inside the speedometer).
|
|
void | drawLap (const AbstractKart *kart, const core::recti &viewport, const core::vector2df &scaling) |
| Displays the lap of the kart.
|
|
void | drawRank (const AbstractKart *kart, const core::vector2df &offset, float min_ratio, int meter_width, int meter_height, float dt) |
| Draws the rank of a player.
|
|
void | drawMeterTexture (video::ITexture *meter_texture, video::S3DVertex vertices[], unsigned int count, bool reverse=false) |
|
unsigned int | computeVerticesForMeter (core::vector2df position[], float threshold[], video::S3DVertex vertices[], unsigned int vertices_count, float measure, int gauge_width, int gauge_height, core::vector2df offset) |
| This function computes a polygon used for drawing the measure for a meter (speedometer, etc.) The variable measured by the meter is compared to the thresholds, and is then used to compute a point between the two points associated with the lower and upper threshold Then, a polygon is calculated linking all the previous points and the variable point which link back to the first point.
|
|
void | drawGlobalMiniMap () |
| Display items that are shown once only (for all karts).
|
|
void | drawGlobalTimer () |
| Displays the racing time on the screen.
|
|
void | drawLiveDifference () |
| Displays the live difference with a ghost on screen.
|
|
|
int | m_minimap_ai_size |
| The size of a single marker on the screen for AI karts, need not be a power of 2.
|
|
int | m_minimap_player_size |
| The size of a single marker on the screen or player karts, need not be a power of 2.
|
|
int | m_map_rendered_width |
| The width of the rendered mini map in pixels, must be a power of 2.
|
|
int | m_map_rendered_height |
| The height of the rendered mini map in pixels, must be a power of 2.
|
|
int | m_map_width |
| Width of the map in pixels on the screen, need not be a power of 2.
|
|
int | m_map_height |
| Height of the map in pixels on the screen, need not be a power of 2.
|
|
int | m_map_left |
| Distance of map from left side of screen.
|
|
int | m_map_bottom |
| Distance of map from bottom of screen.
|
|
int | m_lap_width |
| Maximum lap display length (either 9/9 or 99/99).
|
|
int | m_timer_width |
| Maximum string length for the timer.
|
|
int | m_small_precise_timer_width |
| Maximum string length for a small precise timer (like the live difference timer under a minute)
|
|
int | m_big_precise_timer_width |
| Maximum string length for a big precise timer (like the live difference timer over a minute)
|
|
int | m_negative_timer_additional_width |
|
int | m_font_height |
| Height of the digit font.
|
|
irr::video::ITexture * | m_red_team |
| Icon textures (stored as variables to not look up their location on every frame)
|
|
irr::video::ITexture * | m_blue_team |
|
irr::video::ITexture * | m_red_flag |
|
irr::video::ITexture * | m_blue_flag |
|
irr::video::ITexture * | m_soccer_ball |
|
irr::video::ITexture * | m_heart_icon |
|
irr::video::ITexture * | m_basket_ball_icon |
|
irr::video::ITexture * | m_champion |
| Texture for the hit limit icon.
|
|
irr::video::ITexture * | m_speed_meter_icon |
| Texture for speedometer.
|
|
irr::video::ITexture * | m_speed_bar_icon |
|
std::vector< AnimationState > | m_animation_states |
|
std::vector< float > | m_rank_animation_duration |
| How long the rank animation has been shown.
|
|
std::vector< int > | m_last_ranks |
| Stores the previous rank for each kart.
|
|
bool | m_is_tutorial |
|
|
bool | m_enabled |
|
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').
|
|
void | createRegularPolygon (unsigned int n, float radius, const core::vector2df ¢er, const video::SColor &color, video::S3DVertex *v, unsigned short int *index) |
| Creates the 2D vertices for a regular polygon.
|
|
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).
|
|
void | drawGlobalMusicDescription () |
| Displays the description given for the music currently being played.
|
|
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.
|
|
void | ignoreUnimportantMessages () |
| Instructs the base gui to ignore unimportant messages (like item messages).
|
|
enum RaceGUIBase::PlungerState | m_plunger_state |
|
float | m_plunger_move_time |
| How long the plunger should stay in the current state.
|
|
core::vector2di | m_plunger_offset |
| Offset of the plunger.
|
|
core::vector2df | m_plunger_speed |
|
video::ITexture * | m_gauge_empty |
| The size of a single marker in pixels, must be a power of 2.
|
|
video::ITexture * | m_gauge_full |
| Default texture for nitro gauge.
|
|
video::ITexture * | m_gauge_full_bright |
| Highlight gauge, used when a kart uses nitro.
|
|
video::ITexture * | m_gauge_goal |
|
video::ITexture * | m_icons_frame |
| The frame around player karts in the mini map.
|
|
video::ITexture * | m_icons_kart_list |
| The frame around player karts in the kart list.
|
|
video::ITexture * | m_lap_flag |
| Texture for the lap icon.
|
|
RaceGUIMultitouch * | m_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
|
|
std::vector< KartIconDisplayInfo > | m_kart_display_infos |
| This vector is passed to world to be filled with the current race data information.
|
|
Handles the in-race GUI (messages, mini-map, rankings, timer, etc...)
unsigned int RaceGUI::computeVerticesForMeter |
( |
core::vector2df |
position[], |
|
|
float |
threshold[], |
|
|
video::S3DVertex |
vertices[], |
|
|
unsigned int |
vertices_count, |
|
|
float |
measure, |
|
|
int |
gauge_width, |
|
|
int |
gauge_height, |
|
|
core::vector2df |
offset |
|
) |
| |
|
private |
This function computes a polygon used for drawing the measure for a meter (speedometer, etc.) The variable measured by the meter is compared to the thresholds, and is then used to compute a point between the two points associated with the lower and upper threshold Then, a polygon is calculated linking all the previous points and the variable point which link back to the first point.
This polygon is used for drawing.
Consider the following example :
A E
-|
x
|
-D-|
-w-|
|-C--|
-B–v-|
If the measure is inferior to the first threshold, the function will create a triangle ABv with the position of v varying proportionally on a line between B and C ; at B with 0 and at C when it reaches the first threshold. If the measure is between the first and second thresholds, the function will create a quad ABCw, with w varying in the same way than v. If the measure exceds the higher threshold, the function will return the poly ABCDE.
- Parameters
-
position | The relative positions of the vertices. |
threshold | The thresholds at which the variable point switch from a segment to the next. The size of this array should be smaller by two than the position array. The last threshold determines the measure over which the meter is full |
vertices | Where the results of the computation are put, for use by the calling function. |
vertices_count | The maximum number of vertices to use. Should be superior or equal to the size of the arrays. |
measure | The value of the variable measured by the meter. |
gauge_width | The width of the meter |
gauge_height | The height of the meter |
offset | The offset to position the meter |
This is a second initialisation call (after the constructor) for the race gui.
This is called after the world has been initialised, e.g. all karts do exist (while the constructor is called before the karts are created). In the base gui this is used to initialise the referee data (which needs the start positions of the karts). Note that this function is (and must be called only once, after its constructor).
- Precondition
- All karts must be created, since this object defines the positions for the referees based on the karts.
Reimplemented from RaceGUIBase.