Return to Video

The Sprite Editor - Unity Official Tutorials

  • 0:01 - 0:04
    The Sprite Editor is used to take images
  • 0:04 - 0:08
    containing multiple elements like an atlas or sprite sheet
  • 0:08 - 0:10
    and slice them in to individual sprites.
  • 0:14 - 0:16
    It is important that the sprite mode of the image
  • 0:16 - 0:18
    is set to Multiple.
  • 0:19 - 0:21
    Images with sprite modes set to single
  • 0:21 - 0:24
    cannot use the sprite editor window at this time.
  • 0:25 - 0:29
    For more information on sprites, sprite mode and the sprite type
  • 0:29 - 0:31
    please see the information link below.
  • 0:32 - 0:35
    When sprite mode multiple is selected
  • 0:35 - 0:37
    the sprite editor button will appear on the
  • 0:37 - 0:39
    texture importer in the inspector.
  • 0:40 - 0:43
    Click the sprite editor button to open the sprite editor.
  • 0:45 - 0:47
    The sprite editor can also be opened by selecting
  • 0:47 - 0:50
    Window - Sprite Editor.
  • 0:53 - 0:56
    The sprite editor window is a standard Unity window.
  • 0:56 - 0:59
    It can be used and docked like any other window.
  • 1:00 - 1:03
    To create sprites in the sprite editor window
  • 1:03 - 1:05
    slice the image by clicking and dragging
  • 1:05 - 1:06
    over the desired elements.
  • 1:07 - 1:11
    This will create rectangular selections that define each sprite.
  • 1:11 - 1:13
    The rectangular selection can be adjusted
  • 1:13 - 1:15
    by clicking and dragging the rectangle.
  • 1:17 - 1:20
    Click and drag anywhere inside the rectangle to move it.
  • 1:21 - 1:24
    Click and drag any of the corners or edges to resize it.
  • 1:29 - 1:31
    Click and drag the pivot point gizmo to move
  • 1:31 - 1:33
    the pivot point for that sprite.
  • 1:37 - 1:40
    When a sprite is selected a sprite panel appears
  • 1:40 - 1:42
    in the lower right of the sprite editor
  • 1:42 - 1:45
    with details about the selected sprite.
  • 1:46 - 1:48
    Name is the name of the sprite.
  • 1:49 - 1:52
    The name is created from the name of the original image
  • 1:52 - 1:54
    and the order in which it was sliced from that image,
  • 1:54 - 1:56
    starting with 0.
  • 1:57 - 1:58
    Position defines where the sprite
  • 1:58 - 2:00
    is on the image, in pixels.
  • 2:01 - 2:04
    X and Y define the start point of the sprite.
  • 2:04 - 2:06
    measured from the lower left corner of the image.
  • 2:06 - 2:09
    to the lower left corner of the sprite.
  • 2:10 - 2:12
    W and H define the width and height
  • 2:12 - 2:14
    of the sprite, from the start point.
  • 2:16 - 2:18
    The trim button can be used to trim off any
  • 2:18 - 2:20
    excess space around the element,
  • 2:20 - 2:23
    creating the tightest fitting rectangle possible.
  • 2:25 - 2:27
    Pivot sets the pivot point for this sprite.
  • 2:28 - 2:30
    The pivot drop-down menu includes presets
  • 2:30 - 2:33
    for each corner and the centre of each edge.
  • 2:34 - 2:36
    Custom allows for a custom pivot point
  • 2:36 - 2:39
    to be set numerically under Custom Pivot.
  • 2:40 - 2:42
    Along the top of the sprite editor are a
  • 2:42 - 2:44
    number of tools.
  • 2:45 - 2:46
    The slice menu,
  • 2:47 - 2:49
    the revert and apply buttons,
  • 2:50 - 2:52
    the RGB alpha toggle
  • 2:53 - 2:55
    and the zoom slider.
  • 2:57 - 3:00
    The slice menu is used to automatically create sprites
  • 3:00 - 3:03
    by slicing the sprite elements from the image.
  • 3:04 - 3:07
    The slice type is either automatic or grid.
  • 3:08 - 3:10
    Automatic is best for slicing individual
  • 3:10 - 3:12
    uneven elements, like from an atlas.
  • 3:14 - 3:16
    Elements on the image are automatically
  • 3:16 - 3:18
    detected based on the empty space around them.
  • 3:19 - 3:21
    Each sprite will have effectively been trimmed
  • 3:21 - 3:22
    as a result.
  • 3:23 - 3:26
    With automatic selected minimum size defines the
  • 3:26 - 3:29
    minimum size for each individual sprite.
  • 3:30 - 3:33
    If this value is set too high smaller elements
  • 3:33 - 3:35
    that are near each other could be combined
  • 3:35 - 3:37
    in to 1 larger sprite to meet
  • 3:37 - 3:39
    the minimum size requirements.
  • 3:40 - 3:42
    Pivot sets the default pivot point that will
  • 3:42 - 3:44
    be applied to all sprites when they are
  • 3:44 - 3:45
    spiced from the image.
  • 3:46 - 3:50
    Just like the sprite panel, the pivot drop-down menu
  • 3:50 - 3:53
    includes presets for each corner and the centre of each edge.
  • 3:55 - 3:58
    To set a custom pivot, once the sprites have been sliced
  • 3:58 - 4:00
    select any sprite and adjust it's pivot point
  • 4:00 - 4:02
    in the sprite panel,
  • 4:02 - 4:04
    or adjust it visually in the editor.
  • 4:06 - 4:08
    Method lets you choose how to deal with existing
  • 4:08 - 4:10
    sprites in the sprite editor window.
  • 4:11 - 4:13
    Delete Existing will replace any sprites
  • 4:13 - 4:16
    that already exist with new sprites.
  • 4:17 - 4:19
    Smart will attempt to create new sprites
  • 4:19 - 4:21
    while retaining and adjusting existing ones.
  • 4:22 - 4:24
    Safe will add new sprites without
  • 4:24 - 4:27
    changing any sprites already created.
  • 4:29 - 4:32
    When the settings are correct select the Slice button
  • 4:32 - 4:35
    to slice the image in to individual sprites.
  • 4:36 - 4:39
    After slicing, each sprite can be edited individually.
  • 4:41 - 4:44
    With the sprite sheet, where each element is designed
  • 4:44 - 4:47
    to be a regular identical size,
  • 4:47 - 4:50
    if Slice Type Automatic is used
  • 4:50 - 4:52
    small changes in the individual sprite's shape
  • 4:52 - 4:54
    and the amount of empty space surrounding it
  • 4:54 - 4:57
    could cause the sprites to be cut out unevenly.
  • 4:58 - 5:02
    To evenly slice a sprite sheet made of regular elements
  • 5:02 - 5:04
    choose Slice Type Grid.
  • 5:06 - 5:09
    Pixel Size sets the size of the grid in pixels.
  • 5:10 - 5:13
    Pivot sets the default pivot point that will be applied
  • 5:13 - 5:16
    to all sprites when they are sliced from the image.
  • 5:16 - 5:19
    To set a custom pivot, once the sprites have been sliced,
  • 5:19 - 5:22
    select any sprite and adjust it's pivot point
  • 5:22 - 5:25
    in the sprite panel, or adjust it visually in the editor.
  • 5:26 - 5:28
    When the settings are correct use the slice button
  • 5:28 - 5:31
    to slice the image in to individual sprites.
  • 5:32 - 5:35
    After slicing each sprite can be edited individually.
  • 5:36 - 5:39
    When slicing is complete, to save any changes,
  • 5:39 - 5:41
    select Apply.
  • 5:41 - 5:44
    Or discard any change by selecting Revert.
  • 5:46 - 5:48
    The RGB Alpha toggle switches the
  • 5:48 - 5:52
    display of the sprite editor between the colour image
  • 5:52 - 5:54
    and it's alpha channel, making it easier to see
  • 5:54 - 5:57
    fine details when manually adjusting edges.
  • 5:58 - 6:01
    The zoom slider controls the zoom when viewing the image.
  • 6:04 - 6:06
    When an image has been successfully edited
  • 6:06 - 6:08
    and the changes applied
  • 6:08 - 6:10
    the asset will update in the project window.
  • 6:12 - 6:15
    And a new sprite, or set of sprites
  • 6:15 - 6:17
    can be seen as a child or group of children
  • 6:17 - 6:19
    under the image.
  • 6:19 - 6:22
    When viewing thumbnails in the project view
  • 6:22 - 6:25
    click the turn-down arrow to see any children.
  • 6:27 - 6:30
    Each child represents a useable sprite from that image.
  • 6:31 - 6:33
    Any of these sprites can be used in the
  • 6:33 - 6:35
    project independently, or grouped together
  • 6:35 - 6:37
    to create a character, for example,
  • 6:38 - 6:41
    or used sequentially as animations.
Title:
The Sprite Editor - Unity Official Tutorials
Description:

more » « less
Video Language:
English
Duration:
06:46

English subtitles

Revisions