Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

RenJS

HTML5 Visual Novel creation made easy and free · By lunafromthemoon

Scene color from black to another color

A topic by Lapinay created Mar 27, 2019 Views: 253 Replies: 2
Viewing posts 1 to 3

Hi. I'm resizing the scene. For the game i'm working on, i want the background image to be smaller than the scene. The scene color is black (as seen on image attached). I'd like to change it to another color. I didn't find where to change it. Could you help :) please.

Developer

Hello Alix, to change the background color you have to add a line of code at the start of the game. The line is this:

game.stage.backgroundColor = "#4488AA";

Using the color you like in hex format, of course. And you should add it in the file Preload.js, line 137, as the first line of the function.

Let me know if it worked.

Cheers!

(3 edits)

Hi. i've added it to this function like the following in Preload.js, it works, but people have to know that the change can been seen after a while on web browsers , it may be the cache or something. Thank you lunafromthemoon  :)  I've noticed that the change is applied to the stage but not on the languages menu screen (Demo: RenJSMultilanguage-master). That's ok for me, but some one may need the change here too.

create: function() {
    //init game and start main menu
    game.stage.backgroundColor = "#FFFFF";
    game.state.add('init', init);
    game.state.start('init');

  }