Jump to content

Minor Issue with Phaser examples


Recommended Posts

Oohhh I can help you :D this was a one of my first reports/requests long ago. :)


So what you have to do is to tell phaser to stop the event from propagating up to the browser.






And example how i use it: in function preload() {...}

        var arPreventedKeys = [            Phaser.Keyboard.SPACEBAR,            ,Phaser.Keyboard.UP            ,Phaser.Keyboard.DOWN            ,Phaser.Keyboard.LEFT            ,Phaser.Keyboard.RIGHT        ];        game.input.keyboard.addKeyCapture(arPreventedKeys);



I just saw that your complain is about the examples... well maybe rich should add it to all examples :P

Link to comment
Share on other sites

It's added automatically when you use the addKey command or addCursors (this is in the 1.1.1 release now in master), but otherwise it needs to be set manually yes.


I did ought to add it to any other examples not using that approach, although there shouldn't be many. Will sort it out next week, but I'm adamant that the default for Phaser should be that it DOESN'T prevent all keyboard input from propagating.

Link to comment
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.

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.


  • Recently Browsing   0 members

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