Implement FGL HTML 5 API in Construct 2

2

Stats

2,408 visits, 3,867 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 2 Jan, 2014. Last updated 19 Feb, 2019

You need to download the c2 addon file from here:

Rename the file as zip and extract in C:\Program Files\Construct 2\exporters\html5\plugins\FGL

Now you have 4 options for FGL : show ad, moregames, show scoreboard and submit score.

Use them as your project needs.

Caution: This doesn't work in preview mode. To make the game work you need to export for offline website, and on export folder on index.html add after the comment the lines below. Change gamename with your game name or according to fgl indications:

    <!-- 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>
       var element = document.getElementById('c2canvas');
       fgl.create(element, 'com.fgl.gamename');

</script>

You can also rename the index.html to index2.html and then when you modify the project export on the same folder and run the index2.html to test.

Thanks.

  • 0 Comments

Want to leave a comment? Login or Register an account!