I have been trying to add a hud in my game that spans the width of the current view and is below my character. So far I have easily been able to make it below my character but I don't know how to make it stay in the view. If anyone has any methods or examples, please share.
Drawing a Heads Up Display
Started by nathantcash, May 23 2012 10:57 PM
2 replies to this topic
#1
Posted 23 May 2012 - 10:57 PM
#3
Posted 23 May 2012 - 11:59 PM
When drawing relative to an object, you use it's coordinates, or built-in variables: x , y . When drawing relative to a VIEW, each view also has it's own coordinates: view_xview[#] , view_yview[#].
The # should be replaced with the number of the view, and these coordinates should return the top left corner of the view. When you draw a hud, you should use the draw event (don't re-position in the step event, as it makes things lag behind the view a little during movement) and draw functions such as draw_sprite() or
to draw the hud. Simply place in the variables given above, plus the number of pixels right or down of that spot that you wish to draw that HUD item.
Hope this helps.
The # should be replaced with the number of the view, and these coordinates should return the top left corner of the view. When you draw a hud, you should use the draw event (don't re-position in the step event, as it makes things lag behind the view a little during movement) and draw functions such as draw_sprite() or
Hope this helps.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











