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 / Easy way to scale down the whole screen?

Author
Message
JamesWalker101
16
Years of Service
User Offline
Joined: 14th Apr 2010
Location: England
Posted: 28th Jul 2013 13:49 Edited at: 28th Jul 2013 13:56
I am making a 2D sprite based game, and I have created the interface as one 1920x1080 png file, so people with high resolutions can use it. When I run it, I only see part of the sprite because my monitor has a 1366x768 resolution (cause I bought a £60 monitor. Sorry.) I could do the following:



(I think thats right.), but then I have to scale loads of text with this, and I would run into loads of problems.
So is there a easy way to do this? Is there code that just scales everything down? Plugin?

I'm using the latest DBpro on windows 7.

Thanks

EDIT: I tried the IDE options, setting fullscreen res to 1920x1080x32, but i get error 1507, 32 bit not supported by available hardware, which it is. (ATI HD 6750 graphics, windows 7, and a 32 bit monitor.)
PirateJohn
14
Years of Service
User Offline
Joined: 4th Aug 2011
Location: California
Posted: 29th Jul 2013 01:36
I made a fullscreen game a while back and in my Variable Declarations subroutine, I get the screen width and height and call them DisplayX and DisplayY. Throughout the program, whenever I need to place something, instead of typing, say:

SPRITE 1, 1050, 100, 1
SCALE SPRITE 1, 150

I type:

SPRITE 1, INT(DisplayX*0.55), INT(DisplayY/10.8),1
SCALE SPRITE 1, DisplayX*0.0777

Basically, I design the screen using the coordinates of my own 1920x1080 monitor, then convert them to decimals by dividing the number by the max resolution.
JamesWalker101
16
Years of Service
User Offline
Joined: 14th Apr 2010
Location: England
Posted: 29th Jul 2013 11:07 Edited at: 29th Jul 2013 12:10
Quote: "
SPRITE 1, INT(DisplayX*0.55), INT(DisplayY/10.8),1
SCALE SPRITE 1, DisplayX*0.0777

Basically, I design the screen using the coordinates of my own 1920x1080 monitor, then convert them to decimals by dividing the number by the max resolution."


Ok thanks i will start doing that. It may be a bit harder since I am not 1080p though, I'll work something out.

EDIT: I will try when I upgrade to indigo, dbpro keeps losing my work.
JamesWalker101
16
Years of Service
User Offline
Joined: 14th Apr 2010
Location: England
Posted: 29th Jul 2013 12:41
I got it worked out. So for anyone else :

To find the width scale, do currentres/the res you are converting from(1080p)*100.
To display the sprite, 900*widthscale/100
To scale the sprite, 1*widthscale
PirateJohn
14
Years of Service
User Offline
Joined: 4th Aug 2011
Location: California
Posted: 30th Jul 2013 08:31
Quote: "Ok thanks i will start doing that. It may be a bit harder since I am not 1080p though, I'll work something out."


Doesn't matter if it's 1080 or not. The only reason I used that as the baseline is because it happens to be the resolution of my monitor. You can use your own monitor's resolution as the baseline and it will work just as well.
basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 30th Jul 2013 14:21
i don't know if i understand you right but if you want u can use

set display mode .......
set window size desktop width(), desktop height()

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 30th Jul 2013 15:38
It's tricky, this issue actually made me switch from 2D sprites, to 3D plains for my game - just so I could take sensible action to support all those different resolutions.

I mean, would it be at all possible for you to do the same? - the benefits in using a fake 2D engine are very worthwhile and it would let your game run at any resolution and automatically scale everything for you. Could you make your own sprite library using 3D plains instead?

I got a fever, and the only prescription, is more memes.

Login to post a reply

Server time is: 2026-07-07 00:48:26
Your offset time is: 2026-07-07 00:48:26