Jump to content

Multitouch disable


shinning91
 Share

Recommended Posts

Hi guys. I am currently having a problem trying to disable multitouch function on IPad. I tried using 

this.game.input.maxPointers = 1;

but it doesn't seems to limit number of active pointers as I still able to multitouch. Are there any other way to disable it?

Edited by shinning91
Better wording
Link to comment
Share on other sites

game.input.addPointer(); is 1.)

 

If you do:

game.input.addPointer();

game.input.addPointer();

game.input.addPointer();

 

This are 3 Multi-Touches limited to 3 :P

Example in here: https://phaser.io/examples/v2/input/multi-touch

I dont know your methode & I didn't see this for ever. :-P

 

#ImPhaserNoobCorrectMeIfImIncorrect

 

EDIT: So If you want to disable it, just comment it out with /* */.

 

e. g : 

/*trap: function (sprite, Floor) {
    var tween = game.add.tween(Floor).to({kill: true}, 1000, Phaser.Easing.Linear.None, true);
    tween.onComplete.add(function () {
        Floor.destroy();
    });
},

checkOverlap: function (sprite, Floor) {
    var boundsA = sprite.getBounds();
    var boundsB = Floor.getBounds();

    return Phaser.Rectangle.intersects(boundsA, boundsB);
},*/
Link to comment
Share on other sites

On 1/21/2017 at 4:54 PM, samme said:

What do you mean — you do what and what happens?

I wanted to disable multitouch function for my game. By default, Phaser starts with two Pointers so I tried using 

this.game.input.maxPointers = 1;

which supposing limit the number of active pointers based on the documentation in Phaser

    /**
    * @property {integer} maxPointers - The maximum number of Pointers allowed to be active at any one time. A value of -1 is only limited by the total number of pointers. For lots of games it's useful to set this to 1.
    * @default -1 (Limited by total pointers.)
    */
    this.maxPointers = -1;

But it doesn't seems working as I still able to multitouch. Are they any other way to disable it multitouch function?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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