Modify the generated index.html?

Get help using Construct 2

Post » Mon Aug 20, 2012 10:26 pm

When you export the project for a webserver, it wraps the game in html/css/js etc.

I need to modify the index.html that it procudes, as it doesnt work correctly for android (doesnt get rid of address bar for full screen apps).

Is there any way to do this, other than to re-edit the files after every export?
B
15
S
5
G
2
Posts: 357
Reputation: 3,691

Post » Mon Aug 20, 2012 10:36 pm

As I mentioned in my tutorial how to customize the exported HTML5 index.html you can edit directly the file export-fs.html from the "C2 install base/exporters/html5" folder.

You will have to do this edit on every upgrade of C2 though, since those files will be overwritten/destroyed (as it is strongly advised to uninstall the previous version of C2 when updating to a newer one).

On the other hand, you're talking about accessing the game from android directly through the browser aren't you ? because I believe wrappers like cocoon.js deal with those kind of details "naturally".Kyatric2012-08-20 22:36:16
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Mon Aug 20, 2012 11:10 pm

Wow, nice tutorial, thanks!

With luck, the next version of C2 will have full screen suport on Android without adress bar ;) There is lots of js floating about to achieve this.

I will look into the cocoon.js exporter.

I just found the tutorial search page, this will save me a lot of posts!

There is no tutorial yet for how to write apps for android (only ios) :(
B
15
S
5
G
2
Posts: 357
Reputation: 3,691

Post » Mon Aug 20, 2012 11:21 pm

I've never been able to get any of those 'hide address bar' snippets working with C2's engine, can you link me to one that you know works?
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Mon Aug 20, 2012 11:25 pm

[QUOTE=Ashley] I've never been able to get any of those 'hide address bar' snippets working with C2's engine, can you link me to one that you know works?[/QUOTE]

Ok, I'll try some out and let you know what I find.

I saw that google.co.uk and will-hill.mobi managed to do it. I was thinking of using charles proxy to peek at their code.
B
15
S
5
G
2
Posts: 357
Reputation: 3,691

Post » Sat Aug 25, 2012 11:28 pm

[QUOTE=Ashley] I've never been able to get any of those 'hide address bar' snippets working with C2's engine, can you link me to one that you know works?[/QUOTE]

Ashley, I know why the bar is not being removed in C2 exported index.html, and how hack the files to get it to work. I cant pm you, can you pm me and we can find a way to get it put into constrcut 2?
B
15
S
5
G
2
Posts: 357
Reputation: 3,691


Return to How do I....?

Who is online

Users browsing this forum: Artpunk, Braus, Kagubro, Mirlas, zeneizel and 22 guests