How do I change the html background

0 favourites
  • 8 posts
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • Is there an easy way to change the background behind the HTML5 game in C2? I'm referring specifically to the exported index.html. I know I can edit it after the fact, I just like to know if I can do it from within C2? I'm hoping there is a plugin...

  • Nope.

  • If I understood correctly...

  • If I understood correctly...

    Thank you!

    Edit 2: Tried this and it worked.

    var body = document.getElementsByTagName('body')[0];
    body.style.backgroundImage = 'url(http://localhost/background.png)';
    [/code:2cfpvwun]
  • You would be better off editing the index.html at this point.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You would be better off editing the index.html at this point.

    I just don't want to have to remember to edit the index.html after every version I export. I'll probably forget.

  • Make a feature request I guess.

    Im not sure that a runtime addition is the best method. More options like templates for the export would be better imo.

    I'd like an option for three columns with a header, and footer for example.

    But Construct2 isn't a html editor.....

  • Make a feature request I guess.

    Im not sure that a runtime addition is the best method. More options like templates for the export would be better imo.

    I'd like an option for three columns with a header, and footer for example.

    If it causes problems, I can always delete the browser object/events and edit the index.html directly in the final version. Templates is a good idea. We should have total control over the entire presentation.

    But Construct2 isn't a html editor.....

    Well, it is and it isn't. That's like trying to tell me my truck doesn't go off road. It goes off road!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)