Airconsole controller maker

Post your completed addons to share with the community

Post » Sat Jan 28, 2017 12:45 pm

@psychokiller1888,

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

@X3M,

Nice work! I'll try it out today as soon as I get a chance. You rock!
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
48
S
14
G
24
Posts: 400
Reputation: 16,648

Post » Sat Jan 28, 2017 12:50 pm

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



@amariscal,

You should now be able to get accelerometer data by including a Touch object, and sending a message to the screen.
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
48
S
14
G
24
Posts: 400
Reputation: 16,648

Post » Sat Jan 28, 2017 1:31 pm

@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:

Image

I don't have my iPhone or Nexus 5 handy, but I will test those as soon as I can.
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
48
S
14
G
24
Posts: 400
Reputation: 16,648

Post » Sat Jan 28, 2017 10:13 pm

@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:

Image

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?
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
48
S
14
G
24
Posts: 400
Reputation: 16,648

Post » Sat Jan 28, 2017 10:37 pm

@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?
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,994

Post » Sat Jan 28, 2017 11:41 pm

X3M wrote:@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?


@X3M,

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.
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
48
S
14
G
24
Posts: 400
Reputation: 16,648

Post » Sun Jan 29, 2017 10:01 am

@cjbruce Added option to disable HTML elements (Last property => False )
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,994

Post » Sun Jan 29, 2017 10:27 pm

@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:
None
Crop
Scale Inner
Scale Outer
Letterbox Scale
Letterbox Integer Scale

Plugins:
AirConsole Plugin + AirConsoleController Plugin
AirConsole Plugin Only
AirConsoleController Plugin Only
Neither Plugin

Phones:
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?

@FraConsole,

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!
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
48
S
14
G
24
Posts: 400
Reputation: 16,648

Post » Sat Feb 04, 2017 8:33 am

Thanks for the plugin guys! Don't know why i didn't see this sooner :|
Image
B
60
S
32
G
5
Posts: 118
Reputation: 8,325

Post » Sat Feb 04, 2017 5:15 pm

X3M wrote:
amariscal wrote: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
Code: Select all
onDeviceMotion
event resides in the main Airconsole API, so you need to contact @Psychokiller1888 so that he implements it in his plugin.

https://developers.airconsole.com/api/a ... nputs.html


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:

Code: Select all
airConsole.onDeviceMotion = function (data) {
  airConsole.message(AirConsole.SCREEN, {
    deviceMotion: JSON.stringify(data)
  }
};
B
33
S
11
G
3
Posts: 225
Reputation: 4,324

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 0 guests