Airconsole controller maker

Post your completed addons to share with the community

Post » Fri Feb 10, 2017 4:41 pm

@arod17pr Try opening your controller.html and adding this tag after the <head>:
Code: Select all
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
Banned User
B
17
S
7
G
24
Posts: 388
Reputation: 14,494

Post » Fri Feb 10, 2017 6:12 pm

@X3M I will test it and let you know how it goes. Thank you!
B
11
S
3
G
1
Posts: 45
Reputation: 1,398

Post » Fri Feb 10, 2017 11:37 pm

X3M wrote:@arod17pr Try opening your controller.html and adding this tag after the <head>:
Code: Select all
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">


@X3M

It does not work with IOS. Any ideas on how to solve this problem?
B
11
S
3
G
1
Posts: 45
Reputation: 1,398

Post » Sat Feb 11, 2017 3:59 am

@X3M hey! one interesting issue i've noticed is when using the controller via browser(chrome on android) and not the app itself, it doesn't register properly. eg say device1 clicks menu 1 it's suppose to hide that layer called menu1 and show the select layer and on the monitor screen. However it still remains on menu but on the monitor screen it changes to the select layer but if i use the app the problem does not occur.
Image
B
60
S
32
G
5
Posts: 118
Reputation: 8,325

Post » Sat Feb 11, 2017 5:40 am

@ishmaelmoreno

Are you sure it's not a cache problem? Do you use CTRL+F5 to refresh? Did you use simple javascript console.log(); and most importantly Construct 2 Browser.Log() to debug? Do you check your console when trying? (F12) If you see

Image

in your console (note, device_id 1 to xxx of course), your controllers are connected
B
36
S
12
G
3
Posts: 239
Reputation: 4,557

Post » Sun Feb 12, 2017 12:20 am

@arod17pr Try this code :
Code: Select all
// Rewritten version
   // By @mathias, @cheeaun and @jdalton

   (function (doc) {

      var addEvent = 'addEventListener',
      type = 'gesturestart',
      qsa = 'querySelectorAll',
      scales = [1, 1],
      meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : [];

      function fix() {
         meta.content = 'width=device-width,height=device-height,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1];
         doc.removeEventListener(type, fix, true);
      }

      if ((meta = meta[meta.length - 1]) && addEvent in doc) {
         fix();
         scales = [.25, 1.6];
         doc[addEvent](type, fix, true);
      }

   }
      (document));


Put it before
Code: Select all
instanceProto.onCreate = function () {


If it doesn't work, try adding this code :
Code: Select all
   $(this.runtime.canvasdiv).width(window.screen.width/2);
   $(this.runtime.canvasdiv).height(window.screen.height/2);


After
Code: Select all
instanceProto.tick = function () {
Banned User
B
17
S
7
G
24
Posts: 388
Reputation: 14,494

Post » Sun Feb 12, 2017 12:22 am

@Psychokiller1888 hey :) and yes i've been using alerts actually. Had issues where despite the alerts popped up the function still didn't work but i figured out how to resolve it by using a state machine.
Image
B
60
S
32
G
5
Posts: 118
Reputation: 8,325

Post » Sun Feb 12, 2017 4:44 am

X3M wrote:@arod17pr Try this code :
Code: Select all
// Rewritten version
   // By @mathias, @cheeaun and @jdalton

   (function (doc) {

      var addEvent = 'addEventListener',
      type = 'gesturestart',
      qsa = 'querySelectorAll',
      scales = [1, 1],
      meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : [];

      function fix() {
         meta.content = 'width=device-width,height=device-height,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1];
         doc.removeEventListener(type, fix, true);
      }

      if ((meta = meta[meta.length - 1]) && addEvent in doc) {
         fix();
         scales = [.25, 1.6];
         doc[addEvent](type, fix, true);
      }

   }
      (document));


Put it before
Code: Select all
instanceProto.onCreate = function () {


If it doesn't work, try adding this code :
Code: Select all
   $(this.runtime.canvasdiv).width(window.screen.width/2);
   $(this.runtime.canvasdiv).height(window.screen.height/2);


After
Code: Select all
instanceProto.tick = function () {


@X3M

I added them and still does not work. Am I the only one with the problem?

Thank you for the help!
B
11
S
3
G
1
Posts: 45
Reputation: 1,398

Post » Sun Feb 12, 2017 10:10 am

@arod17pr No, I've tried it in my prototype and it doesn't scale correctly on iOS but on Android it works great. No idea why though :/
B
58
S
25
G
14
Posts: 792
Reputation: 13,300

Post » Fri Feb 17, 2017 7:46 pm

Step 3 (3- Run Magicwand.cmd as Administrator. It will do all the work for you.) doesn't work

Error: "File not found" :roll:
B
4
S
2
Posts: 6
Reputation: 466

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest