Skip to content

Commit e87ee2e

Browse files
committed
Add Slice tool information
1 parent f54b6b8 commit e87ee2e

File tree

4 files changed

+64
-0
lines changed

4 files changed

+64
-0
lines changed

drawing.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Other tools that will help you in the drawing process:
2424
* ![Eyedropper tool icon](tools/eyedropper-tool.png) [Eyedropper](eyedropper.md) (`Alt` or `I` key)
2525
* ![Selection tool icon](tools/marquee-tool.png) [Rectangular Marquee](selecting.md) (`M` key)
2626
* ![Move tool icon](tools/move-tool.png) [Move Cel](move-tool.md) (`Ctrl` or `` or `V` key)
27+
* ![Slice tool icon](tools/slice-tool.png) [Slice](slices.md) (`Shift+C` key)
28+
2729

2830
---
2931

slices.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Slices
2+
3+
With the Slice tool ![Slice tool icon](tools/slice-tool.png) you can
4+
indicate regions of your sprite and assign a name/label to that region
5+
with some extra user defined information. There is support to specify
6+
[9-slices](https://en.wikipedia.org/wiki/9-slice_scaling)/9-patches
7+
information.
8+
9+
With this tool you can:
10+
11+
1. Create a new slice marking a rectangular region pressing the mouse
12+
button, dragging the mouse, and releasing the button.
13+
1. If the marked rectangle touches existing slices, those slices will
14+
be selected.
15+
1. You can drag-and-drop a set of selected slices to move them to
16+
other place. Or you can resize the whole set of slices dragging
17+
from the corners or edges.
18+
1. After selecting some slices you can delete them pressing the Delete
19+
key or *Edit > Delete* menu option.
20+
1. Double-clicking a slice you will see the [Slice
21+
Properties](#slice-properties) dialog.
22+
23+
## Slice Properties
24+
25+
If you double-click a slice, you will see its properties:
26+
27+
![Slice Properties Dialog](slices/properties.png)
28+
29+
Here you can specify:
30+
31+
1. the bounds of the slice in the canvas
32+
1. a 9-slices property to specify an internal rectangle to sub-divide the bounds into sub-slices
33+
1. a pivot to specify the central/base location of the sprite inside the slice
34+
35+
## Exporting Slices
36+
37+
You can export each slice as a different sprite using the
38+
[--split-slice option](cli.md/#split-slices).
39+
40+
You can also export the slice information in a sprite sheet JSON using
41+
the [--data option](cli.md/#data)) or the *File > Export Sprite Sheet*
42+
menu option with the JSON output checked. This is an example of the exported data:
43+
44+
```json
45+
{ ...
46+
"meta": {
47+
...
48+
"slices": [
49+
{ "name": "Button-patch",
50+
"color": "#0000ffff",
51+
"keys": [{ "frame": 0,
52+
"bounds": {"x": 118, "y": 118, "w": 20, "h": 21 },
53+
"center": {"x": 5, "y": 5, "w": 10, "h": 9 } }] }
54+
]
55+
}
56+
```
57+
58+
---
59+
60+
**SEE ALSO**
61+
62+
[Drawing](drawing.md)

slices/properties.png

16.8 KB
Loading

tools/slice-tool.png

202 Bytes
Loading

0 commit comments

Comments
 (0)