Cut out sprites from a texture
To create sprites from a texture, use the default Sprite Editor tab of the Sprite Editor window.
Read time 3 minutesLast updated 10 days ago
To cut out sprites from a texture, use the default Sprite Editor tab of the Sprite Editor window.
For each sprite, Unity creates a sprite asset () as a child of the texture in the Project window.
Open the Sprite Editor
Follow these steps:
-
In the Project window, select the texture you want to edit.
-
In thewindow, make sure the Texture Type is set to Sprite (2D and UI).Inspector
?
-
Select Sprite Editor.
Adjust the area of a single sprite
If the Sprite Mode of the texture is set to Single, the entire texture is a single sprite. To adjust the sprite in the Sprite Editor window, follow these steps:
- Select the texture. Unity displays a rectangular selection area with handles in the corners. This is the sprite area, also known as a .
SpriteRect - Drag the blue handles or edges to set the area of the sprite.
- Configure the properties of the sprite using the overlay. For more information, refer to Sprite Editor tab reference.Sprite
?
- To save the sprite, select Apply in the toolbar.
Cut out multiple sprites from a single texture
If the Sprite Mode of the texture is set to Multiple, the texture can contain multiple sprites. Each sprite is defined by a that you create in the Sprite Editor window.
SpriteRectDo either of the following in the Sprite Editor window:
- Manually select areas to use as sprites.
- Slice into sprites automatically, for example from a sprite sheet that uses a regular layout, or transparent pixels to separate each image.
Manually select areas to use as sprites
Follow these steps:
- Left-click the texture and drag to create a .
SpriteRect - Repeat step 1 to create more sprites.
- To save the sprites, select Apply in the toolbar.
Slice into sprites automatically
To slice a texture into multiple sprites automatically, select the Slice dropdown in the toolbar.
Choose from the following slicing methods:
- Automatic to slice based on the transparency of the texture. Use this option if each image in the texture is separated by transparent pixels.
- Grid By Cell Size to slice into sprites of equal size.
- Grid By Cell Count to slice into a specific number of rows and columns.
- Isometric Grid to slice into isometric diamond-shaped sprites instead of rectangular sprites.
When you select an option other than Automatic or adjust the settings in the Slice overlay, Unity displays a preview of the sprites as red outlines. Unity might not display the outlines if you already sliced the texture.
After you select Slice to apply the slicing method, to adjust a generated sprite, select it then drag its blue handles or edges.
For more information, refer to Sprite Editor tab reference.
Warn before applying or reverting changes
To make Unity display a warning when you select Revert or Apply in the Sprite Editor, follow these steps:
- From the main menu, select Edit > Preferences.
- Select 2D > Sprite Editor Window.
- Enable Show Apply Confirmation or Show Revert Confirmation.