My question is, how do you do it when the aspect ratio changes?
Also, I would like to ask something I have been looking for a few days and I haven’t found. I have a texture with a lot of GUI elements in it, how do I render them separately? More specifically, where do I specify the UV coords inside the texture for the GUI.Box, for example?
You have a few options…
• Many games just stretch-to-fill to the screen - aspect ratio be damned,
• Many games just stretch-to-fit so that the GUI can fit in a (typically centered) square on-screen.
I see, slicing in photoshop and having a texture for every element…
But what if I really need to draw just a region of the texture? For example, I have a top view of a navigation map, the texture for the map is 2048x2048 and I only want to draw the 512x512 region where the player is, centered on the player… how would I do it?
Seriously, I really think that the system would be far better with UV support, there are a gazillion things in which you need them, the map is just an example… another example would be a digital compass, or the altimeter (I’m doing an airplane game, is it obvious? ) what do you think?
I have finally implemented it using the BeginGroup method and in the end I don’t find it that painful, in fact, it’s probably even better than having to set texture coords in the classical way (u = coordX/Texture.width;).
The only problem is probably that inside is more expensive in performace, because the BeginGroup/EndGroup system???