0.0.1 • Published 10 years ago

slimdx-gamepad v0.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
10 years ago

SlimDX Gamepad

Provides a simple interface for accessing the Xbox controller through SlimDX

Usage

var Gamepad = require('slimdx-gamepad');
var gamepad1 = new Gamepad(1);

Constructor

  • new Gamepad( playerID ) * int playerID: Which controller to listen to. 0 will use any controller available.

Properties

{
	A: bool,
	B: bool,
	X: bool,
	Y: bool,
	Start: bool,
	Back: bool,
	DPad: {
	    Up: bool,
	    Down: bool,
	    Left: bool,
	    Right: bool
	},
	LeftBumper: bool,
	RightBumper: bool,
	LeftTrigger: float,
	RightTrigger: float,
	Thumbsticks: {
	    Left: {
	        Click: bool,
	        X: float,
	        Y: float
	    },
	    Right: {
	        Click: bool,
	        X: float,
	        Y: float
	    }
	}
}

Methods

  • loadState() * Loads the current state of the gamepad
  • destroy() * Destroys gamepad reference