I'm currently doing this... it works fine on layouts that don't scroll. But my gameplay layout scrolls with the player and the mouse is constantly moving even though the player is not touching it. So it is not auto-hiding.
Any suggestions?
Huh, I was doing exactly the same in my game just a few hours ago!
You need to check Mouse.X("HUD") and Mouse.Y("HUD") , where HUD is a layer with zero parallax.
Develop games in your browser. Powerful, performant & highly capable.
dop2000 wow, I didn't know you can reference specific layers with the X/Y methods? but now the debug numbers make sense! I was seeing crazy number differences between MousePrevX and Mouse.X
THANKS!
You can also use Mouse.AbsoluteX and Mouse.AbsoluteY to get coordinates relative to the game window (or canvas) and not the layout.
Magistross oh excellent!
also note the mouse pointer has to be on a parallax 0,0 layer as well.
I have my "HUD" and a layer above that called "mouse layer" since I always want my mouse on top of everything, but I had to have it be full scroll mode when I was using plain old mouse.x/y
Thanks ALL!