I have gotten several complaints that some of my dialogs appear off screen. I have looked around at various threads, but none of them tell me exactly what I need to know.
Different monitors have different screen resolutions. I found a somewhat old library that can get the aspect ratio and what not, but is that still necessary? Is there an easier way?
Also, do I have to use the same anchor for everything? Is there a specific anchor I should use? If I stick with the same anchor for everything, will the dialogs look right on all size monitors?
Sorry if this is a stupid question, I haven't done anything with dialogs before and don't understand how they work.
First thing you need to know about dialogs is that all the numbers (width, height, offset) are NOT pixels* and max width and height are not your actual monitor resolution. They are a "virtual resolution" that is based on the 1600x1200 resolution. Even if you set it to the lowest 1024x768 res, the ui size will still be 1600x1200.
There's a tutorial about it. What it basically says is that the height of the screen is always 1200 ui units and the width is based on the aspect ratio, but if you want everything to fit on-screen regardless of aspect ratio, just limit your dialogs to 1600 width and 1200 height, and use an anchor that centers the dialog horizontally (center, top center, bottom center).
If you want dialogs at the edge or in the corner of the screen for both widescreen and normal resolutions, give them the appropriate anchor (top left, right, buttom left, etc). Be aware that if you have any dialogs in the middle of the screen, they might overlap with the ones in the edges.
If you have a widescreen monitor, the best way to test if your UI is looking properly in non-wide aspect ratio is to switch to windowed mode and set a non-wide resolution (my windowed mode always sets to 1024x768, so I don't even have to change it).
<sub>*Only exception I know is the "get mouse UI position" function, which returns actual pixel resolution... that's how that Get Resolution library works.</sub>
I have gotten several complaints that some of my dialogs appear off screen. I have looked around at various threads, but none of them tell me exactly what I need to know.
Different monitors have different screen resolutions. I found a somewhat old library that can get the aspect ratio and what not, but is that still necessary? Is there an easier way?
Also, do I have to use the same anchor for everything? Is there a specific anchor I should use? If I stick with the same anchor for everything, will the dialogs look right on all size monitors?
Sorry if this is a stupid question, I haven't done anything with dialogs before and don't understand how they work.
Great to be back and part of the community again!
Are you anchoring on the center? That's probably the easiest way to push something off the screen.
It's all about depending on where you want your stuf placed. You want the upper right corner? Use anchor top right and negative offsets. And so on.
Go play Antioch Chronicles Remastered!
Also, coming soon, Antioch Episode 3: Thoughts in Chaos!
Dont like mapster's ugly white? Try Mapster's Classic Skin!
First thing you need to know about dialogs is that all the numbers (width, height, offset) are NOT pixels* and max width and height are not your actual monitor resolution. They are a "virtual resolution" that is based on the 1600x1200 resolution. Even if you set it to the lowest 1024x768 res, the ui size will still be 1600x1200.
There's a tutorial about it. What it basically says is that the height of the screen is always 1200 ui units and the width is based on the aspect ratio, but if you want everything to fit on-screen regardless of aspect ratio, just limit your dialogs to 1600 width and 1200 height, and use an anchor that centers the dialog horizontally (center, top center, bottom center).
If you want dialogs at the edge or in the corner of the screen for both widescreen and normal resolutions, give them the appropriate anchor (top left, right, buttom left, etc). Be aware that if you have any dialogs in the middle of the screen, they might overlap with the ones in the edges.
If you have a widescreen monitor, the best way to test if your UI is looking properly in non-wide aspect ratio is to switch to windowed mode and set a non-wide resolution (my windowed mode always sets to 1024x768, so I don't even have to change it).
<sub>*Only exception I know is the "get mouse UI position" function, which returns actual pixel resolution... that's how that Get Resolution library works.</sub>