I’m making a 2D game on cocos 3.7
How can I get the position of the mouse when I move in the chessboard like the image?
I used event.getLocation() to get the location, but it only returns the world location.
Thank you.
I’m making a 2D game on cocos 3.7
How can I get the position of the mouse when I move in the chessboard like the image?
I used event.getLocation() to get the location, but it only returns the world location.
Thank you.
I don’t understand what you want to do with mouse location.
i want to set position of chess seleted follow my mouse
You can use node.setWorldPosition(mouseLocation)
, then the chess piece will follow.