Sign in to follow this  
shinning91

Multitouch disable

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

Share this post


Link to post
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);
},*/

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.