in PlayN, if I have a root layer scaled (eg, scale of 2.0), when I detect a mouse point on screen, 10,10 and draw it point on screen, the point shown is twice the distance as I saw on the OS’s mouse point.
What I want is the object I drag move at the exact same distance as I move my OS mouse pointer.
Is there a coordinate map function that map my mouse input X/Y to my logical scaled coordinate system?
Thanks.
You have two choices. You can register your
Pointer.Listeneron the root layer and usePointer.Event.localX/Yto obtain the mouse coordinate in the layer’s coordinate system:Or you can register a global
Pointer.Listenerand useLayer.Utilto translate the points manually: