Digitalnumber: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(8 intermediate revisions by 6 users not shown)
Line 1: Line 1:
digitalnumber <tilenum> <x> <y> <number> <shade> <pal> <orientation> <x1> <y1> <x2> <y2>
 
'''digitalnumber''' <tilenum> <x> <y> <number> <shade> <pal> <[[orientation]]> <x1> <y1> <x2> <y2><br>
'''digitalnumberz''' <tilenum> <x> <y> <number> <shade> <pal> <[[orientation]]> <x1> <y1> <x2> <y2> <digitalscale>


Prints a number to the screen using a function similar to that which prints the health and ammo counters in the HUD.   
Prints a number to the screen using a function similar to that which prints the health and ammo counters in the HUD.   


<tilenum> is the first tile of a sequence of numbers ordered from 0-9. See tile 2472 for an example.
<tilenum> is the first tile of a sequence of numbers ordered from 0-9. Useful values for tilenum in the original game art are '''DIGITALNUM''' (full status bar health/ammo/armor values), '''2837''' (bluefont), '''2930''' (redfont), '''2992''' (grayfont), '''THREEBYFIVE''' (full status bar detailed weapon values), and '''3087''' (minifont).


<x> and <y> are on-screen coordinates.
<x> X coordinate, ranged 0-320
 
<y> Y coordinate, ranged 0-200


<number> is the [[gamevar]] to print the value from.  
<number> is the [[gamevar]] to print the value from.  
Line 11: Line 15:
<shade> and <pal> are obviously shade and palette.   
<shade> and <pal> are obviously shade and palette.   


<orientation> is.. hard to explainPlay with values like 16 and 26.
<[[orientation]]> Controls the way the sprite is drawn (see entry). Note: It is recommended that you always include bit 16 so that the numerals will be placed correctly.
 
<x1>, <y1>, <x2> and <y2> are boundaries on the screen that define where the number may be drawn. The gamevars xdim and ydim will hold the current screen resolution.


<x1>, <y1>, <x2> and <y2> are boundaries on the screen that define where the number may be drawn.
<digitalscale> is the size of the text on screen. 65536 is normal size, 32768 is half-size and 131072 is double-size.


Example code:
Example code:


<pre>
setvar x 300
setvar x 300
setvar y 10
setvar y 10
setvar shade 0
setvar shade 0
setvar pal 0
setvar pal 0
setvar tilenum DIGITALNUM
setvar tilenum DIGITALNUM
setvar orientation 26
setvar orientation 26
getactor[THISACTOR].extra TEMP
getactor[THISACTOR].extra TEMP
digitalnumber tilenum x y TEMP shade pal orientation ZERO ZERO xdim ydim
digitalnumber tilenum x y TEMP shade pal orientation ZERO ZERO xdim ydim
</pre>


Please note that as with [[gametext]], [[minitext]] and friends, digitalnumber only works during [[events]].
Please note that as with [[gametext]], [[minitext]] and friends, digitalnumber only works during screen drawing [[events]].


[[Category:EDuke32 specific commands]]
[[Category:Screen drawing commands]]
[[Category:Screen drawing commands]]

Latest revision as of 20:53, 15 January 2023

digitalnumber <tilenum> <x> <y> <number> <shade> <pal> <orientation> <x1> <y1> <x2> <y2>
digitalnumberz <tilenum> <x> <y> <number> <shade> <pal> <orientation> <x1> <y1> <x2> <y2> <digitalscale>

Prints a number to the screen using a function similar to that which prints the health and ammo counters in the HUD.

<tilenum> is the first tile of a sequence of numbers ordered from 0-9. Useful values for tilenum in the original game art are DIGITALNUM (full status bar health/ammo/armor values), 2837 (bluefont), 2930 (redfont), 2992 (grayfont), THREEBYFIVE (full status bar detailed weapon values), and 3087 (minifont).

<x> X coordinate, ranged 0-320

<y> Y coordinate, ranged 0-200

<number> is the gamevar to print the value from.

<shade> and <pal> are obviously shade and palette.

<orientation> Controls the way the sprite is drawn (see entry). Note: It is recommended that you always include bit 16 so that the numerals will be placed correctly.

<x1>, <y1>, <x2> and <y2> are boundaries on the screen that define where the number may be drawn. The gamevars xdim and ydim will hold the current screen resolution.

<digitalscale> is the size of the text on screen. 65536 is normal size, 32768 is half-size and 131072 is double-size.

Example code:

setvar x 300
setvar y 10
setvar shade 0
setvar pal 0
setvar tilenum DIGITALNUM
setvar orientation 26
getactor[THISACTOR].extra TEMP
digitalnumber tilenum x y TEMP shade pal orientation ZERO ZERO xdim ydim

Please note that as with gametext, minitext and friends, digitalnumber only works during screen drawing events.