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
34
S
8
G
5
Posts: 174
Reputation: 5,791

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
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

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
359
S
214
G
72
Posts: 22,948
Reputation: 178,532

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
34
S
8
G
5
Posts: 174
Reputation: 5,791


Return to How do I....?

Who is online

Users browsing this forum: Braus and 14 guests