JPVirtualJoypad is the easy way to get virtual joypads work in your game in no time.
Provide to JPVirtualJoypad the graphics (HUD components) of your virtual joypad sticks/buttons and JPVirtualJoypad will do the logic for you.
Your virtual joypads will work just like a real joypad, and will send their values to the native onJoypadStickMove handler. This is the same with the virtual buttons and the onJoypadButtonDown/Up handlers.
JPVirtualJoypad will move your stick components, the only thing you have to do is to handle the values of the sticks. JPVirtualJoypad takes a few optional parameters. You can for instance set the visibility condition of the back and thumb textures of the stick. For instance the thumb could be visible only when the stick is not active and the thumb when it is active.
You can also tell JPVirtualJoypad that a stick must return values in a limited number of directions, for instance in 8 directions like the directional arrows of the playstation gamepad.
It also has an extra function, transformStickValues, that helps you apply a dead zone to the joypad stick values.
Another great feature is the possibillity to use a tweener curve to the stick values. This way the stick values can be non linear when the stick moves. JPTweener is required for this feature.