[Solved] How do I get mouse location in JavaScript Event

I’d like to get and print mouse location by using console.log.
so I tried like the following.
But I didn’t find any method which can get current mouse location.

(function(runtimeScene, objects /Monster/) {


var obj = objects[0];
console.log('obj_x: ’ + obj.getX() + ’ mouse_x: ’ + ???);

})(runtimeScene, objects /Monster/);

I’ve solved by myself using search :smiley:

console.log('ox: ’ + obj.getX() + ’ mx: ’ + runtimeScene.getGame().getInputManager().getMouseX());

1 Like