I have a question regarding textures in UI. As I understand it, textures must always be imported with power of 2 dimensions. But now my question is, for UI elements that use a custom texture, should these be also used with the dimension of power of 2? Or can I resize them to what looks and fits best on screen?
For example an image that was imported with 512x512 dimensions but on screen 512x512 looks too big and 256x256 looks too small, is it ok to resize that image to 350x350 without performance decrease?
Hi, yes it’s totally fine. Textures are more performant when are in power of 2 size, because they can use default compression which is much lighter - so they end up using up less memory.
As for the widgets, if you use a texture, it’s in memory in original size, so it doesn’t matter how you scale it.
Some practices I like to use:
-make UI graph as flat as possible
-use hit test invisible everywhere you can
-some widget classes can have tick disabled (if you don’t use delays, timers, etc)
-when hiding widget use collapsed instead of hidden