Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Sprites

Use Sprites within your 2D game.
Read time 2 minutesLast updated 7 days ago

Sprites are a type of 2D asset you can use in your Unity project. Use this section to learn how to set up your sprites and manage them with different components.
If you're used to working in 3D, sprites are similar to standard textures, but there are special techniques to combine and manage sprite textures for efficiency during development.
Note
To use sprites, make sure the 2D Sprite package is installed in your project. For more information, refer to set up your project for 2D games.

Topic

Description

Add placeholder spritesTo quickly test sprites, create temporary placeholder sprites. A placeholder sprite is a simple white shape, for example a triangle, a square, or a capsule.
Import a sprite or spritesheet textureImport an image and use it as a sprite or set of sprites in a 2D scene.
Cut out sprites from a textureTo create sprites from a texture, use the default Sprite Editor tab of the Sprite Editor window.
Crop a spriteRemove transparent pixels from a sprite or crop the sprite to a custom shape.
Create collision shapes for a spriteGenerate or create the shapes that Unity uses to determine if a sprite collides with other sprites.
Sorting spritesControl the order of sprites with sorting layers, sorting groups, and distance calculations.
Scaling sprites dynamically using 9-slicingSet up sprites so they stretch or repeat when you resize them, so you don't need to create multiple sprites for different sizes.
Masking spritesHide or reveal parts of a sprite or a group of sprites.
Packing sprites into a sprite atlasOptimize the performance of your project by combining multiple textures into a single texture.
Sprite asset referenceExplore the properties of a sprite asset.
Sprite Renderer component referenceExplore the properties you can use to customize how Unity renders a sprite in the scene.
Sprite Editor window referenceExplore the properties and settings you use to create sprites from a texture, edit its meshes, and rig a sprite for animation.
2D Profiler module referenceExplore the properties and settings of the 2D module in the Profiler window.

Additional resources