3/17/2023 0 Comments Space between buttons on resizeYou may want to use different strategies for different parts of your game. (In Unity, you can do this with an Aspect Ratio Fitter set to "fit in parent", although I once heard that's not as performant as you'd expect so you might want to profile and consider writing your own component for it.) Essentially, pick some preferred aspect ratio, and then put all of your stuff inside a box of that aspect ratio that fits entirely within the screen, leaving empty areas either on the sides or on the top/bottom. Letterboxing-like a widescreen movie that you show on a narrow TV by adding black bars at the top and bottom. This means your intended content will always exactly fit the window! But it means it'll look distorted or squashed at some aspect ratios, because you'll be stretching in one axis more than the other. Stretching-separately scale each axis so that it fills the available space. If you want to guarantee that everything at least stays inside the screen, there's two main strategies: But there will still be some width at which it goes off the screen, it'll just be more extreme than before. You could keep your current scaling and make your screen work at somewhat wider aspect ratios if you just make your text area shorter in general. But then you could end up with things going off the sides, of course. You could guarantee that nothing ever goes off the top or bottom if you made it so that the canvas scales based purely on height (and not at all on width). You should think about which resolutions you actually care about supporting and which you don't, so that you don't waste time worrying about stuff outside that range. For example, if someone makes their window 10 pixels tall, then even if you make all of your stuff fit in that window, it won't be legible. It's worth noting that there's nothing that you can do that will look good at ALL POSSIBLE resolutions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |