Different resolution for GameScreen and others

8 replies [Last post]
Posts: 1030

I'd like to keep the pre-ingame screens at 800x600 while the user can set the GamePlayScreen size in the options menu. How can I do this? (I'm really not good with panels and such >_>)

Asking because there's a bunch of silly people who set the size larger than their screen resolution so the option buttons goes off screen and they can't change it anymore aside from manually editing the settings file >_>

EDIT:

Made it so people can't set the resolution higher than their screen resolution, but the pre-ingame screens are made for 800x600 so it'd be nice if those could stick that way regardless of what is in the settings.

Posts: 164

I'm not really familiar with SFML (uses OpenGL?). You might have to create another graphics device when that state comes up (or whatever it's called in SFML, like a GameWindow or RenderWindow or something of that sort), unless theirs a way to change the resolution or that object after construction/initialization. XNA does this under the hood with virtual graphics devices I think? Anyway, maybe SFML has a set res or set size method on it's window?

Posts: 1691

This would be done at the NetGore level. No need to get SFML involved - its just a matter of changing resolution based on the screen currently active.

Why not just provide a "Are you sure you wish to use these settings?" message box? Or some other kind of confirmation? Forcing certain screens at specific resolutions would be quite annoying.

Posts: 1030

No, the pre-ingame screens are made specifically for 800x600 resolution. It looks screwed up if it's bigger, the ingame screen can be way bigger.

So where in the code can I set this?

Posts: 1691

I can't give too much without looking into things (and I'm too swamped right now to do so), but I believe you'd just have to set the resolution on whatever the display manager (can't remember exactly what its called, but I believe its what Game is derived from and its the only thing that lets you set resolution) is when the GameScreen is activated/focused (OnActivate or something... its one of those overloads).

Posts: 1030

When I assign a value to GameData.Screensize in the Initialise() method in for example the MainmenuScreen, the image looks distoted and wave-y because it looks like the rendering adjusted but the actual form size is still whatever is loaded from the settings file.

Posts: 1691

Then just assign the size to the form, too.

Posts: 1030

Pardon me for asking but how do I do that? >_>;

Posts: 180

Properties of the form.