This generator helps you to build a simple AirConsole controller including Buttons, DPad or Joystick. It also generates the code to send messages to the screen, which happens whenever a button was pressed or the joystick has been moved.
Open your browsers console - and click on your generated elements to see which data messages will be send to your AirConsole screen.
Create a new file called controller.html and paste the output code into it.
Make sure you have downloaded and included the project of AirConsole-Controls in your directory. We assume your project dir looks like this:
{
<the-defined-key>: {
pressed: true|false
}
}
{
: {
// Directions 'left', 'top', 'right', 'bottom'
message: { direction: <String> }
}
}
{
: {
pressed: true|false,
message: { x: Number, y: Number }
}
}
{
: {
pressed: true|false,
// Directions-Object: {
// left: <Boolean>,
// top: <Boolean>,
// right: <Boolean>,
// bottom: <Boolean>
// }
message: directions (Object)
}
}
{
: {
pressed: true|false,
// Direction-Vector-Object: {
// x: <Number>,
// y: <Number>,
// angle: <Number>,
// degree: <Number>
// }
message: (Vec-Object)
}
}
{
: {
pressed: true|false,
// Message contains an array of circle
// which were touched
message: <Array>
}
}