GMS 2 GameMaker Background Layer Unclear...

NoFontNL

Member
I have a background layer called bg_random.
But this code:
Code:
randomize();
var lay_id = layer_get_id("bg_random");
var back_id = layer_background_get_id(lay_id);
global.backgr=choose(bg_regular,bg_dark);
layer_background_index(back_id, global.backgr);
doesn't work.
Nor does this work:
Code:
layer_hspeed(layer_background_get_id(layer_get_id("bg_random")),0);
What do I do (wrong)?
 

NoFontNL

Member
Yes, I want to change the background image. I don't wanna create a new layer. And why doesn't the hspeed thing work?
 
Top