Hi everyone...
Im try to create a HUD that follows the room view.
The view follows the player.
But when updating the coordinates of my HUD to the view its not all instantaneous... when the view gets too fast following the player
the HUDs keep staying behind... when only when the view stops the huds reach the final destination.
Any ideas?
Are views faster than steps?
Started by yvesnadjarian, Jun 09 2012 07:26 PM
6 replies to this topic
#1
Posted 09 June 2012 - 07:26 PM
#2
Posted 09 June 2012 - 08:09 PM
Yes, there is a time difference between view(draw event) and step event
maybe try moving the HUD code to the draw event
maybe try moving the HUD code to the draw event
#3
Posted 09 June 2012 - 08:36 PM
Yep... I´ve done this...
for android I´ve created a virtualkey in the same place of the sprite (my HUD has a button)
but how can I make it for windows?
for android I´ve created a virtualkey in the same place of the sprite (my HUD has a button)
but how can I make it for windows?
#4
Posted 09 June 2012 - 08:37 PM
This happens because (I assume) you use a HUD object that changes it's coordinates to the view's coordinates every step. First off, if I remember correctly that should fix if you put your coordination code in the End Step event, however I'd recommend going for a different approach. Instead of having different objects for your HUD, try to put it in a general control object or something of the type where you control stuff "offscreen" (such as statistics, settings, etc.) and have that object draw the HUD in it's Draw event whenever a player is present within the room (check with if instance_exists(yourplayerobjectnamehere){} ). In the long run it helps to have as less objects (in the room) as possible.
Edit: Don't forget to set the controller's depth to something very low (-1000000 is the depth of standart GM particle effects when they are set to appear "above all")
Edit: Don't forget to set the controller's depth to something very low (-1000000 is the depth of standart GM particle effects when they are set to appear "above all")
Edited by Nightelf Productions, 09 June 2012 - 08:44 PM.
#5
Posted 09 June 2012 - 08:58 PM
Put it in your END STEP event.
#6
Posted 09 June 2012 - 10:45 PM
Thank you all!!
#7
Posted 10 June 2012 - 12:33 AM
Also, you don't have to update the HUD's position if you just draw it at (view_xview,view_yview)
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











