pixi-analog-stick
The aim of the project is to create an easy to use analog stick library for PIXI.js.
Install
$ npm install --save pixi-analog-stick
Usage
;; Container { super; // AnalogStick this_analogStick = ; this_analogStick; this_analogStick; this; } { console; }; { console; }; ;
Method
-
on(eventName:String, handler:Function)
Use to add events.
-
off(eventName:String, handler:Function)
Use to remove events.
-
reset()
Reset stick position.
-
dispose()
Use to dispose pixi-analog-stick.
Event
-
move
Emit "move" event when move stick.
Property
- x : It is "x" position of stick.
- y : It is "y" position of stick.
- angle : It is the angle where the stick was knocked down.
- length : It is the distance between the stick and the center.
-
release
Emit "release" event when stick is released.