Airconsole controller maker

0 favourites
From the Asset Store
Small pixel icons for the 3 most popular controller types.
  • Psychokiller1888,

    Thank you for taking a look at this! I just think you saved my sanity.


    Nice work! I'll try it out today as soon as I get a chance. You rock!

  • Could you add accelerometer options? For example, as the occlusions of the Touch object. Thank you, and your plugin is amazing!


    You should now be able to get accelerometer data by including a Touch object, and sending a message to the screen.

  • X3M,

    It works! I haven't tried sending custom messages yet, but it should just be a matter of parsing through a JSON string now...

    I just tested on my iPad, and I'm still seeing the scaling issue:

    I don't have my iPhone or Nexus 5 handy, but I will test those as soon as I can.

  • X3M,

    I've done a fair amount of testing, and can't seem to isolate the section in code that is causing the screen to be scaled incorrectly. On my iPhone and iPad, the screen is effectively in "crop" mode. I have a hunch that it is because of the way iOS deals with HTML elements overlaid upon a C2 canvas, but I can't test my hypothesis unless I can create an instance of AirConsoleController without creating an HTML element ("button", "dpad", "swipe area", "joystick", etc.) as well.

    When I run the "pong" example .capx on my iphone, this is what I see:

    Notice that the bottom portion of the controller, including the text with my nickname, is cut off, along with a chunk of the right portion of the controller. This is the same as what I see when I run the pong example on my iPad using the iPhone version of the AirConsole app.

    Would it be possible to rework the AirConsoleController plugin such that it is a global object, like the AirConsole object? That way we wouldn't have to worry about instantiating any of the HTML elements, but could still have access to the controller methods?

  • cjbruce It can't be the DOM elements since they are laid on top of the C2 canvas in an absolute position, so they cannot affect the size of the canvas.

    May I ask why are you using the Crop mode?

  • cjbruce It can't be the DOM elements since they are laid on top of the C2 canvas in an absolute position, so they cannot affect the size of the canvas.

    May I ask why are you using the Crop mode?


    I'm not using crop mode. I'm just exporting the example "pong" .capx provided in the download link at the beginning of this thread without changing anything. It is set to "letterbox scale", but I get the weird cropping effect on iOS.

    I have seen similar problems before when I have attempted to create things in C2 for iOS. HTML elements render inconsistently across browsers, sometimes pushing the canvas around on iOS, but appearing fine on my Nexus 5. Since I primarily target iOS devices for my work, I have stopped using HTML elements entirely.

    Just to be sure, I removed the AirConsoleController object from the "pongcontroller" project, and the problem went away.

    Would it be possible to modify the plugin so that you can create a "global" object, without having to load HTML elements onto the page? This would work exactly the same as the AirConsole plugin itself.

  • cjbruce Added option to disable HTML elements (Last property => False )

  • X3M,

    Thank you for humoring me and putting in the User HTML elements = true/false capability. Unfortunately, this wasn't the fix. *feeling a little sheepish*

    X3M and Psychokiller1888,

    I finally had a chance to sit down with both the Nexus 5 and the iPhone 7 Plus running the "pong" example. I tested every combination that I could think of:

    Scaling Modes:



    Scale Inner

    Scale Outer

    Letterbox Scale

    Letterbox Integer Scale


    AirConsole Plugin + AirConsoleController Plugin

    AirConsole Plugin Only

    AirConsoleController Plugin Only

    Neither Plugin


    iPhone 7 Plus

    Nexus 5

    Hi-DPI Mode On

    Hi-DPI Mode Off

    I found that in all cases, the Nexus 5 had no problems, and the iPhone 7 Plus failed to recognize scaling mode whenever either the AirConsole Plugin or the AirConsoleController Plugin were used. The problem went away when I removed both plugins.

    From the above, I have concluded the problem with iOS failing to recognize scaling is most likely an adverse interaction between AirConsole's API and Construct 2, and has nothing to do with either plugin. Perhaps there is something in the AirConsole code that is overwriting the C2 scaling?


    Would it be possible to take a look at this within the airconsole API itself? I know this is probably asking a lot, but it would be nice to know if a fix is possible. We were really looking forward to using Construct 2 for our controllers, but understand if this isn't really a priority. I have posted the details on StackOverflow.

    Thank you all for putting so much time and effort into getting this working!

  • Thanks for the plugin guys! Don't know why i didn't see this sooner

  • > Could you add accelerometer options? For example, as the occlusions of the Touch object. Thank you, and your plugin is amazing!


    I can't because it's not a feature of the Airconsole controller API, the

    onDeviceMotion[/code:2ga3ie7s] event resides in the main Airconsole API, so you need to contact 

    Psychokiller1888 so that he implements it in his plugin.[/p] [/p] [url=] ... nputs.html[/url][/p]

    Coming back to you concerning onDeviceMotion which didn't tilt my brain when I first answered.... But onDeviceMotion is a controller function, not a Screen function.

    Yes, I could build a bridge, but users can:

    airConsole.onDeviceMotion = function (data) {
      airConsole.message(AirConsole.SCREEN, {
        deviceMotion: JSON.stringify(data)
  • cjbruce Does the contoller.html provided by Airconsole work well on iOS devices ?

    Psychokiller1888 I've added it in the previous update

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • hey X3M been playing around with the controller however this error is picked up

    When that error is shown, on Device 1 Join, two players are displayed instead of one(Character Select Screen). However if i re-upload the file it works fine until that error is detected.

    Also the data 'menu' is being sent to the device when it joins.

  • ishmaelmoreno I can't determine the cause of the error, OnDeviceJoin is inside your game and not in your controller right ?

  • X3M yup the OnDeviceJoin is inside my game only and not the controller.Also I realized that the same issue tends to happen if a device leaves and rejoins (although I put measures in place for it to detect as only one if device 1 disconnects set deviceId1 to 0

  • ishmaelmoreno Can you pm me your c2runtimectrl.js ?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)