background_color?

So in my old imported project I was using background_color in a few places, and GM:S2 converted those lines. So now I am trying to update my code and get rid of the conversion scripts.
My question is, what should I add instead? Should I add a layer using layer_background_create and then use another command for coloring it (the background color I want is currently stored in a global variable)?
Also, how do I set the depth so that it will be behind everything else. the depth-command is apparently also deprecated.
What is the proper way of doing the backgrounds these days?
 

Ommn

Member
use the code:
GML:
var __layer_name="Compatibility_Colour";//open room and copy your layer name.
var lay_id = layer_get_id(__layer_name);
var back_id = layer_background_get_id(lay_id);
layer_background_blend(back_id, c_white );//change c_white to your color
 
use the code:
GML:
var __layer_name="Compatibility_Colour";//open room and copy your layer name.
var lay_id = layer_get_id(__layer_name);
var back_id = layer_background_get_id(lay_id);
layer_background_blend(back_id, c_white );//change c_white to your color
Lots of steps just to change background-color, lol. But it worked, thanks!
Is it also possible to change depth? I want the layer to be pushed back as far as possible.
 
On which layer do you propose to place that instance?
I have a persisent object being created in the 1st room of the game. On room start, I let that object create another object at depth 160000 that draws a rectangle filling up the screen (each room is only 480x230px).
Should I use the layer-commands instead? What's the pro/cons of doing so instead of my solution?
 

Nidoking

Member
So you're creating an anonymous layer in each room instead of having a Background layer. I guess, but it's creating an instance where you could just define a background layer with a sprite.
 
Top