Center exported game

Forum Home Forum Home > Construct 2 General > How do I....?
 Post Reply Post Reply
Author
3,667 Rep
Post Options Post Options   Quote 01lifeleft Quote  Post ReplyReply Direct Link To This Post Topic: Center exported game
    Posted: 22 Apr 2012 at 1:40pm
Hi!

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


instead of the default exported:


Edited by 01lifeleft - 23 Apr 2012 at 5:38am
Rolling...
Back to Top
2,280 Rep
Post Options Post Options   Quote vandinz Quote  Post ReplyReply Direct Link To This Post Posted: 22 Apr 2012 at 8:26pm
You could put some break returns <br> in before the game in the index file. That'll push everything down from the top.
Back to Top

Moderator
28,496 Rep
Post Options Post Options   Quote Kyatric Quote  Post ReplyReply Direct Link To This Post Posted: 22 Apr 2012 at 8:49pm
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.

Edited by Kyatric - 22 Apr 2012 at 8:49pm
Back to Top

Scirra Developer
78,295 Rep
Post Options Post Options   Quote Ashley Quote  Post ReplyReply Direct Link To This Post Posted: 22 Apr 2012 at 9:35pm
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.
Back to Top
3,667 Rep
Post Options Post Options   Quote 01lifeleft Quote  Post ReplyReply Direct Link To This Post Posted: 23 Apr 2012 at 5:35am
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. :D

Edited by 01lifeleft - 23 Apr 2012 at 5:43am
Rolling...
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down