SOLVED Distorted screen on actual machine

uni00

Member
Hello. I'm Japanese so I rely on Google translation. sorry. When I started the game made with EXPERIA5, the left side of the screen was distorted, and the right side of the screen had some objects visible. It is said that android puts garbage on the data outside the description, and it seems that it is visible. In unity, I should install another camera to the main camera and set [cullingMask] again, but I could not find such a function in GMS2. How can this screen disorder be improved? Please lend force.スクリーンショット (238).png
 

FoxyOfJungle

Kazan Games
Do you use surfaces? You need to clean the surface each time you use it, if applicable. You also need to enable an option to clear the view buffer in the room settings, it could be something related to that. What tests have you tried?
 

uni00

Member
Do you use surfaces? You need to clean the surface each time you use it, if applicable. You also need to enable an option to clear the view buffer in the room settings, it could be something related to that. What tests have you tried?
Thank you very much. I used GMS2 for the first time, so I didn't know what to do, so I could only look it up.
I was able to set up the room, but I didn't really understand the surface... Probably the game was ported from left to right so I could see the objects on the left.
This is the only programming code that uses the surface.
GML:
o_lamp_surface

--create--
surface=-1;
depth=-10000;

--step--
if(surface_exists(surface)){
    
    var _cw = camera_get_view_width(view_camera[0]);
    var _ch = camera_get_view_height(view_camera[0]);
    var _cx = camera_get_view_x(view_camera[0]);
    var _cy = camera_get_view_y(view_camera[0]);
    
    //target
    surface_set_target(surface);
    
    //drawing
    draw_set_colour(c_black);
    draw_set_alpha(1);
    draw_rectangle(0,0,_cw,_cw,0);
    
    gpu_set_blendmode(bm_subtract);
    
    with(o_lamp){
    
    draw_sprite_ext(sLight,0,x-_cx,y-_cy,0.5+random(0.05),0.5+random(0.05),0,c_white,1);
    
    }
    gpu_set_blendmode(bm_normal);
    
    //reset
    draw_set_alpha(1);
    surface_reset_target();
    draw_surface(surface,_cx,_cy);
      
    //reset
 
        
}

if (!surface_exists(surface)){
    var _cw = camera_get_view_width(view_camera[0]);
    var _ch = camera_get_view_height(view_camera[0]);
    
    surface = surface_create(_cw,_ch);
    
    surface_set_target(surface);
    draw_set_colour(c_black);
    draw_set_alpha(0.6);
    draw_rectangle(0,0,_cw,_cw,0);
    
    surface_reset_target();
}
Should I use surface_free()? But I'm not sure how to use this function...
 

Kyon

Member
Try resetting
draw_set_colour(c_black);
to
draw_set_colour(c_white);

after you're done with whatever you needed to be drawn in black.
 

uni00

Member
Try resetting
draw_set_colour(c_black);
to
draw_set_colour(c_white);

after you're done with whatever you needed to be drawn in black.
Thank you very much. Should I use [DrawEnd]Event? How do you do a function that resets colors? Excuse me. I can't find it even if I look it up in Japanese...
 

Kyon

Member
Thank you very much. Should I use [DrawEnd]Event? How do you do a function that resets colors? Excuse me. I can't find it even if I look it up in Japanese...
GML:
o_lamp_surface

--create--
surface=-1;
depth=-10000;

--step--
if(surface_exists(surface)){
   
    var _cw = camera_get_view_width(view_camera[0]);
    var _ch = camera_get_view_height(view_camera[0]);
    var _cx = camera_get_view_x(view_camera[0]);
    var _cy = camera_get_view_y(view_camera[0]);
   
    //target
    surface_set_target(surface);
   
    //drawing
    draw_set_colour(c_black);
    draw_set_alpha(1);
    draw_rectangle(0,0,_cw,_cw,0);
    draw_set_colour(c_white); //HERE

    gpu_set_blendmode(bm_subtract);
   
    with(o_lamp){
   
    draw_sprite_ext(sLight,0,x-_cx,y-_cy,0.5+random(0.05),0.5+random(0.05),0,c_white,1);
   
    }
    gpu_set_blendmode(bm_normal);
   
    //reset
    draw_set_alpha(1);
    surface_reset_target();
    draw_surface(surface,_cx,_cy);
     
    //reset

       
}

if (!surface_exists(surface)){
    var _cw = camera_get_view_width(view_camera[0]);
    var _ch = camera_get_view_height(view_camera[0]);
   
    surface = surface_create(_cw,_ch);
   
    surface_set_target(surface);
    draw_set_colour(c_black);
    draw_set_alpha(0.6);
    draw_rectangle(0,0,_cw,_cw,0);
    draw_set_colour(c_white); //HERE
    surface_reset_target();
}
 

uni00

Member
Hello. Thank you everyone for your answers. That was a really big help. With this, I will try it on a real machine. Thank you.
 
Top