[Solved] Custom background image, HTML5 web export

Get help using Construct 2

Post » Wed Jan 16, 2013 1:18 pm

Hello!

I'm trying to figure out how to create a custom background image, to put behind the HTML5 Web exported project on a website.

Its probably just a simple snippet of code needed. I've tried different things, but cant seem to get it right.

I've been editing the index file of the exported project - where I've managed to set the background color correctly, but cant put my image centered and behind the game window itself.


Edit*

I feel stupid now, I was putting my code in the wrong place. The code needed was:

<style type="text/css">
body { background-image:url(imagename.PNG); background-position:center top; background-repeat:no-repeat }
</style>

withing the body section of the index file. Era2013-01-16 13:23:09
B
34
S
11
G
9
Posts: 189
Reputation: 8,595

Post » Wed Jan 16, 2013 1:31 pm

@Era if you'd like it to scale with the window, check out this post: http://css-tricks.com/perfect-full-page-background-image/
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Wed Jan 16, 2013 1:51 pm

Ahh, thanks!

Here's the result by the way. Just a simple image centered, and an altered bg color :)
B
34
S
11
G
9
Posts: 189
Reputation: 8,595


Return to How do I....?

Who is online

Users browsing this forum: jeffige and 0 guests