I made an onscreen controller template. The objects are pre-rendered in a 3D application.
The Joystick does not mimic an analog stick at the moment. If you would rather use it, just place the sprite under the D-pad button hotspot.
The color effect is turned off by default, let your users know that it is intended for fast computers.
Some uses for it:
- On screen controller
- Graphic to display on your keyboard config menu screen
- Just use the re-bind-able keyboard system and toss the graphics.
- As a template for your own graphics.
- Toss the code, and just use the sprites.
The usable states are all located in the purple "Controller state" sprite instance variables.
- Move left
- Move right
- Move Up
- Move Up left
- Move Up right
- Move Down
- Move Down left
- Move Down right
- Button A
- Button B
- Button X
- Button Y
- Button Start
- Button Select
The default keycodes are on the keyboard input event sheet's global variables.
- Can not use both touch and keyboard at same time. It automatically switches when it gets keys or touches.
- If window looses focus in node webkit, the inputs get "stuck" sometimes. (windows 7 only)
- No joystick or controller bindings yet. (Might come soon.)
The sprites are for HD games by default. You are welcome to scale the images, as long as the image remains 2x the actual sprite display size.
I am thinking of doing a commercial version for the Scirra store. If you have any requests please let me know. If you want something Custom for you game, please PM me. Do you guys think that $5-$10 is a fair price to ask for the non-free version?
Hope you enjoy it