How to use a Sprite-Based Hud with scrolling games (4.5.9)

SciNEStist

Well-known member
You would want to place a DrawSpriteHud line of code that shows the sprite hud in a script that runs every frame, like "sprite pre-draw"

DrawSpriteHud arg0, arg1, arg2, arg3, arg4, arg5, arg6
; arg0 = starting position in pixels, x
; arg1 = starting position in pixels, y
; arg2 = sprite to draw, CONTAINER
; arg3 = MAX
; arg4 = sprite to draw, FILLED
; arg5 = variable.
; arg6 = attribute

most of these are self explanatory, but lets look at it deeper:

;arg0 = starting position in pixels horizontally starting from the left, this will be the top left corner . the higher the number, the further right it will be
; arg1 = starting position in pixels vertically starting from the top. the higher the number the lower it will be
; arg2 = sprite to draw if you have an empty spot. the sprite number starts in the top left of the game objects sprite sheet, counting left then down.
; arg3 = MAX the maximum amount of what you are displaying. eg, if max health or ammo is 6, then this should be 6
; arg4 = sprite to draw to indicate a filled spot. ( a bullet, a full health heart, etc)
; arg5 = the argument you are displaying (myHealth, myAmmo, etc)
; arg6 = attribute. this is the most complicated part see below:

Code:
76543210
||||||||
||||||++- Monster palette (00, 01, 10, 11)
|||+++--- Unimplemented
||+------ Priority (0: in front of background; 1: behind background)
|+------- Horizontal flip (0: off, 1: on)
+-------- Vertical flip (0: off, 1: on)
 
Last edited:

nes-lover

New member
Ah okay. After a bit more file browsing and poking around, I was able to find out how to do it. Thanks for the help!
 
Top Bottom