Skip to content

Commit 0587d94

Browse files
committed
Added PlayStation 3 controller button mappings to Phaser.Gamepad (thanks @wayfu phaserjs#887)
1 parent 50e47d8 commit 0587d94

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ Version 2.0.6 - "Jornhill" - -in development-
103103
* 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.
104104
* 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)
105105
* 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)
106+
* Added PlayStation 3 controller button mappings to Phaser.Gamepad (thanks @wayfu)
106107

107108

108109
### Bug Fixes

src/input/Gamepad.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,3 +593,26 @@ Phaser.Gamepad.XBOX360_STICK_LEFT_X = 0;
593593
Phaser.Gamepad.XBOX360_STICK_LEFT_Y = 1;
594594
Phaser.Gamepad.XBOX360_STICK_RIGHT_X = 2;
595595
Phaser.Gamepad.XBOX360_STICK_RIGHT_Y = 3;
596+
597+
// PlayStation 3 controller (masquerading as xbox360 controller) button mappings
598+
599+
Phaser.Gamepad.PS3XC_X = 0;
600+
Phaser.Gamepad.PS3XC_CIRCLE = 1;
601+
Phaser.Gamepad.PS3XC_SQUARE = 2;
602+
Phaser.Gamepad.PS3XC_TRIANGLE = 3;
603+
Phaser.Gamepad.PS3XC_L1 = 4;
604+
Phaser.Gamepad.PS3XC_R1 = 5;
605+
Phaser.Gamepad.PS3XC_L2 = 6; // analog trigger, range 0..1
606+
Phaser.Gamepad.PS3XC_R2 = 7; // analog trigger, range 0..1
607+
Phaser.Gamepad.PS3XC_SELECT = 8;
608+
Phaser.Gamepad.PS3XC_START = 9;
609+
Phaser.Gamepad.PS3XC_STICK_LEFT_BUTTON = 10;
610+
Phaser.Gamepad.PS3XC_STICK_RIGHT_BUTTON = 11;
611+
Phaser.Gamepad.PS3CX_DPAD_UP = 12;
612+
Phaser.Gamepad.PS3CX_DPAD_DOWN = 13;
613+
Phaser.Gamepad.PS3CX_DPAD_LEFT = 14;
614+
Phaser.Gamepad.PS3CX_DPAD_RIGHT = 15;
615+
Phaser.Gamepad.PS3CX_STICK_LEFT_X = 0; // analog stick, range -1..1
616+
Phaser.Gamepad.PS3CX_STICK_LEFT_Y = 1; // analog stick, range -1..1
617+
Phaser.Gamepad.PS3CX_STICK_RIGHT_X = 2; // analog stick, range -1..1
618+
Phaser.Gamepad.PS3CX_STICK_RIGHT_Y = 3; // analog stick, range -1..1

0 commit comments

Comments
 (0)