Kyon
Member
Hello! I'm really trying to use surfaces in my game, I've finally managed to make a nice lightning effect, but it drops the fps from 60 to 45.
This is the surface I use. (if i delete this script the fps is back to 60)
This is what the surface does (the lightning):
Am I doing something wrong?
Or is this normal when using surfaces?
Thanks!
This is the surface I use. (if i delete this script the fps is back to 60)
Code:
surface_set_target(global.light){
draw_clear_alpha(c_black,1);
draw_set_blend_mode(bm_subtract);
with (obj_player){
alphalight=choose(.8,.8,.8,.75,.72,.77,.83,.76,.6);
draw_sprite_ext(spr_oillamplight,1,itemx,itemy,1,1,image_angle,image_blend,alphalight+.1);
draw_sprite_ext(spr_oillamplight,1,itemx,itemy,2,2,image_angle,image_blend,0.1);
}
draw_set_blend_mode(bm_normal);
surface_reset_target();
}
if surface_exists(global.light) {
draw_surface(global.light,0,0);
} else {
global.light=surface_create(room_width,room_height);
}
Am I doing something wrong?
Or is this normal when using surfaces?
Thanks!