Game Development Reference
In-Depth Information
Table 4-1. Xbox Controller Key Cheat Sheet
Key Description
Reference
Y
Y Button (Yellow Button) y
B
B Button (Red Button)
b
X
X Button (Blue Button)
x
A
A Button (Green Button) a
1
Right Stick
RightThumbX, RightThumbY
2
Directional Pad (D-pad) dpad_up, dpad_right, dpad_down, dpad_left
3
Left Stick
LeftThumbX, LeftThumbY
4
Back Button
back
5
Left Bumper
left_shoulder
6
Left Trigger
LeftTrigger
7
Guide Button
N/A
8
Start Button
start
9
Right Trigger
RightTrigger
10 Right Bumper
Right_shoulder
Getting this up and running in your own game is now going to be relatively easy. First, you
are going to need to set up a reference to the controller. You can do this in your default.js
class with the following line of code in the app.activate function right before you initialize
your game.
// Although the API supports up to 4 controllers per machine,
// this sample only works with a single controller.
controller = new GameController.Controller(0);
Search WWH ::




Custom Search