A four way directional control pad for games.
To use the module, it must be required somewhere in your code. To do this you use the require function. Make sure you save the result of require to a local variable otherwise you won't be able to use it!
local controlpad = require("controlpad")
newControlPad()
Create a new ControlPad object
controlpad.newControlPad(x, y, radius)
x
The pixel display x coordinate of the center of the control pady
The pixel display y coordinate of the center of the control padradius
The radius in display pixels of the control pad circle
local controlpad = require("controlpad")
local myControls = controlpad.newControlPad(100, 500, 100)
displayGroup
The display group containing the graphics for the control pad
whenUpPressed()
The function called when up is pressedwhenDownPressed()
The function called when down is pressedwhenLeftPressed()
The function called when left is pressedwhenRightPressed()
The function called when right is pressedshow()
Show the control pad on the screenhide()
Hide the control pad from the screen