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.

DarkBASIC Professional Discussion / 2d graphics for games with custom resolution

Author
Message
bergice
19
Years of Service
User Offline
Joined: 5th Jun 2007
Location: Oslo,Norway
Posted: 26th Oct 2010 20:20
Hi, i just have a short question here.

Lets say i made a game that went fullscreen and set the resolution to the desktop size.

Then i made a menu image say 1440x900 in resolution, which would fit well if i ran the game on my computer. Now if someone else was to run it or if i changed my resolution or connected it to a projector with a different resolution then this menu screen would not fit the window.

Now what can i do (except for making the menu image in lots and lots of different resolutions) to make this always fit. Could i scale the image to fit the screen, should i center the image? What is the best way to approach this?

51fa1db0ec7c4af52d93a6f5d0e86bc5


baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 26th Oct 2010 22:47 Edited at: 26th Oct 2010 22:48
Hi bergice, I tend to make my menu images fairly large but set to a 4:3 ratio (IE. 1280x960) then scale it based on the height of the display or the width depending which is larger than 4:3...



bergice
19
Years of Service
User Offline
Joined: 5th Jun 2007
Location: Oslo,Norway
Posted: 27th Oct 2010 21:52
Thanks baxslash, that code works pretty smooth.

51fa1db0ec7c4af52d93a6f5d0e86bc5


BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 27th Oct 2010 22:58
I would add to this that SvenB's image kit V2 in WIP includes a fantastic image resize function, to keep the graphics as near to the original in quality as possible.

http://forum.thegamecreators.com/?m=forum_view&t=176270&b=8

bergice
19
Years of Service
User Offline
Joined: 5th Jun 2007
Location: Oslo,Norway
Posted: 28th Oct 2010 02:49
Yea i was just looking at that, looks like it has some nice commands availible.

51fa1db0ec7c4af52d93a6f5d0e86bc5


Login to post a reply

Server time is: 2026-07-22 04:38:03
Your offset time is: 2026-07-22 04:38:03