Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Streaching the GUI?

Author
Message
CokeBoi
15
Years of Service
User Offline
Joined: 19th Jun 2009
Location:
Posted: 11th Oct 2009 22:37
HI! I was wondering, since my game will go on multiple computers all with different resolutions, is there a way to stretch all the pictures so they fit? (e.g an 800x600 back ground on a 1600x1200. Is there a way to stretch the picture?)

TY in advanced and if u need me to explain anything else feel free to let me know!

LOL
SFCBias
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location: Hephzibah, GA, USA
Posted: 11th Oct 2009 23:11
if it works on your computer than itll work on all(should) or to be sure you could set a resolution that is generally compatible with all moniters (e.g dbSetDisplayMode(800,600,32); )

if(You.AddCode.toPost)TGC.Users.CanHelp = true;
else return NoCodeMessage;
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 12th Oct 2009 08:30 Edited at: 12th Oct 2009 08:31
If you make a sprite out of the picture, you can use dbStretchSprite or dbSizeSprite to scale it. However, the picture will be distorted if the X/Y ratio of the new resolution is different. You may try to calculate the new size with a fixed X/Y ratio, at the price that parts of the picture will overflow the screen (like when you zoom a traditional TV picture onto a wide-screen monitor).

There are functions to query the current desktop resolution on the user's computer. Recent Dark GDK versions should contain the commands dbDesktopWidth() and dbDesktopHeight(), but you can use Windows functions as well: GetSystemMetrics(SM_CXSCREEN) and GetSystemMetrics(SM_CYSCREEN).

Login to post a reply

Server time is: 2024-11-20 13:30:18
Your offset time is: 2024-11-20 13:30:18