DrawString

From ZDoom Wiki
Jump to navigation Jump to search

DrawString <font>, <translation>, <string>, <x>, <y> [, <spacing> [, <flags>]]
Draws the string at the specified coordinates. Like DrawNumber, the coordinates specify the top right hand corner of the string.

In addition to a string constant, the following are also accepted for the value of string:

levelname
Prints the name of the current level.
levellump
Prints the lump name of the current level.
skillname
Prints the name of the current skill level.
playerclass
Prints the display name of the player's class.
playername
Prints the name of the current player.
ammo1tag
Prints the tag of the primary ammo.
ammo2tag
Prints the tag of the secondary ammo.
weapontag
Prints the tag of the current weapon.
inventorytag
Prints the tag of the current inventory item.
globalvar <num>
Prints the string referenced by the global variable.
globalarray <num>
Prints the string referenced by array[playernumber()].
time
Prints the amount of time spent on the level.
logtext
Prints the current log message.

Flags are:

alignment({left|center|right})
Changes the alignment of the string.
drawshadow[(<xOffset>, <yOffset>)]
Will also draw a translucent string.
linebreaks(<size>)
Will split the text up into multiple lines if it exceeds the specified size. Note that this does not take into account font spacings.