Posted By: alibaba
Updating render target size bug - 04/12/20 15:44
Hey guys, I'm trying to update a panel which receives it's image from a view. When I change the resolution with "h" and then update the sizes with "j" it works until I have a resolution of 1270x720. Why does that happen? Am I missing something here? Please try this code with a level of your choice and tell me if you get the same result.
EDIT: Funny thing is, if I press "h" five times to reach the 1280x720 immediately and update only then, it works!
EDIT: Funny thing is, if I press "h" five times to reach the 1280x720 immediately and update only then, it works!
Code
int ab_x[5]={800,1024,1024,1152,1280}; int ab_y[5]={600,768,600,864,720}; PANEL* bgP; VIEW* bgV; int num = 0; void on_h_event() { wait(2); num = cycle(num+1, 0 ,5); video_set(ab_x[num],ab_y[num],0,2); } void on_j_event() { safe_remove(bgV.bmap); bgV.bmap = bmap_createblack(screen_size.x,screen_size.y,24); bgP.bmap = bgV.bmap; bgV.size_x = screen_size.x; bgV.size_y = screen_size.y; bgP.size_x = screen_size.x; bgP.size_y = screen_size.y; } void main() { wait(1); level_load("test2.wmb"); wait(3); bgV = view_create(10); bgV.bmap = bmap_createblack(screen_size.x,screen_size.y,24); set(bgV,SHOW); bgP = pan_create("",0); bgP.bmap = bgV.bmap; set(bgP,SHOW|TRANSLUCENT|LIGHT); vec_set(bgP.blue,vector(120,120,120)); bgP.alpha = 50; }