16:9 scaler script

Rizlad

Member


So I created this script to scale a game with 16:9 ratio.
Basically it scales to edge for width then puts it to a 16:9 ratio via a surface scale.



///scr_resize

dw = display_get_gui_width(); // <== Seems to work better with 'get gui width' rather than just 'get width'.
dh = display_get_height(); // <== Vice-versa here== (weird)> o.0

view_wport[0] = dw;
view_hport[0] = dh;
// <== Fill screen with game==

sw = surface_get_width(application_surface);

if (sw > dw) {
sw = sw + (dw - sw);
// <== Set surface width to correct any difference.
}

if (sw/dh != 1.777777777777778) { // <== Could change these #'s the any ratios divided amount.
dh = sw/1.777777777777778; // <== (16 divided by 9 = 1.777777777777778 )
}

surface_resize(application_surface, sw, dh);




Works, I just thought I'd share for anyone interested and see if there's any additions or alterations anyone may have to suggest.
 
Top