Hello everybody,
I have an issue and I cannot figure it out how to solve it.
I have an object ( an image with a little circle 10x10 px) with an onMouseMove function to set it's position to the mouse position an i setCameraTarget on this circle, so when the mouse is moved on the camera follows it. I hide the cursor in the css file so I can see the mouse position through the circle movement.
On the scene I have some objects composed by a single sprite, which was drawToImage in the init() function. When the scene is loaded, the object imageData call the draws for an onClick function. So when you click on each of this objects a sprite ( a black point img) is added to the clicked object, on the clicked spot.
This is working perfectly (thanks to Gio and Stephen help) when camera is not moving. When the camera target is set on the circle object and is moving around the hit is no more accurate. I mean that the black point goes always on the 0 position(the middle of the screen) and the circle(the mouse img) is not hitting the objects with accuracy (have a kind of offset).
I was thinking that camera movement is not affecting at all the scene objects position that's why I imagined that this can work.
The movement is ok but I cannot fix the accuracy of the mouse click on the objects.
If you can give me an advice will be hardly appreciated.
Thank you,
Leissa