• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM [SOLVED] Surface resize

marasovec

Member
I'm trying to resize application_surface so it looks more and more pixelated but it doesn't seem to do anything
I guess I'm just missing something obvious

CREATE EVENT:
Code:
surf = -1;
w = 800;
h = 600;
DRAW EVENT:
Code:
if !surface_exists(surf)
    {
    surf = surface_create(surface_get_width(application_surface), surface_get_height(application_surface));
    surface_copy(surf, 0, 0, application_surface);
    }
else
    {
    if w > 8 w--;
    if h > 6 h--;
    surface_resize(surf, w, h);
 
    draw_surface_stretched(surf, view_xview[0], view_yview[0], 800, 600);
    }
(application_surface is enabled)
 

Simon Gust

Member
My suggestion
CREATE
Code:
surf = -1;
w = view_wview;
h = view_hview;
DRAW
Code:
if !surface_exists(surf)
{
    surf = surface_create(surface_get_width(application_surface), surface_get_height(application_surface));
}
else
{
    if w > 8 w--;
    if h > 6 h--;
   
    surface_resize(surf, w, h);
    surface_set_target(surf);
    draw_clear_alpha(0, 0.0);
    draw_surface_stretched(application_surface, 0, 0, w, h);
    surface_reset_target();
    draw_surface_stretched(surf, view_xview, view_yview, view_wview, view_hview);
}
Or alternitavely, just resize the application surface.
 

NightFrost

Member
EDIT - Wait, I think I misunderstood what you're trying to accomplish. Are you trying to create a zoom effect or pixelate everything that is on the app surface?
 

Mike

nobody important
GMC Elder
Application surface is the one surface you never have to check exists. You can even resize it right at the start before drawing happens, as it remembers this size for the first time it's used.

Also not sure why you're copying the app surface. Just issue a resize, and it'll resize next draw frame.
 
Top