I'm sure this will be easy for somebody to solve. I was trying to use a routine from elsewhere on the forum to scale my game to run on different resolutions using CREATESCREEN and STRETCHSPRITE, but I can't get it to work correctly when testing on windows.
Here's a quick example:
CREATESCREEN uses 800,480 and this should then be scaled to the screensize using STRETCHSPRITE. It's working for for higher resolutions (e.g. 1024,768), but produces strange results at lower resolutions (e.g. 640,480).
Please could somebody point out the (probably) glaringly obvious mistake!
Thank you.
Here's a quick example:
Code (glbasic) Select
// --------------------------------- //
// Project: testzoom
// Start: Friday, July 06, 2012
// IDE Version: 10.283
// SETSCREEN 800,480,0 //original scale - works fine
// SETSCREEN 1024,768,0 // scaling up - works fine
// SETSCREEN 640,480,0 //scaling down - doesn't work
SETSCREEN 320,240,0 //scaling down - doesn't work
ALLOWESCAPE TRUE
GLOBAL xres,yres
GETSCREENSIZE xres,yres
CREATESCREEN 1,100,800,480
USESCREEN 1
CLEARSCREEN RGB(0,0,255)
DRAWRECT 100,100,600,280,RGB(255,0,0)
USESCREEN -1
CLEARSCREEN RGB(0,0,0)
STRETCHSPRITE 100,0,0,xres,yres
SHOWSCREEN
MOUSEWAIT
END
CREATESCREEN uses 800,480 and this should then be scaled to the screensize using STRETCHSPRITE. It's working for for higher resolutions (e.g. 1024,768), but produces strange results at lower resolutions (e.g. 640,480).
Please could somebody point out the (probably) glaringly obvious mistake!
Thank you.