jeromeetienne / virtualjoystick.js

a virtual joystick library to emulate a joystick on touch screen in javascript
http://jeromeetienne.github.com/virtualjoystick.js/examples/basic.html
MIT License
417 stars 125 forks source link

Pull Request: Add support for Stationary joystick Base #14

Closed erichlof closed 10 years ago

erichlof commented 10 years ago

Added support for a stationary joystick base. Changed virtualjoystick.js by adding some options to the 'opts' object. These new parameters are boolean flag 'stationaryBase' and integers 'baseX' and 'baseY' , that are set when creating the initial joystick object.

Also added some simple branching to detect 'if(this._stationaryBase == true)' or not, and perform the appropriate behavior. virtualjoystick.js will behave in the old way if the new 'stationaryBase' option is not used at all.

jeromeetienne commented 10 years ago

looks good! thanks :)