I am working on a map with a complete overhaul of the UI and I have noticed a few things that were strange and are now becoming a problem. First let me preface this a little with the method that I am customizing the UI. I am creating dialogs then hiding their backgrounds and attaching images to the dialog to create my own UI.
That being said, here's where things become strange. I run the game at 1920x1080. One would think that If i were to create a dialog that is 1920x1080, hide the background then attach an image to this at 0,0 offset with the dimensions of 1920x1080 that it would fill the screen. It turns out this is not the case. In fact in order to fill my screen the dimensions apparently have to be set to 2132x1202. I have no idea why this dimension but after much trial and error I got it to fit. The problem is now that this now ONLY fits for people who run at 1920x1080. When I run this at another resolution, as expected, portions of the UI are now off the screen.
I could solve all of this if there was a way for me to retrieve the screen resolution that the player is using, I could then run all my dimensions and offsets through a simple function and set them based on the user screen dimensions. Does anyone know of a method of doing this?
Usual solution is to set your dialog to fullscreen, this way it will take the whole screen, all other part of your UI need to be anchored to the screen (bottom,left, right, corner etc..) To make sure it will work on all screen resolution. Dialog size seem to be based on pixel and not scaled with screen resolution
right, the problem is i have ui elements that cover the entire width of the screen including buttons hidden by images that require precise positioning based on the artwork for the ui, i can't just offset by a pixel amount based on say left or right because then once they line up in one resolution they no longer will line up in another...
changing the ui design to be anchor based vs the full width wouldn't be the ideal solution. I would almost rather start it off with a popup asking them what resolution they are playing in, then adjust accordingly, however if there was a way to auto-detect the settings that would be the ideal solution
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I am working on a map with a complete overhaul of the UI and I have noticed a few things that were strange and are now becoming a problem. First let me preface this a little with the method that I am customizing the UI. I am creating dialogs then hiding their backgrounds and attaching images to the dialog to create my own UI.
That being said, here's where things become strange. I run the game at 1920x1080. One would think that If i were to create a dialog that is 1920x1080, hide the background then attach an image to this at 0,0 offset with the dimensions of 1920x1080 that it would fill the screen. It turns out this is not the case. In fact in order to fill my screen the dimensions apparently have to be set to 2132x1202. I have no idea why this dimension but after much trial and error I got it to fit. The problem is now that this now ONLY fits for people who run at 1920x1080. When I run this at another resolution, as expected, portions of the UI are now off the screen.
I could solve all of this if there was a way for me to retrieve the screen resolution that the player is using, I could then run all my dimensions and offsets through a simple function and set them based on the user screen dimensions. Does anyone know of a method of doing this?
@albatross4242: Go
Usual solution is to set your dialog to fullscreen, this way it will take the whole screen, all other part of your UI need to be anchored to the screen (bottom,left, right, corner etc..) To make sure it will work on all screen resolution. Dialog size seem to be based on pixel and not scaled with screen resolution
@progammer: Go
right, the problem is i have ui elements that cover the entire width of the screen including buttons hidden by images that require precise positioning based on the artwork for the ui, i can't just offset by a pixel amount based on say left or right because then once they line up in one resolution they no longer will line up in another...
changing the ui design to be anchor based vs the full width wouldn't be the ideal solution. I would almost rather start it off with a popup asking them what resolution they are playing in, then adjust accordingly, however if there was a way to auto-detect the settings that would be the ideal solution