![]() ![]() The Pivot can be set with one of nine preset locations or a Custom Pivot location can be set. You can also use the Offset values to shift the grid position from the top-left of the image and the Padding values to inset the sprite rectangles slightly from the grid. If you chose grid by cell count, Column & Row determines the number of columns and rows used for slicing. The Pixel Size values determine the height and width of the tiles in pixels. This is very useful when the sprites have already been laid out in a regular pattern during creation: Grid by Cell Size or Grid by Cell Count options are also available for the slicing type. The Delete existing option will simply replace whatever is already selected, Smart will attempt to create new rectangles while retaining or adjusting existing ones, and Safe will add new rectangles without changing anything already in place. The Method menu lets you choose how to deal with existing selections in the window. You can set a default pivot for each identified sprite. With the slicing type set to Automatic, the editor will attempt to guess the boundaries of sprite elements by transparency. ![]() If you click on the Slice menu in the control bar, you will see this panel: Isolating the sprite rectangles manually works well but in many cases, Unity can save you work by detecting the graphic elements and extracting them for you automatically. Note: Borders are only supported for the UI system, not for the 2D SpriteRenderer. The Trim button next to the Slice menu item will resize the rectangle so that it fits tightly around the edge of the graphic based on transparency. You can choose from a number of default rectangle-relative positions (eg, Center, Top Right, etc) or use custom coordinates. There are also settings for the sprite’s pivot, which Unity uses as the coordinate origin and main “anchor point” of the graphic. A border width, for left, top, right and bottom can be specified in pixels. The controls in the panel let you choose a name for the sprite graphic and set the position and size of the rectangle by its coordinates. You’ll notice that when you have a rectangle selected, a panel appears in the bottom right of the window: Having isolated an element, you can add another by dragging a new rectangle in a separate part of the image. You can drag the handles or the edges of the rectangle to resize it around a specific element. If you click on the image, you will see a rectangular selection area appear with handles in the corners. The most direct way to use the editor is to identify the elements manually. ![]() Finally, the Apply and Revert buttons allow you to keep or discard any changes you have made. The most important control is the Slice menu at the top left, which gives you options for separating the elements of the image automatically. Moving the slider to the left reduces the resolution of the sprite texture. The right-most slider controls the pixelation (mipmap) of the texure. The slider at the top right controls the zoom, while the color bar button to its left chooses whether you view the image itself or its alpha levels. Fig 3: Sprite EditorĪlong with the composite image, you will see a number of controls in the bar at the top of the window. Note: Set the Sprite Mode to Multiple in the Texture Import Inspector if your image has several elements. Fig 1: Project View Fig 2: Texture Import Inspector with Sprite Editor button Note: You can only see the Sprite Editor button if the Texture Type on the image you have selected is set to Sprite (2D and UI). Note that you can’t edit a sprite which is in the Scene View.Ĭlick on the Sprite Editor button in the Texture Import Inspector (Fig 2: Texture Import Inspector) and the Sprite Editor displays (Fig 3: Sprite Editor). Select the 2D image you want to edit from the Project View (Fig 1: Project View). (See Fig 2: Texture Import Inspector… below.) Opening the Sprite Editor Sprite textures with multiple elements need the Sprite Mode to be set to Multiple in the Inpsector. For information on importing and setting up sprites, see Sprites. Make sure the graphic you want to edit has its Texture Type set to Sprite (2D and UI). Unity makes it easy to extract elements from a composite image by providing a Sprite Editor for the purpose. For example, the image could contain component parts of a single character, as with a car whose wheels move independently of the body. Sometimes a sprite texture contains just a single graphic element but it is often more convenient to combine several related graphics together into a single image. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |