Hello,
Via a script I put the coordinates of the mouse in two variables. Unfortunately they are based on the position on the screen. I wish to be able to obtain them in coordinates of the world.
My node tree:
MouseDetecor.js:
this.node.on(cc.Node.EventType.MOUSE_MOVE, function(event) {
var mousePos = this.node.getParent().convertToWorldSpace(event.getLocation());
this.mousex = mousePos.x;
this.mousey = mousePos.y;
}, this);
Unfortunately, the result is too big.
What is the solution ?
Thank you
Ps: I hope my message is understandable.