Jump to content

Get mouse position outside game world.


scheffgames
 Share

Recommended Posts

Hi! So I want to get mouse position even when it's outside canvas/game-world. The x,y properties stop updating when the mouse it's outside game world. Also tried worldX/worldY, clientX/clientY, screenX/screenY - to no succes. The only solution seems to write my own mousehandler (with document.onmousemove) but I wanted to know if I can do it in Phaser directly. 

I've used game.input.activePointer to check for above properties.

Thanks!

Link to comment
Share on other sites

I'd imagine this isn't really in Phaser scope, it should only know about the main element (can you pass it an element? I'd imagine it sets up with its own canvas element if you don't/can't supply one) and inputs should really be scoped to that element rather than polluting document.

So I reckon you'd probably have to do this yourself unless you could pass `input` an element it should attach certain events to.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...