Animate a pixel art coin spin

Updated · Adib Khan

A gold pixel-art coin spinning: a full face, a narrowing face, a thin edge and a widening face again
The coin made for this page: six frames, the first held a little longer. Open it in the editor.

The shape of a spin

A flat coin spinning on its edge is a very cheap animation, and a very good one. You do not need to draw a 3D coin. A coin seen from the side is just narrower than a coin seen from the front, and a run of frames that gets narrower and then wider again looks exactly like a spin.

Think of a plate seen from the side as it turns. At the start it faces you and is a full circle. A quarter turn later you see only its edge. A half turn after the start, you see the back, which looks like the front, so the loop can close early. That is why six frames are enough: face, narrowing, edge, widening, and back to the face.

Open the coin in the editor and press Space. The coin is symmetrical, left to right, in every frame, and that is what the next section uses.

Open the coin and spin it.Open the editor

Draw it with the mirror

Every frame of the coin is the same on the left and the right. That is a job for the mirror. In the toolbar, the Mirror button changes mode each time you press it. Its labels are Mirror off, Mirror X, Mirror Y, Mirror both, Radial 4 and Radial 8. Stop on Mirror X, and each pixel you draw on one side appears on the other. On a phone the toolbar has no Mirror button: open More, find Symmetry and choose X. Turn it off again for the shine, which sits on the left side only.

The mirror line runs through the middle of the canvas. On a 16 pixel sprite that is between the eighth and ninth columns, so a coin with an even width sits exactly on it. The face is ten pixels wide, which is five on each side of the line.

The PixelFlipbook editor with the first frame of the coin on the canvas, a wide gold coin with a lighter middle and a white shine, the Mirror X button in the toolbar switched on, a dashed line down the middle and the six frame thumbnails below
The face frame with the mirror on. Draw the left half and the right half follows.

The six frames

  1. Face (140 ms). The widest the coin gets: ten pixels across and ten tall, with the corners cut to make it round. The rim is a one pixel orange line, the face is yellow, and an orange bar in the middle, two pixels wide and four tall, stands for the stamp. A white shine sits near the upper left.
  2. Turning (90 ms). Eight pixels wide, with the shine still there.
  3. Narrow (90 ms). Six pixels wide, and the shine has gone, because the coin is turning away from the light.
  4. Edge (90 ms). Two pixels wide, a thin orange bar. The coin is seen from the side.
  5. Narrow again (90 ms). The same as frame 3, because the coin is now turning back.
  6. Turning back (90 ms). Eight pixels wide with the shine, like frame 2, and then the loop goes back to the face.

Frames 5 and 6 are not copies by accident. Make frame 5 from frame 3: select frame 3, press D, then move the copy after the edge frame, either by dragging it in the timeline, or by clicking the copy in the timeline and pressing Alt+Right. Make frame 6 the same way from frame 2: duplicate it and move the copy to the end, by dragging, or with three presses of Alt+Right. The copies keep the times of the frames they came from, which are the same 90 ms.

The PixelFlipbook editor on the fourth frame of the coin with the Mirror X button switched on: a thin two pixel orange bar on the canvas with the dashed mirror line through it, and six frame thumbnails below with their times
The edge frame, two pixels wide and sitting exactly on the mirror line.

Steps

  1. Start a 16 pixel sprite. File, New sprite, 16, Create.
  2. Press Mirror in the toolbar until its label reads Mirror X (on a phone, More, then Symmetry, then X).
  3. Draw the face. Use the Pencil for the one pixel orange rim at the sides and the corners and the Bucket for the yellow. Draw the shine with the mirror off.
  4. Press N for a new frame and draw the next coin two pixels narrower. Do this until the edge, which is two pixels wide.
  5. Finish the loop with frames 5 and 6, as above.
  6. Set 140 ms on the first frame and 90 ms on the rest (on a phone, Expand timeline, then Frame actions, then Set duration). Press Space to play it.

Set the timing

The coin is a steady thing, so the times are nearly equal: 140 ms for the face and 90 ms for the five others. That makes 590 ms for a full spin. The longer face frame gives the eye a moment to see the coin before it turns away.

For a faster spin, use 60 or 70 ms a frame. The editor takes 10 to 65535 ms for each frame, so you can choose any of these. On a phone the Duration box is not there: tap Expand timeline, then Frame actions, and choose Set duration.

Export the GIF

Press Ctrl+E, choose GIF and press Export GIF. Choose Transparent for the background if the coin will sit on top of a game screen or a page. The GIF plays six frames and loops forever.

A coin is a good first sprite sheet too. The sprite sheet guide covers the layouts and the JSON.

Tips