Center exported game

Get help using Construct 2

Post » Sun Apr 22, 2012 1:40 pm

Hi!

What i need to edit the index.html file to center my exported game in the preview:


instead of the default exported:
01lifeleft2012-04-23 05:38:03
B
42
S
11
G
5
Posts: 174
Reputation: 6,340

Post » Sun Apr 22, 2012 8:26 pm

You could put some break returns <br> in before the game in the index file. That'll push everything down from the top.
B
19
S
5
G
4
Posts: 208
Reputation: 3,960

Post » Sun Apr 22, 2012 8:49 pm

You basicly need to use the same CSS style in the exported version that the one present in the preview version for the <canvas> object.

Have a look at how to customize the exported html5 index.html to learn more.Kyatric2012-04-22 20:49:32
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
289
S
112
G
94
Posts: 7,333
Reputation: 69,293

Post » Sun Apr 22, 2012 9:35 pm

Just view source and copy the divs and css from the preview.

Horizontal centering is easy, but vertical centering is trickier - that's what the three levels of <div>s are for :P I thought I'd keep it simple in the export so it's easy for people who know HTML to customise.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Mon Apr 23, 2012 5:35 am

Thanks guys!

I used Ashley's method and now it's totally looks like the preview, thanks very much!



And that tutorial is very useful, Kytric. :D01lifeleft2012-04-23 05:43:03
B
42
S
11
G
5
Posts: 174
Reputation: 6,340


Return to How do I....?

Who is online

Users browsing this forum: biasaur, brunopalermo, tarek2, Unconnected and 15 guests