Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17076

Get mouse position (without event?)

$
0
0

@oranjoose wrote:

Is there a way to get the mouse location without setting up an event?

I would do a mousemove event on a script on the Canvas with something like:

this.node.on("mousemove", function (event) { console.log(event.getLocation().x) });

But with this, the event only happens when the mouse is moving, and it doesn't occur when the mouse is overlapping a different node with mousemove, due to how the event propagates.

Is there not a way to simply grab the mouse position in an update function (for example)?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 17076

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>