I have been trying to create a background from a surface. Everything is ok until I call background_create_from_surface. This is the code:
//Create BG and add it var pf; pf=obj_playField; var sf; sf=surface_create(room_width,room_height); var i,j; i=0; j=0; surface_set_target(sf); draw_background(bg_image,0,0); surface_reset_target(); var bg; bg=background_create_from_surface(sf,0,0,room_width,room_height,false,false);
I'm running this outside a draw event. I'm trying to build a bg resource to use it later, but when I call background_create_from_surface the game is killed.
As a side note I must say this happens on IOS, on Windows it doesn't happens.
Does anybody see anything I'm doing wrongly? Is it a bug? I would really apreciate any help.
Thanks in advance.