realX realY don't working at Craftyjs

35 views
Skip to first unread message

Михаил Суходаев

unread,
Dec 11, 2018, 3:12:54 AM12/11/18
to Crafty
Crafty.addEvent(this, Crafty.stage.elem, "mousedown", function(e) {
console
.log(e.realX, e.realY);//undefined
});

When clicking on the stage return undefined. But Previously worked.

Fade

unread,
Dec 11, 2018, 4:59:05 AM12/11/18
to Crafty
Does this help you out? http://jsfiddle.net/yoqh6fsx/

Михаил Суходаев

unread,
Dec 11, 2018, 10:09:32 AM12/11/18
to Crafty
It does not work in the latest version. craftyjs 0.9.0

вторник, 11 декабря 2018 г., 12:59:05 UTC+3 пользователь Fade написал:

Михаил Суходаев

unread,
Dec 11, 2018, 10:12:15 AM12/11/18
to Crafty


вторник, 11 декабря 2018 г., 18:09:32 UTC+3 пользователь Михаил Суходаев написал:

starwed

unread,
Dec 12, 2018, 9:07:41 PM12/12/18
to Crafty
Crafty.addEvent binds directly to the DOM event, and the DOM event does not have realX and realY properties.

You probably want to bind to a Crafty event on the Mouse system instead: http://craftyjs.com/api/MouseSystem.html
Reply all
Reply to author
Forward
0 new messages