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
41
S
11
G
5
Posts: 174
Reputation: 6,295

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
278
S
104
G
86
Posts: 7,313
Reputation: 84,306

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
386
S
229
G
87
Posts: 24,207
Reputation: 191,582

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
41
S
11
G
5
Posts: 174
Reputation: 6,295


Return to How do I....?

Who is online

Users browsing this forum: morti and 1 guest