Use player File for room background

I

igorcarlier

Guest
Hello Everyone , loving the studio so far , still doing baby steps. I want to ask players to upload a image that will be used as background for the room. what am I doing wrong ?
The room opens but the image does not apply as background.

var back = layer_background_get_id(room0);
faceplate = get_open_filename("image file|*.png", "");
sprite8 = sprite_add(faceplate,1,true,true,0,0);
layer_background_change(back,sprite8);
 

Homunculus

Member
layer_background_get_id requires a layer id, not a room id (since a room can have more than one background, you have to be specific here). The manual entry for this function provides exactly the code you require as an example (minus the code to load the sprite, but that part looks ok to me).
I also just read in the docs that layer_background_change is deprecated in favor of layer_background_sprite.
 
Top