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.
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
ringslingercheat 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.
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.
1st person mode
If the player is viewing the game through the 1st person camera regardless of any 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.
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.
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.
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
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 nameis 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.
Yare 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.
HUDITEM HUD_LIVESNAME 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|
||Name of the playing character as displayed above the life icon||34||176|
||Life icon of the playing character||16||176|
||Number of lives left||74||184|
||The "x" between the life icon and the number of lives||38||186|
||"RINGS" (Splitscreen mode)||220||10|
||Amount of rings||112||42|
||Amount of rings (Splitscreen mode)||288||10|
||Amount of points||128||10|
||"TIME" (Splitscreen mode)||136||10|
||Amount of minutes||88||26|
||Amount of minutes (Splitscreen mode)||188||10|
||Colon graphic between minutes and seconds||88||26|
||Colon graphic between minutes and seconds (Splitscreen mode)||188||10|
||Amount of seconds||112||26|
||Amount of seconds (Splitscreen mode)||212||10|
||Period graphic between seconds and tics||112||26|
||Amount of tics||136||26|
||Special Stage – Amount of rings required||112||56|
||Special Stage – Amount of rings required (Splitscreen mode)||288||40|
||Special Stage – "Get x Rings"||110||93|
||Special Stage – Number of rings required as displayed in "Get x Rings"||160||93|
||Special Stage – "Time Left"||124||160|
||Special Stage – Amount of time left||168||176|
||Special Stage – "Time Up"||130||93|
||Emerald Hunt radar||152||168|
||Gravity Boots power-up HUD icon||152||24|
||Race – "Lap"||240||160|
|Sonic Object Configuration||[view]|
|Unlockable content|| |
|Related links||Actions • Constants • Custom Object tutorial|