How to best handle sprite sheets?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ObsidianWhisper

I’m using some free placeholder assets for my project, but some of them are in sprite sheets. I’ve seen that Texture Atlas is far more efficient than having individual textures for each item. However, all the examples for using the Texture Atlas is for animations. For my situation, I’ve got a large selection of item icons, some with different sizes. I noticed that the auto slice will correctly encapsulate the individual sprites, but that’s seemingly only for editor ui convenience.

Is there something similar to how Tilesets work, but for textures? Being able to mark out and make individual sprites with names and unique IDs is what I’m after.

:bust_in_silhouette: Reply From: magicalogic

Maybe you are looking for texture region.
Click the sprite and under the properties enable Texture Region. You can then edit the texture region by clicking Texture Region tab(It’ll show at the bottom of the screen just like Output and Debug tabs.

Unfortunately I’ve tried that and there doesn’t seem to be any way via code to pick different regions. Also when using the same resource on multiple texture button fields, but selecting a different region manually, causes previous region selects to change to the new one.

I don’t understand why tileset lets you make IDed tiles, but there’s no option like that for textures.

ObsidianWhisper | 2021-06-03 18:14