Skip to main content
Participant
November 4, 2016
Question

Mouse coordinates issue

  • November 4, 2016
  • 1 reply
  • 161 views

I'm trying to get the object under my mouse, which at first, worked. I was using:


var atMouse =  canvasTimeline.getObjectUnderPoint(e.stageX, e.stageY);

That worked until I embedded the canvas in HTML. It's in a Div that resizes it to 70% of the page's width. This seems to completely destroy the mouse coordinates system and any tutorial/approach I can find online.

I've tried systems using offsetX/offsetY, I've tried clientX,clientY, I think one of them was screenX,screenY, I've tried conversions that are supposed to convert page space to canvas space and... It fails at every turn.

What do I need to do, to get this working?

This topic has been closed for replies.

1 reply

UDESCO
Participating Frequently
November 5, 2016

Can you share your files or hosted project somewhere to help us look into the issue. Also, are you using a Retina Mac/HiDPI display?