I'm seeking plugin developer to teach me.

Looking to build a team or have a job to offer?

Post » Fri Jan 03, 2014 7:24 am

some users requested for my plugin that they want to fix or finish, here is, it's almost organized with icon.

I really don't know how to hack via index.html using special variable.


https://dl.dropboxusercontent.com/u/76227787/FGL.zip
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Fri Jan 03, 2014 8:18 am

[QUOTE=paala] @PixelRebirth I don't know how to make the game start.
In the example provided, in index.html:

fgl.onReady(function(){
            new FGLNinja(element).boot();
}

Now in construct 2 I didn't found an equivalent of boot function to start the whole game.
[/QUOTE]

At the bottom of the exported index.html file there is the script which starts the game.

You can enclose that script in a function

var loadGame = function() { SCRIPT HERE };

then it should work:

fgl.onReady(function(){
            loadGame();
}

Let me know how it goes.PixelRebirth2014-01-03 08:19:25
B
23
S
6
G
10
Posts: 1,041
Reputation: 7,553

Post » Fri Jan 03, 2014 2:00 pm

So what else needs to be finished. Perhaps we can put a list and whenever a problem is solved we can cross it off that list.
B
73
S
12
G
7
Posts: 388
Reputation: 9,180

Post » Fri Jan 03, 2014 7:33 pm

<!-- The runtime script. You can rename it, but don't forget to rename the reference here as well.
    This file will have been minified and obfuscated if you enabled "Minify script" during export. -->
     <script src="c2runtime.js"></script>
     <script>
       var element = document.getElementById('c2canvas');
       fgl.create(element, 'com.fgl.gamename');
        //fgl.onReady(function(){loadGame();}
     </script>
      
    <script>
          // Size the canvas to fill the browser viewport.
          //var loadGame = function() {
          jQuery(window).resize(function() {
               cr_sizeCanvas(jQuery(window).width(), jQuery(window).height());
          });
          
          // Start the Construct 2 project running on window load.
          
          jQuery(document).ready(function ()
          {               
               // Create new runtime using the c2canvas
               cr_createRuntime("c2canvas");
          });
          
          // Pause and resume on page becoming visible/invisible
          function onVisibilityChanged() {
               if (document.hidden || document.mozHidden || document.webkitHidden || document.msHidden)
                    cr_setSuspended(true);
               else
                    cr_setSuspended(false);
          };
          
          document.addEventListener("visibilitychange", onVisibilityChanged, false);
          document.addEventListener("mozvisibilitychange", onVisibilityChanged, false);
          document.addEventListener("webkitvisibilitychange", onVisibilityChanged, false);
          document.addEventListener("msvisibilitychange", onVisibilityChanged, false);
          //}
    </script>
     
</body>
</html>

This is the final part of index.html , if I uncomment the parts you suggested to me the game doesn't load at all.


@mammoth The fgl api works, Pixel rebirth suggested that the game should load only after the FGl API has initialised. Now the game loads regardless if API was initialised . If there is a problem at FGL the game will load and throw errors when FGL api stuff is called. If the game was loaded only after the fgl api initialisation the game wouldn;t load at all.
[size=200]1. Best Construct 2 course :HERE.10$!

2. 155 games source codes for sale on scrira store 12,86$each. PM me if interested to speed up the uploading process.
[/size
B
34
S
8
G
4
Posts: 157
Reputation: 3,781

Post » Fri Jan 03, 2014 8:16 pm

Do you know if FGl will accept the game with the current plugin?
B
73
S
12
G
7
Posts: 388
Reputation: 9,180

Post » Fri Jan 03, 2014 9:27 pm

@paala Did Show Ad and Show More games work with your implementation of index.html?
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Fri Jan 03, 2014 10:44 pm

Yes show ad and more games works
[size=200]1. Best Construct 2 course :HERE.10$!

2. 155 games source codes for sale on scrira store 12,86$each. PM me if interested to speed up the uploading process.
[/size
B
34
S
8
G
4
Posts: 157
Reputation: 3,781

Post » Fri Jan 03, 2014 10:48 pm

Seems you're missing a semicolon at the end of each script block. Or did you paste it incorrectly?

[CODE]
<!-- The runtime script. You can rename it, but don't forget to rename the reference here as well.
    This file will have been minified and obfuscated if you enabled "Minify script" during export. -->
     <script src="c2runtime.js"></script>
     <script>
       var element = document.getElementById('c2canvas');
       fgl.create(element, 'com.fgl.gamename');
        //fgl.onReady(function(){loadGame();};
     </script>
      
    <script>
          // Size the canvas to fill the browser viewport.
          //var loadGame = function() {
          jQuery(window).resize(function() {
               cr_sizeCanvas(jQuery(window).width(), jQuery(window).height());
          });
          
          // Start the Construct 2 project running on window load.
          
          jQuery(document).ready(function ()
          {              
               // Create new runtime using the c2canvas
               cr_createRuntime("c2canvas");
          });
          
          // Pause and resume on page becoming visible/invisible
          function onVisibilityChanged() {
               if (document.hidden || document.mozHidden || document.webkitHidden || document.msHidden)
                    cr_setSuspended(true);
               else
                    cr_setSuspended(false);
          };
          
          document.addEventListener("visibilitychange", onVisibilityChanged, false);
          document.addEventListener("mozvisibilitychange", onVisibilityChanged, false);
          document.addEventListener("webkitvisibilitychange", onVisibilityChanged, false);
          document.addEventListener("msvisibilitychange", onVisibilityChanged, false);
          //};
    </script>
     
</body>
</html>
[/CODE]PixelRebirth2014-01-03 22:53:11
B
23
S
6
G
10
Posts: 1,041
Reputation: 7,553

Post » Sat Jan 04, 2014 12:44 am

Is this the line that is giving the problem?

   //fgl.onReady(function(){loadGame();};
B
73
S
12
G
7
Posts: 388
Reputation: 9,180

Post » Sat Jan 04, 2014 12:51 am

@paala would you let me to cannabalize your index.html and release in plugin subforum? I was thinking it could modify a line in index.html from C2 exporter like how they did for Blackberry 10 XML.
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

PreviousNext

Return to Job Offers and Team Requests

Who is online

Users browsing this forum: Google Feedfetcher and 3 guests