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 / Resolution Pick Snippet...

Author
Message
Nicholas Thompson
21
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 16th Sep 2006 02:25
For my Settlers Of Catan WIP, I've made a simple resolution picker (for the beta versions)...


Question: What should the default resolution be and how would I get it to chose it without assuming that res is possible?

Also - does anyone know a neat and simple way of having it so holding the button down makes the choice step in a controllable way (like once every 0.5 seconds?) - like Windows does if you hold a key down... There is a short pause and then repetition (but not at the max speed of your computer!!)

I hope this is usefull to someone...

[center]
Agent Dink
22
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 16th Sep 2006 06:06
Well, I'd say 1024 x 768 x 32 is a good middle of the road resolution to go with, but can't DBP return the desktop resolution? If so just have your game default to the desktop resolution.

Sometimes the only way over a wall is to pile up enough bodies to climb over - Dave W.
Uncle Sam
20
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 16th Sep 2006 08:31
Quote: "Question: What should the default resolution be and how would I get it to chose it without assuming that res is possible?"




Quote: "Also - does anyone know a neat and simple way of having it so holding the button down makes the choice step in a controllable way (like once every 0.5 seconds?) - like Windows does if you hold a key down... There is a short pause and then repetition (but not at the max speed of your computer!!)"


This shouldnt be too hard. I'll use the control key for an example:



Change the "10" to make the delay longer or shorter.



Uncle Sam
Nvidia Geforce 7600 GS 256MB PCIEx, 2.66 GHZ Pentium 4 proccessor, 768MB RAM
Need particles? Click here!
Scraggle
Moderator
22
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 16th Sep 2006 11:05 Edited at: 16th Sep 2006 11:17
Uncle Sam is almost there. The problem with that code is that it will have a different delay speed depending on the frame rate. Instead you need to use a timer to control the delay.
Here:


Change the variable 'Delay' to adjust the delay in milliseconds (1000 = 1 second)

As for the default resolution; it is unlikley that many people will be using less than 1024 x 768 but there will still be some out there. I would say go with 800 x 600 as a default but give the user the option to increase it.

Better still would be to set the resolution to the users desktop resolution, like this:

You will need an external plug-in to do it. The Enhancement Pack has the commands you need but there are free alternatives around that will do the job. IanM's Matrix plug-in is one of many that spring to mind (and is too damn useful not to have installed!).


Lord Raoul
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location:
Posted: 16th Sep 2006 15:21
Just a thought of mine, I am not a fan of the forcing the player to run the game at desktop resolution idea.

To me it seems flawed in that quite often desktop resolution is higher than you would use in a game, for example my "desktop" resolution is 1440*900, and I'm fairly sure if a game ran at that resolution then it would be slowed down considerably.

Don't know if it's just me and my friends that do that, but perhaps if you are going to make it detect the desktop resolution then make that the default one but allow it to be changed ingame incase it is unsuitable?
JerBil
22
Years of Service
User Offline
Joined: 8th May 2004
Location: Somewhere along the Z axis...
Posted: 16th Sep 2006 20:58
They should have at least the option to run at desktop resolution,
since any images at that res will not be stretched and won't look crappy.

Ad Astra Per Asper
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 17th Sep 2006 00:02
Here's some code that will grab desktop size;



Boo!
Scraggle
Moderator
22
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 17th Sep 2006 00:04
There you go! Spooky has saved you the trouble of downloading IanM's plug-in.

However ... I still recommend that you download it, because it has a lot more functionality than desktop dimensions and is very, very useful!


Uncle Sam
20
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 17th Sep 2006 01:18
Heh, I thought of that, but I just assumed he was going to lock the framerate.

Uncle Sam
Nvidia Geforce 7600 GS 256MB PCIEx, 2.66 GHZ Pentium 4 proccessor, 768MB RAM
Need particles? Click here!
Profit
20
Years of Service
User Offline
Joined: 19th Feb 2006
Location: United States
Posted: 17th Sep 2006 03:08 Edited at: 17th Sep 2006 03:49
Uncle Sam, you make a pretty reasonable point there.

common people are walking in line.

Mitsu Fly Ride.

Login to post a reply

Server time is: 2026-06-12 05:06:59
Your offset time is: 2026-06-12 05:06:59