I've noticed that when I begin my game, it opens up towards the top of the screen. I'd rather have it in the center, so I can grasp the players attention immediately. Note that the window doesn't have the resize option.
How would I automatically adjust the games window to open up in the center of the screen?
Example: Decadence
Thanks!
-84.
Edit: I just realized that Decadence doesn't center it to the screen but rather loads it to the last pos it was in.
ID:321586
Feb 21 2012, 6:58 am (Edited on Feb 21 2012, 1:05 pm)
|
|
You could use Javascript to get player's screen resolution.
That'll allow you to position window at the center. Window_Position_X = Resolution_Width / 2 - Window_Width / 2 |
I tried doing that, Zaoshi, but the position of the window kept going off screen. Towards the northwest. I created an output for the results which came out to be -400x-320. In the variables, I did an abs() to make them positive but it still didn't center the window.
|
-400x-320 sounds like your window is 800x640, meaning getting resolution failed.
|
Well, after that attempt, a friend pointed out the WinFX Library and showed me that there are a few procedures that get the resolution and it also had a procedure to center the window. So I decided to implement it.
Thanks for the help! |
something like that.