DrawBar

From ZDoom Wiki
Jump to navigation Jump to search

DrawBar <fgimage>, <bgimage>, <number>, {horizontal|vertical}, [flags, ..., ] <x>, <y> [, <border>]

Error.gif
Warning: The border property is here so that the bar graphics from Hexen can be used as-is. Using this property may cause numerous undesired side effects due the fact that it renders the foreground before the background. If you are using a background image there is no reason you should ever have to use this property

Draws a bar using a truncated form of fgimage over bgimage (or black if nullimage is used). Both fgimage and bgimage must be the same size. Number can be any of the values from DrawNumber with the exception of Accuracy, ArmorClass, Keys, Monsters, TotalItems, Score, Stamina, TotalSecrets, AmmoCapacity, Ammo1Capacity, Ammo2Capacity, GlobalVar, GlobalArray and IntCvar.

If health or armor is used, you can optionally specify the maximum amount the player can hold:

{health|armor} (<max>)
If provided with a number, this will be used for the maximum value.
{health|armor} (<actorname>)
Indicates an Inventory item which will represent the maximum quantity. The current amount in the player's inventory is used, not the item's MaxAmount, so you must make sure to give them the item in the correct amount. This method has the advantage of allowing the maximum value to change dynamically.
{health|armor} <actorname>
Behaves identically to the above, but it is recommended to use the new syntax.

Flags are as follows:

reverse
Reverses the direction of the bar. The default direction for a horizontal bar is to left to right; and for vertical it is bottom to top as in Hexen.
interpolate(<speed>)
Interpolates the value drawn.

If border is supplied then the specified amount of pixels on each side from the foreground will always be drawn.