Jump to content

Input position vs position in group


Vizcur
 Share

Recommended Posts

I have a problem when I get the position of Input (click, touch, etc...)  in a event and then try to put a sprite in the same position. This happen when the game is in (100%, 100%) screen mode, i.e , the sprites in a scene are responsive to the screen size.

In this case, the position of the sprite is "shifted" a space versus the mouse click, the problem is: this "shift" is not constant, and the image is not exactly in the sprite.x(y) position.

More details: I have a image 800 x 600 per example in a sprite, this sprite is responsive to the touch or click event, when this happen, I put a new sprite in the position of the click, but... well, the thing I said at the beginning.

 

Thanks.

Link to comment
Share on other sites

Well, I solved my problem, just  I used the function :

 

this.game.input.getLocalPosition(container, pointer, new pointer);

 

And this give me the relative position to some container :P. I expect this can be usefull for somebody.

 

Thanks anyway :).

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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