Olivebates
Member
I have a piece of code, that should automatically scale the view to whatever size the window is, so no pixel distortion would happen, but for some reason, I am still experiencing pixel distortion? I shouldn't be dealing with any half-pixels as far as I can tell, so what is happening?
How it should look:
How it's looking after I resize the window:
GML:
// Create event
windowWidth = window_get_width();
windowHeight = window_get_height();
view_enabled = true;
view_visible[0] = true;
view_wport[0] = windowWidth;
view_hport[0] = windowHeight;
view_camera[0] = camera_create_view(0, 0, windowWidth, windowHeight, 0, -1, -1, -1, 0, 0);
camera_set_view_size(view_camera[0], windowWidth, windowHeight);
display_set_gui_size(windowWidth, windowHeight);
// Step event
if (windowWidth != window_get_width() or windowHeight != window_get_height())
{
window_set_size(floor(window_get_width()), floor(window_get_height()));
windowWidth = window_get_width();
windowHeight = window_get_height();
view_wport[0] = windowWidth;
view_hport[0] = windowHeight;
camera_set_view_size(view_camera[0], windowWidth, windowHeight);
display_set_gui_size(windowWidth, windowHeight);
}
How it should look:
How it's looking after I resize the window:
Last edited: