Changing Background Sprite Frame? ( image_index)

A

Anomaly

Guest
Is changing background sprite frames an available option?
I've been trying different methods but nothing seems to be able to accomplish this.

does anyone know about this?
thanks!
 

Jakylgamer

Member
assuming this is for gms2
Code:
var lay_id = layer_get_id("Background"); 
var back_id = layer_background_get_id(lay_id); 
layer_background_index(back_id, 0); //set index to whatever you need it to be
layer_background_speed(back_id,0); //set animation speed to 0
 
A

Anomaly

Guest
assuming this is for gms2
Code:
var lay_id = layer_get_id("Background");
var back_id = layer_background_get_id(lay_id);
layer_background_index(back_id, 0); //set index to whatever you need it to be
layer_background_speed(back_id,0); //set animation speed to 0

oh man thank you so much .
i was close one time ... looking at my commented muted old tries.
!
 
assuming this is for gms2
Code:
var lay_id = layer_get_id("Background");
var back_id = layer_background_get_id(lay_id);
layer_background_index(back_id, 0); //set index to whatever you need it to be
layer_background_speed(back_id,0); //set animation speed to 0
Thanks, I used your code as well. Works like a charm. I used it to randomize background color each time a room starts.
 
Top