Jump to content

Phaser not detecting mouse point properly after canvas show


Lomaz
 Share

Recommended Posts

Hello! So I've had this problem for a while, basically for about 70 frames after the canvas is shown the mouse point as around {x: 344, y: 614.5} before snapping it to its proper location, regardless, this is really a larger problem then it sounds like.. any way to have it correctly detect the position sooner? not sure how to fix this!

 

 

One of the first lines on update is:

 

var pointer = this.game.input.activePointer;

 

 

Thanks!

Link to comment
Share on other sites

Found an oddly easy fix for it! nevermind!

EDIT - Still broken =/

 

00] 
before
[2:00] 
if(($('#main-mapContainer').hasClass('hiddenMap') != true)){
                if($('#main-mapContainer').is(":focus")){
                    $('#main-mapContainer').blur();
                }
                player.body.setZeroVelocity();
                active = true;
                if(reload == false && (!$("#chatInput").is(":focus"))){
                    ping++;
                    player.body.mass = 100;
                    var pointer = this.game.input.activePointer;
                    pointer.dirty = true;
[2:00] 
after
[2:00] 
var pointer = this.game.input.activePointer;
            if(($('#main-mapContainer').hasClass('hiddenMap') != true)){
                if($('#main-mapContainer').is(":focus")){
                    $('#main-mapContainer').blur();
                }
                player.body.setZeroVelocity();
                active = true;
                if(reload == false && (!$("#chatInput").is(":focus"))){
                    ping++;
                    player.body.mass = 100;
                    pointer.dirty = true;

 

 

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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