[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/) {

runtimeScene.setBackgroundColor(100,100,240);

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