From ZDoom Wiki
Jump to navigation Jump to search

DrawNumber <size>, <font>, <color>, <value>, [flags, ...,] <x>, <y> [, <fontspacing>] [, <low_color>, <low_value> [, <high_color>, <high_value>]]
Draws a number at the specified location. The first argument specifies the size of the number in digits (Doom's statusbar is set to size 3, for three-digit numbers). The font must be a ZDoom font or defined in FONTDEFS. The font will be translated to color, which can be a color defined in TEXTCOLO. Fontspacing will put the specified amount of pixels between each character (default is 0). If a low_color is provided, then that color will be used if the value is less than or equal to low_value. If a high_color} is provided then that color will be used when the value is greater than or equal to high_value.

For value, you can either supply a constant number, an inventory item, or one of the following:

The player's current health level.
Amount of accuracy upgrades received.
The amount of armor the player is currently carrying.
Draws the Hexen armor class of the player.
The amount of primary ammo for the current weapon.
The amount of secondary ammo for the current weapon.
The number of frags the player has achieved.
The number of keys picked up.
The number of monsters that have been killed.
The total number of monsters in the map.
Number of items picked up.
Total number of items in the map.
Indicates the percentage of damage absorbed by armor.
Number of secrets found.
Current player score (see APROP_Score and ScoreItem)
Amount of stamina upgrades received.
Total number of secrets in the map.
The player's remaining air supply (in seconds) when underwater.
Ammo <AmmoType>
The amount of the specified ammo the player is holding.
AmmoCapacity <AmmoType>
The maximum amount of the specified ammo the player can hold.
The maximum amount of primary ammo the player can hold for the current weapon.
The maximum amount of secondary ammo the player can hold for the current weapon.
PowerupTime <PowerupGiver>
Displays the amount of time left for a given powerup.
GlobalVar <num>
Prints the specified global variable in acs.
GlobalArray <num>
Prints the value in a global array with the index of the playernumber.
IntCvar <num>
Prints the cvar specified. Can be a server/user int or bool.

Flags are:

Changes the alignment of the string.
Fills the number up to size with zeros. If the number is negative the negative sign will take the first digit's position and the size will be changed accordingly.
Only draws the number if the value is not zero.
drawshadow[(<xOffset>, <yOffset>)]
Draws a translucent shadow effect under the number. If offsets are not given, it defaults to two pixels to the right and two pixels down.
Interpolates the value drawn.
Draws the lower digits of the number instead of capping.
prefix(value, pad)
Prefixes the number with the specified strings. The value part can be anything that drawstring accepts, but the pad must be a string. When not using a constant for the value part drawstring's caching functionality is disabled.

Also keep in mind that for DrawNumber and DrawString, text will be right-justified, so coordinates specified should be the rightmost portion and not the leftmost like with images.