Jump to content

mouse coordinates distorted after going fullscreen


Recommended Posts

Hey, i've recently tried to add fullscreen to my game..


I've noticed when using either of these scaling modes i have problems with my pointer position:


    game.scale.fullScreenScaleMode = Phaser.ScaleManager.EXACT_FIT;
    game.scale.fullScreenScaleMode = Phaser.ScaleManager.NO_SCALE;
After changing to fullscreen, my weapons no longer shoot bullets at the point where I see my pointer in, but to slightly distorted x/y coordinates, which is weird because I use the moveToPointercommand to fire bullets.
It's like the actual pointer that i see is in a slightly different location and not where the game thinks the pointer is.
Exact_fit causes most distortion.
No_scale causes a little less.
Show_all gets rid of the distortion problems but leaves some black spaces around the game window.
Everything else, including coordinates, seems to work well while in fullscreen. :/
So basically, does anyone have any idea how to fix this?
The cursor I see and the place where the game thinks the cursor is are not the same while in fullscreen.
It seems specifically that the X-axis is distorted, not Y. If I click buttons in fullscreen I need to aim the pointer left from the actual visible button to hit it.
Link to comment
Share on other sites

  • 1 year later...

  • Recently Browsing   0 members

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