Head-up display

From SRB2 Wiki
(Redirected from Game HUD)
Jump to: navigation, search

The head-up display (HUD) is a set of screen elements (also known as "HUD items") that are displayed on the top and bottom of the screen while the player is in a level. Its contents depend on the type of level the player is in, but it typically displays information such as the time the player has spent in the level, their score and number of collected rings, their character and number of lives. The position of the items that constitute the HUD on the screen can be changed via SOC.

Game HUD

The Single Player Game HUD in-game.

The Game HUD is the primary HUD and is the HUD the player will see most when playing SRB2, displaying statistics that are immediately relevant to the gameplay at present. The Game HUD can be toggled on and off with the showhud console variable (the shortcut key for this is F3), and it can be made translucent with the translucenthud console variable.

In Single Player and Co-op, the score of the player, the time spent in the level, and the rings collected by the player are displayed in the top left corner, while the name and icon of the character used by the player and the number of lives the player has are displayed in the lower left corner. If the player's ring count is at 0, the "RINGS" element on the HUD will flash red to warn the player of this fact.

In gametypes or level types outside of standard Single Player/Co-op gameplay, extra elements to show additional information may be added to the HUD. Some of the above main elements may also be removed or modified with respect to the gametype/level type being played.

  • In gametypes that allow the player to fire rings (Match, Tag, CTF), or when the ringslinger cheat is enabled otherwise, a set of icons for the available weapon rings will be displayed at the bottom of the screen. Typically only the red ring's icon will be displayed to start, but if the player has collected the panel for a weapon ring its icon will be visible in this part of the screen. If the player does not have any ammo for a weapon ring currently (or has no rings at all), the icon for it will be faded out. Otherwise, the amount of ammo the player has collected for a weapon ring will be displayed by its icon – if the ammo for a particular weapon is at its maximum limit, the amount will be displayed in yellow instead of white.
  • Icons for any Chaos Emeralds the player has collected in Match or CTF will be displayed in the bottom left of the screen (where the player's life icon would be in Single Player/Co-op).
  • In addition to the above, the HUD in CTF will also display icons for the red and blue CTF flags. These indicate the current status of both of the flags during the game – for instance, the flag icons as they normally are indicate that they are currently at their respective team bases. If one of the flags has been taken from its base by a player from the enemy team, the icon for it will be struck through to indicate this. Otherwise, if the flag has been dropped by a player after being taken from its base, the icon for it will display a timer to indicate how long it will remain in the level before automatically warping back to the base.
  • Tag's HUD additionally may display a timer as well as relevant text depending on the current phase of the game (as well as which team the displayed player is on): during the time the hiders have to find a place to hide from the "IT" player, this displays the time left to hide in seconds; if a time limit is set, the time left to the end of the game in seconds will replace this after the hiding timer has finished.
  • If playing in the Race gametype, an lap counter may also be displayed at the bottom right corner of the screen if the level played is a Circuit map.
  • In Emerald Hunt levels, an radar will be displayed at the bottom of the screen. This consists of a set of 3 emerald icons; each of these displays a color depending on the distance the player is from the hidden Chaos Emeralds within the level. When the emerald has been collected, the icon for the emerald will no longer display.
  • The Emblem Radar unlockable, when unlocked and enabled, has a similar function to the Emerald Hunt radar, but instead displays icons for all Emblems hidden in the level.

Special Stages

Old-style Special Stages display an additional three elements:

  • When starting the stage, a banner reading "Get x Rings!" is displayed in the center of the screen (x is the number of rings to be collected to complete the Special Stage).
  • The total ring count required for the Special Stage to be completed is displayed beneath the "RINGS" element.
  • The time left in the Special Stage is displayed in the bottom middle region of the screen.

For the HUD used in NiGHTS-style Special Stages, see the NiGHTS section below.

First-person mode

If the player is viewing the game through the first-person camera, regardless of the gametype/game mode, the HUD displayed is slightly modified to adjust to this: Characteristic of this form of the HUD is the addition of a crosshair in the center of the screen – the appearance of the crosshair may be adjusted or disabled in the Player Controls menus (Options → Setup Controls → Player 1/2 Controls → Crosshair) or through the crosshair console variable. Any power-ups the player has collected, such as shields, invincibility and speed sneakers, will be displayed through icons on this HUD, as the player cannot be used as visual indication for the power-ups.


The NiGHTS Game HUD in-game.

When a NiGHTS level is being played, the HUD displayed is completely different to the normal HUD: the top left corner elements are replaced with a ring counter displaying a ring animation, with an arrow pointing to an image of the Ideya Capture and a bar for its remaining health. The arrow will display red if the player's ring count is enough to destroy the Capsule with; when the Capsule has been destroyed, the arrow will stop animating and the Ideya Capture icon will no longer display. Score now displays in a big font at the top right corner of the screen.

Additional elements appear when playing as NiGHTS Super Sonic: The top middle of the screen displays a timer indicating the time left as Super Sonic in seconds. The lower left corner displays Super Sonic's Drill Dash meter, which indicates how much left the player can sustain the Drill Dash. The bottom middle of the screen meanwhile is a space reserved for displaying the Links the player has obtained so far, in the form of "n LINK" messages (b being the Link number).

When the stage is started, "Get x Rings!" is displayed in the center of the screen (x is the number of rings to be collected to destroy the Ideya Capture). If the player reached the Ideya Capture but only partially destroyed it, "Get x More Rings!" is displayed instead (x is the number of rings to collect to finish destroying the Ideya Capture). If in a NiGHTS-style Special Stage however, both of these messages will display "Spheres" instead of "Rings", as the player will be collecting blue spheres instead of rings to destoy the Ideya Capture in these.

When recording a replay in NiGHTS Mode, the time spent in the level since the start of the mare will also be displayed in the bottom right corner of the screen, providing an easy reference for obtaining a new time record in the level.

If the level is being played in the Race/Competition gametypes, the normal Score and Time elements will be displayed instead of the ring/capsule section of the NiGHTS HUD.

Rankings/Scores HUD

The Single Player Rankings/Scores HUD in-game.

The Rankings/Scores HUD is a secondary HUD that displays any overall statistics and information relevant to the gametype, as well as listing all players present when in multiplayer. This HUD can be accessed by pressing and holding down the Rankings/Scores key defined in the controls, which by default is the Tab key – the Rankings/Scores HUD will remain active on-screen for as long as this key is held down.

Single Player

In Single Player, this HUD displays the Special Stage Tokens, Chaos Emeralds, and Emblems collected at present by the player. The total number of Special Stage Tokens collected is represented by a token icon alongside the number of tokens. The Chaos Emeralds collected by the player are represented as icons representing each of the 7 Chaos Emeralds, which fills most of the screen in the form of a hexagon shape when complete. The total Emblems collected is displayed alongside an Emblem icon at the center of the screen.


In multiplayer gametypes, this HUD primarily displays the players currently present within the game itself (i.e not a spectator), along with the scores they have obtained so far or other statistics relevant to the gametype. The name of the gametype currently being played is also displayed in the bottom left corner. In most gametypes there will normally be only a single column of players; if there are more than 9 players the players list is split into two instead. However, in Team Match/CTF the list of players will be divided into their respective teams already. Note that no more than 20 players will be displayed at a time on-screen on this HUD.

The top area of the screen above the player listings is reserved for additional gametype-specific information:

  • In Cooperative, this area is reserved for displaying the emeralds collected in the game so far, in addition to the total score obtained by all players combined.
  • In Match/Tag/CTF, this area is reserved for displaying the point limit and/or time left in the level, if a point limit or time limit has been set.
  • Additionally for Team Match/CTF, the score obtained by both teams is displayed at the center of this area besides the team icons.
  • In Circuit levels for Race, this area is reserved for displaying the total number of laps set for the level.

In gametypes with spectators, the names of any spectators in-game will be displayed scrolling along the bottom of the screen, below the lists of players present in-game.

Record Attack/NiGHTS Mode

When watching a Record Attack/NiGHTS Mode replay, the Rankings/Scores HUD will display the score, time and rings obtained through the replay (rings is omitted for NiGHTS Mode replays).

HUD item modification

SOC allows the position of the HUD items to be modified. This is useful when certain graphics that are used in the HUD have been replaced in a modification. The HUD can then be re-arranged to accommodate those graphics.

The code for changing the position of a HUD item follows the following syntax:

  • HUDITEM name is the header of each block. name sets the name of the HUD item to be changed. Refer to the table below for the names to be used.
  • X and Y are the X-axis/Y-axis coordinates of the HUD item on the screen , measured in pixels. The coordinates 0,0 are the upper left corner of the screen. Note that positioning is based on a 320×200 resolution base screen. If the HUD Item's X coordinate is 10, it will be placed 10 pixels to the right of the upper left corner on a 320×200 screen, and if the pictures Y coordinate is 10, it will be placed 10 pixels below the upper left corner on a 320×200 screen. For larger resolutions, the sizes and positions of the HUD items are adjusted to be proportionate. 640×400, for example, has twice the width and height of 320×200, so both the X and Y position are automatically doubled to accommodate the bigger resolution.


X = 16
Y = 166

See the section below for a full list of HUD items whose positions can be modified this way.

List of HUD items

This is a list of the 30 HUD items that can modified by SOC or Lua in SRB2, along with their default coordinates. Note that some HUD items' coordinates differ in splitscreen mode; these are given here as separate HUD items, so they can be modified without affecting the coordinates used otherwise.

HUD item number HUD item name Description X position Y position Graphic
0 HUD_LIVESNAME Name of the playing character as displayed above the life icon 34 176 LIVESNAME.png
1 HUD_LIVESPIC Life icon of the playing character 16 176 LIVSONIC.png
2 HUD_LIVESNUM Number of lives left 74 184 LIVESNUM.png
3 HUD_LIVESX The "x" between the life icon and the number of lives 38 186 STLIVEX.png
5 HUD_RINGSSPLIT "RINGS" (Splitscreen mode) 220 10
6 HUD_RINGSNUM Amount of rings 112 42 RINGSNUM.png
7 HUD_RINGSNUMSPLIT Amount of rings (Splitscreen mode) 288 10
9 HUD_SCORENUM Amount of points 128 10 RINGSNUM.png
10 HUD_TIME "TIME" 17 26 SBOTIME.png
11 HUD_TIMESPLIT "TIME" (Splitscreen mode) 136 10
12 HUD_MINUTES Amount of minutes 88 26 RINGSNUM.png
13 HUD_MINUTESSPLIT Amount of minutes (Splitscreen mode) 188 10
14 HUD_TIMECOLON Colon graphic between minutes and seconds 88 26 SBOCOLON.png
15 HUD_TIMECOLONSPLIT Colon graphic between minutes and seconds (Splitscreen mode) 188 10
16 HUD_SECONDS Amount of seconds 112 26 RINGSNUM.png
17 HUD_SECONDSSPLIT Amount of seconds (Splitscreen mode) 212 10
18 HUD_TIMETICCOLON Period graphic between seconds and tics 112 26 STCFN046.png
19 HUD_TICS Amount of tics 136 26 RINGSNUM.png
20 HUD_SS_TOTALRINGS Special Stage – Amount of rings required 112 56 RINGSNUM.png
21 HUD_SS_TOTALRINGS_SPLIT Special Stage – Amount of rings required (Splitscreen mode) 288 40
22 HUD_GETRINGS Special Stage – "Get x Rings" 110 93 GETALL.png
23 HUD_GETRINGSNUM Special Stage – Number of rings required as displayed in "Get x Rings" 160 93 RINGSNUM.png
24 HUD_TIMELEFT Special Stage – "Time Left" 124 160 TIMELEFT.png
25 HUD_TIMELEFTNUM Special Stage – Amount of time left 168 176 RINGSNUM.png
26 HUD_TIMEUP Special Stage – "Time Up" 130 93 TIMEUP.png
27 HUD_HUNTPICS Emerald Hunt radar 152 168 HOMING1.png
28 HUD_GRAVBOOTSICO Gravity Boots power-up HUD icon 152 24 GBTVB0.png
29 HUD_LAP Race – "Lap" 240 160 LAPTEXT.png

See also

  Sonic Object Configuration [view]
General ClearMainCfg
Objects ObjectStateSoundFreeslot
Unlockable content EmblemExtraEmblemUnlockableConditionSet
Miscellaneous WipesCharacterLevelCutscene / SceneHudItem
Related links ActionsConstantsCustom Object tutorial