How do I center expoter project.

Get help using Construct 2

Post » Wed Apr 16, 2014 8:11 pm

I exported my game and hosted it on Google Drive.
Only problem is that project is displaying in the top middle of the page, right under bookmarks bar.

Image

Is there any way to move it?
B
39
S
17
G
6
Posts: 238
Reputation: 7,985

Post » Thu Apr 17, 2014 12:21 am

You may need to modify the index.html file to center it. Open that file and look for something like:
<div id="c2canvasdiv" style="width: 538px; height: 349px; margin-left: 242px; margin-top: 0px;">

That div contains your game. You may need to change the margin-top:0px to something like margin-top:200px.

This is a static solutions, it will leave a space of 200 pixels on the top. To really center divs, you should take a look at google for the keywords: html vertical align.

Tell me if it helps!
B
10
S
2
G
1
Posts: 48
Reputation: 1,265

Post » Fri Apr 18, 2014 4:11 pm

jeeba wrote:You may need to modify the index.html file to center it. Open that file and look for something like:
<div id="c2canvasdiv" style="width: 538px; height: 349px; margin-left: 242px; margin-top: 0px;">

That div contains your game. You may need to change the margin-top:0px to something like margin-top:200px.

This is a static solutions, it will leave a space of 200 pixels on the top. To really center divs, you should take a look at google for the keywords: html vertical align.

Tell me if it helps!


Thanks alot! This is exactly what I was looking for!
Just some info for people who might look for the same thing:

Exported index.html contains:
<div id="c2canvasdiv" style="margin: 0 auto; width: *your project width*px; height: *your project width*px;">

Just add margin-top: *size you want*px; somewhere in this brakets.
B
39
S
17
G
6
Posts: 238
Reputation: 7,985


Return to How do I....?

Who is online

Users browsing this forum: worm1 and 20 guests