Recently, I was going to implement and options menu into my game, but I haven't been able to figure out how changing resolution, conceptually, would work. Do I have multiple versions of the same texture at different resolutions, do I just change the area of which the texture would render, or some other option?
|
Conceptually, games can adjust to screen resolutions by scaling UI elements. If you want to take the easy route and use Unity's UI, this can be done pretty easily with a Canvas Scaler. I don't think that SFML has a canvas scaler and a well-made one can get pretty involved. A simpler canvas scaler has a reference resolution which is used to build your UI on. Then the UI elements are simply resized to the new resolution based on the one they were designed with. For example, if the reference resolution is 800x600 and the device's screen resolution is 1000x1000, elements' height would be multiplied by 1.25 and width by 1.66. Keep in mind that pivot points matter when resizing elements. Alternatively, you could use a GUI library mentioned here: http://en.sfml-dev.org/forums/index.php?topic=13590.0. |
|||||||||
|