Does anybody know a built-in or other function to convert the clicked
(stage) coordinate to a plane coordinate?
(2D only needed)
For instance if plane.width == stage.width, and I click on stage
coordinate 100,100, it should return 100,100.
But then if camera.zoom is increased, and I click on the same
projected stage coordinate (say 50,50), it should return 100,100 also.
To elaborate a little I load a jpeg (backgroundLayer) onto a plane
(backgroundPlane) and make it fit the stage window:
This works for initial zoom and also for different size images, so
when I click on the lower right corner of the square (100,100), it
But when I zoom in:
The green square grows and moves to the left and up, consequently I
have to click something like 50,50 to click on the same lower right
I'm sure you get the picture :) The coordinates are then wrong,
because my function obviously is missing something.
I'm working on another function but I thought surely someone must have
already solved this?