Hi!
If you have :
- a 2D project where you need some rectangles and squares as sprites to use for creating your gameplay (black bricks here):
- a square texture which could be the source of those sprites:
what do you do \ what is recommended:
a) get all you need (rectangles, squares) from the texture in graphics editor (quick and dirty, see above) and save those as sprites / atlas
b) make single 9-tiled sprite and use it in all your sprite renderers (tiled)
c) maybe anyting else?
thanx!
Depending on how your visual need to be a 9-slice might work.
as far as I understand 9-slice can’t have LARGE central area and show only PART of it when needed?
In 1st post example for a long thin rectangle and a box two different areas of original texture were taken, if I take a box as en example for a 9-tile, and then use that 9-tile for long rectangle I’ll get either stretch or tiles inside rectangle but not that larger part of original texture. is that possible to do?
If you only want to show part of https://forum.unity.com/attachments/upload_2021-10-10_14-28-16-png.935362/
this texture dependning on the ‘box’ that you want, you can
-
Do it via scripting by generating Sprites at runtime by using Unity - Scripting API: Sprite.Create and specify the region of the texture you want to use and the size of the Sprite.
-
If you are not familiar with scripting, the other possible way is you can still create multiple Sprites from a single texture by drawing the region you want in Sprite Editor Window.