스프라이트 생성기
스프라이트 에디터: 커스텀 아웃라인

스프라이트 에디터

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. For example, the image could contain component parts of a single character, as with a car whose wheels move independently of the body. Unity makes it easy to extract elements from a composite image by providing a Sprite Editor for the purpose.

Note: Make sure the graphic you want to edit has its Texture Type set to Sprite (2D and UI). For information on importing and setting up Sprites, see Sprites.

Sprite Textures with multiple elements need the Sprite Mode to be set to Multiple in the Inspector. (Texture Import Inspector image below.)

스프라이트 에디터 열기

Sprite Editor 를 열기 위해서는

  1. 편집하고자 하는 2D 이미지를 Project View 에서 선택해야 합니다(그림 1: 프로젝트 뷰).

    Note that you can’t edit a Sprite by selecting it in the Scene View.

  2. Texture Import Inspector 에 있는 Sprite Editor(그림 2: 텍스처 임포트 인스펙터)를 클릭하면 Sprite Editor 가 나타납니다(그림 3: 스프라이트 에디터).

참고: Sprite Editor 버튼은 선택한 이미지의 Texture TypeSprite (2D and UI) 로 설정된 경우에만 나타납니다.

Project View
Project View
Texture Import Inspector with Sprite Editor button
Texture Import Inspector with Sprite Editor button

참고: 이미지의 요소가 여러 개라면 Texture Import InspectorSprite ModeMultiple 로 설정해야 합니다.

Sprite Editor
Sprite Editor

Along with the composite image, you will see a number of controls in the bar at the top of the window. 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. The right-most slider controls the pixelation (mipmap) of the Texture. Moving the slider to the left reduces the resolution of the Sprite Texture. The most important control is the Slice menu at the top left, which gives you options for separating the elements of the image automatically. Finally, the Apply and Revert buttons allow you to keep or discard any changes you have made.

에디터 사용

에디터를 사용하는 가장 직접적인 방법은 요소를 수동으로 식별하는 방법입니다. 이미지를 클릭하면 모서리에 핸들이 있는 사각형 선택 영역이 나타납니다. 핸들 또는 사각형의 변을 드래그하여 특정 요소를 둘러싸도록 크기를 조절할 수 있습니다. 요소를 격리한 후에는 이미지의 다른 부분에서 새 사각형을 드래그하여 다른 요소를 추가할 수 있습니다. 사각형을 선택하고 나면 창의 오른쪽 하단에 패널이 나타납니다.

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. A border width, for left, top, right and bottom can be specified in pixels. The borders are useful when 9-Slicing Sprites. There are also settings for the Sprite’s pivot, which Unity uses as the coordinate origin and main “anchor point” of the graphic. You can choose from a number of default rectangle-relative positions (eg, Center, Top Right, etc) or use custom coordinates.

슬라이스 메뉴 아이템 옆의 Trim 버튼은 사각형의 크기를 조절하여 투명도를 바탕으로 하여 그래픽 가장자리에 딱 들어맞도록 만듭니다.

참고: 테두리는 UI 시스템에서만 지원되며 2D SpriteRenderer에서는 지원되지 않습니다.

자동 슬라이싱

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. If you click on the Slice menu in the control bar, you will see this panel:

With the slicing type set to Automatic, the editor will attempt to guess the boundaries of Sprite elements by transparency. You can set a default pivot for each identified Sprite. The Method menu lets you choose how to deal with existing selections in the window. 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.

Grid by Cell Size or Grid by Cell Count options are also available for the slicing type. This is very useful when the Sprites have already been laid out in a regular pattern during creation:

The Pixel Size values determine the height and width of the tiles in pixels. If you chose grid by cell count, Column & Row determines the number of columns and rows used for slicing. 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. The Pivot can be set with one of nine preset locations or a Custom Pivot location can be set.

Note that after any of the automatic slicing methods has been used, the generated rectangles can still be edited manually. You can let Unity handle the rough definition of the Sprite boundaries and pivots and then do any necessary fine tuning yourself.

폴리곤 크기 조절

폴리곤에서 Sprite Editor 를 열면 해당 폴리곤의 모양, 크기, 피벗 포지션을 변경할 수 있습니다.

Polygon shape

스프라이트 에디터: 폴리곤 크기 조절 - 모양
스프라이트 에디터: 폴리곤 크기 조절 - 모양

원하는 폴리곤 변의 수를 Sides 필드에 입력하고 Change 를 클릭해야 합니다.

Polygon size and pivot

스프라이트 에디터: 폴리곤 크기 조절 - 크기 및 피벗 포인트 - 폴리곤을 클릭하면 나타납니다
스프라이트 에디터: 폴리곤 크기 조절 - 크기 및 피벗 포인트 - 폴리곤을 클릭하면 나타납니다

Polygon size

To change the polygon’s size, click on the Sprite to display green border lines and the Sprite information box. Click and drag on the green lines to create the border you want, and the values in the Border fields change.

Polygon pivot

To change the polygon’s pivot point (that is the axis point the polygon moves around), click on the image to display the Sprite information box. Click on the Pivot drop down menu and select an option. This displays a blue pivot circle on the polygon; its location depends on the pivot option to you have selected. If you want to change it further, select Custom Pivot and click and drag on the blue pivot circle to position it.

스프라이트 생성기
스프라이트 에디터: 커스텀 아웃라인