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 / DBpro window distorted on widescreen laptop

Author
Message
edge ogg
16
Years of Service
User Offline
Joined: 20th Feb 2010
Location: cornwall
Posted: 21st Feb 2010 21:26
my laptop screensize is 1366,768
is there a way to control maximum window settings to avoid stretching when maximize window
my code

display mode 800,600
set window size 800,600
=PRoF=
23
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 21st Feb 2010 22:26
Well, try changing to a widescreen resolution, either 16:10 or 16:9 depending on u'r laptop; instead of 800 x 600 which is 4:3

720 x 480, 1280 x 800, 1440 x 900 are common widescreen resolutions and will all display "unstretched"

KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 22nd Feb 2010 00:30
aspect# = screen width() / screen height()
set camera aspect 0, aspect#

May also help.

edge ogg
16
Years of Service
User Offline
Joined: 20th Feb 2010
Location: cornwall
Posted: 22nd Feb 2010 21:44
Thanks but i think coding option is the way to go on this one
I tried set camera aspect but it dosent stop the screen distorting
I think I need some control over the actual window if thats not possible I might try using 2 cameras with camera 1 as a fullscreen background and run the game in camera 2
any ideas not sure how to do yet
thanks
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 22nd Feb 2010 23:55
Set your display mode and window size (both of them) to DESKTOP WIDTH() and DESKTOP HEIGHT()



If you set your app to a screen type of 'fulldesktop' in the new IDE, then this will just work. If you have it in a windowed mode instead, then uncomment the two lines setting the window loayout and position.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Feb 2010 00:17 Edited at: 23rd Feb 2010 00:21
EDIT I was confused by use of the word "distorting" instead of "stretching". I see you are talking about "stretching" in your first post.
edge ogg
16
Years of Service
User Offline
Joined: 20th Feb 2010
Location: cornwall
Posted: 23rd Feb 2010 11:07
Yes thats sorted it ive now got an 800 x 600 in the center of the screen with a black background just what i wanted.
So is now possible to give the user the option to enlarge the screen ?
dont make it too easy for me just a pointer
thanks for help
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 23rd Feb 2010 17:06
Quote: "EDIT I was confused by use of the word "distorting" instead of "stretching". I see you are talking about "stretching" in your first post. "


Me too.

edge ogg
16
Years of Service
User Offline
Joined: 20th Feb 2010
Location: cornwall
Posted: 24th Feb 2010 10:26
Yes sorry my mistake thanks for your help
bfrnhout
17
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Vlissingen
Posted: 7th Mar 2010 22:55
i can give you a pointer in your stretching of your screen. I figure it out and have the solution on whatever screen the game is playing. its stil play the 800 X 600 resolution. is a good way. whit black bands on the side
look in the API for getting the type of screen window is using and from there calculate the aspect ratio of the screen. from there out you can recalculate the width of your view. eg, you make than 1024 X 600. and you wil use only the center part of the screen. IF you want the solution i can give it to you.

Games is live so to live do the games
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 8th Mar 2010 13:13
Quote: "IF you want the solution i can give it to you"

I wouldn't mind seeing the code for this...?

Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 8th Mar 2010 20:31 Edited at: 8th Mar 2010 20:32
Quote: "look in the API for getting the type of screen window is using and from there calculate the aspect ratio of the screen."


Or, if using fullscreen..

And for windowed mode...


My signature is NOT a moderator plaything! Stop changing it!
bfrnhout
17
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Vlissingen
Posted: 11th Mar 2010 21:11
the solution i used to correct the steching is as follow.



this is a partly code i have.
Resolution types are constants numbered from 1 trough 10. So when the calculation is giving a match you got the number back.

KEEP IN MIND that you have do this before you call any kind of set dispay. Otherwise you get the screen you made as resolution.
this works for all kind of resolution in a 4:3 format.
From this point on you have to calculate where you put your piece of the screen. including black bands on the side (Or pick you owen color or picture)

Games is live so to live do the games

Login to post a reply

Server time is: 2026-07-27 07:33:57
Your offset time is: 2026-07-27 07:33:57