Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Drag Map and Sprite issue — Gideros Forum

Drag Map and Sprite issue

zakkwyldezakkwylde Member
edited January 2012 in General questions
Hi,

I have a little issue that I could use some assistance with (sorry at work and do not have code to show).

I have loaded a tile map and can drag around the screen and restrict to on drap to map area.
I have then add a player sprite of the map and can drag map and the player stays put in relation to the map.

Problem is that this only works if I scroll slowly, if I do a quick drag and the map hit it's 'zero' position the player sprite moves. I know it has to do with the drag values still being use in the mousemove event I just cannot see the solution.

Thanks


Comments

  • Difficult to know without seeing the code - are you doing
    event:stopPropagation()
    to prevent other sprites being affected?
  • Let me ask in a different way.

    Could someone provide an example that show how to keep a sprite in it's relevant position if the background scrolls. eg it follow the direction of the background by the same amount of pixels.





  • I know it isn't an example on how to do it, but I would make the sprite a child of the map. This way it SHOULD move with it.
  • That works. Thanks Mike.

    As usual I was over thinking the solution!!!! again!!!
    Gideros rocks!

    Likes: gorkem

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.