Jump to content

flicker if created then moved


InsaneHero
 Share

Recommended Posts

If I do this:

 

h = game.add.sprite(0,0, "hospital");
h.x = 49900 - h.width;
h.y = findGround(h.x + h.width) - h.height + hospitalOffset * 0.5;
 
The sprite will display at 0,0 (top-left of the screen... ignoring the camera location) as a brief flicker before moving to the correct location.
I'm guessing this is down to some precalculated transforms which aren't updated by the x,y setters.
What function should I call to recalculate the transform to prevent this flicker?
 
(Notice that I can't position it directly because I need the width and height of the sprite which aren't available until after it's been created)
 
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...