Added PlayStation 3 controller button mappings to Phaser.Gamepad (thanks @wayfu #887)

This commit is contained in:
photonstorm 2014-06-11 00:25:58 +01:00
parent 50e47d89ee
commit 0587d944b3
2 changed files with 24 additions and 0 deletions

View file

@ -103,6 +103,7 @@ Version 2.0.6 - "Jornhill" - -in development-
* Sprite.resetFrame will revert the Sprites texture frame back to its defaults dimensions. This is called when you call Sprite.crop with no rectangle, to reset the crop effect, but can be userful in other situations so we've left it as a public method.
* TilemapLayers can now be used with an unbounded camera (a camera that can move beyond the world boundaries). Currently, when an unbounded camera moves outside of the world, tilemaps start acting weird because they only render themselves strictly within the world limits. With this change, the tilemap will continue scrolling and show empty space beyond its edge (thanks @jotson #851)
* TilemapLayer.wrap property - if true the map is rendered as if it is on the surface of a toroid (donut) instead of a plane. This allows for games that seamlessly scroll from one edge to the opposite edge of the world without noticing the transition. Note that the World size must match the Map size (thanks @jotson #851)
* Added PlayStation 3 controller button mappings to Phaser.Gamepad (thanks @wayfu)
### Bug Fixes

View file

@ -593,3 +593,26 @@ Phaser.Gamepad.XBOX360_STICK_LEFT_X = 0;
Phaser.Gamepad.XBOX360_STICK_LEFT_Y = 1;
Phaser.Gamepad.XBOX360_STICK_RIGHT_X = 2;
Phaser.Gamepad.XBOX360_STICK_RIGHT_Y = 3;
// PlayStation 3 controller (masquerading as xbox360 controller) button mappings
Phaser.Gamepad.PS3XC_X = 0;
Phaser.Gamepad.PS3XC_CIRCLE = 1;
Phaser.Gamepad.PS3XC_SQUARE = 2;
Phaser.Gamepad.PS3XC_TRIANGLE = 3;
Phaser.Gamepad.PS3XC_L1 = 4;
Phaser.Gamepad.PS3XC_R1 = 5;
Phaser.Gamepad.PS3XC_L2 = 6; // analog trigger, range 0..1
Phaser.Gamepad.PS3XC_R2 = 7; // analog trigger, range 0..1
Phaser.Gamepad.PS3XC_SELECT = 8;
Phaser.Gamepad.PS3XC_START = 9;
Phaser.Gamepad.PS3XC_STICK_LEFT_BUTTON = 10;
Phaser.Gamepad.PS3XC_STICK_RIGHT_BUTTON = 11;
Phaser.Gamepad.PS3CX_DPAD_UP = 12;
Phaser.Gamepad.PS3CX_DPAD_DOWN = 13;
Phaser.Gamepad.PS3CX_DPAD_LEFT = 14;
Phaser.Gamepad.PS3CX_DPAD_RIGHT = 15;
Phaser.Gamepad.PS3CX_STICK_LEFT_X = 0; // analog stick, range -1..1
Phaser.Gamepad.PS3CX_STICK_LEFT_Y = 1; // analog stick, range -1..1
Phaser.Gamepad.PS3CX_STICK_RIGHT_X = 2; // analog stick, range -1..1
Phaser.Gamepad.PS3CX_STICK_RIGHT_Y = 3; // analog stick, range -1..1