How do I change the bg color of an exported iframe?

Get help using Construct 2

Post » Fri Jun 09, 2017 2:33 pm

I've exported html5 using the advert bar style option and have been trying to change the background color in both html created: "game.html" and "index.html" following some instructions:

<body style="background-color:#ffffff;">

The "'index.html" is ok, I could change the bg color, but this is not working on the "game.html".

I've also tried to change the iframe options but it's not working.
<iframe style="background-color: white;"/>

Can someone say why?
And what to do?
B
15
S
2
Posts: 7
Reputation: 904

Post » Sun Jun 11, 2017 6:11 am

Hi,

The game configuration you should control inside C2 such as the game background.

The index.html background you can change by editing even with something simple as a notepad the index.html file.
If you open that file just under the <title> you have:

<style type="text/css">
body
{
background-color: black;
color: white;
margin: 0;
padding: 0;
overflow: hidden;
}

so you can simply write your color there and save before uploading.
Thank you to Construct 2 for giving me the ability to create games without programming knowledge.
My games & gaming portal = DolyGames
If anyone wants to cooperate to help each other Win-Win please email me - I am always happy to discover new opportunities.
Cheers,
COSMOS
B
21
S
9
G
1
Posts: 77
Reputation: 2,181

Post » Sun Jun 11, 2017 9:57 pm

I did that too. But only worked when I added "execute javascript" into construct through a 'browser' event.
And then when I changed the exported html that worked. Otherwise the bg color wouldnt change.
B
15
S
2
Posts: 7
Reputation: 904


Return to How do I....?

Who is online

Users browsing this forum: TRMG, Yahoo [Bot] and 12 guests