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.

Newcomers DBPro Corner / A window issue

Author
Message
Saido
19
Years of Service
User Offline
Joined: 16th Oct 2004
Location: The Netherlands
Posted: 20th Oct 2004 02:50
Is there a command that will put my windowed app/game right in the middle of the screen.
now it always starts out in the upper left of my screen.
Dodo
20
Years of Service
User Offline
Joined: 8th Aug 2004
Location: eating lunch
Posted: 20th Oct 2004 04:34
set window position x,y



Part of solving the problem is actually noticing that the problem is there in the first place

Saido
19
Years of Service
User Offline
Joined: 16th Oct 2004
Location: The Netherlands
Posted: 20th Oct 2004 04:46
But if i set it that way it will not be in the middle anymore when the user changes his resolution.

Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 20th Oct 2004 08:51
Here is an equation to set it to the center, no matter the resolution or window size:

set window position (screen width()/2)-(windowsizex/2),(screen height()/2)-(windowsizey/2)

Just replace windowsizex with the x size of your window and windowsizey with the y size of your window. You don't really need those parenthese, but I put them in there just in case...

Xander Moser - Bolt Software - Firewall
Saido
19
Years of Service
User Offline
Joined: 16th Oct 2004
Location: The Netherlands
Posted: 20th Oct 2004 19:45
I mean in windows.
Is there a command that can put your game window in the middle of the screen or a command that can see your current windows resolution.

Login to post a reply

Server time is: 2024-09-23 03:17:06
Your offset time is: 2024-09-23 03:17:06