Adding and swapping your own sprites
Sprite Forge draws its built-in art with code. This guide shows the two ways to put your own art in: the Workshop inside the app (no coding), and editing the part files (for bodies, outfits and anything else).
1. Workshop walkthrough
The Workshop can make five kinds of part: hair, headgear, faces, weapons and off-hand items. These are the parts that keep their shape while the character moves, so one small drawing is enough for every animation.
- Set up the character first. Pick the race, hair and gear you want to design around. The Workshop uses that character as the guide.
- Click ✏️ Workshop in the top bar and choose what you are making.
- Draw. Pick a colour from the palette and click or drag on the grid. Right-click erases. The faint picture underneath is your character, and the red cross marks the anchor (the head centre or the hand). To get a head start, click Start from current: it copies the part your character is wearing so you can change it.
- Watch the live preview. It plays your drawing on the moving character. Switch the animation and flip between front and back to check it.
- Fill in both views. Hair, headgear and off-hand items have a front view on the left and a back view on the right. If you leave the back empty, the part disappears when the character faces away.
- Name it and save. Click Save to my parts. It now appears in the normal menus marked with ★, and is put on your character straight away.
Options
- Headgear: how it sits on hair. "Sits on top" leaves the hair alone. "Flattens tall hair" trims spikes and mohawks so they don't poke through a hat. "Hides all hair" is for hoods and full masks.
- Weapon: how it is held and used. This picks the grip and the attack animation (slash, thrust, gun, and so on). Two-handed styles hide the off-hand item.
2. Template sizes
Each kind of part is one small PNG. Views sit side by side, front first.
| Part | Image size | Views | Anchor pixel in each view | Notes |
|---|
- The anchor is the pixel that gets pinned to the character: the centre of the head, or the middle of the hand.
- Characters face right. The front view looks down-right and the back view looks up-right. The left-facing directions are made by flipping, so don't draw them.
- Weapons point straight up with the grip on the anchor. The app rotates the drawing to follow the hand, so simple shapes rotate best. The swing's leading edge is the right-hand side of your drawing.
- Light comes from the upper left. Put highlights on the top-left and shadows on the bottom-right.
3. Palette colours
Pixels drawn in the exact colours below are recoloured to match each character's colour settings. For example, anything drawn in the Hair colours follows the Hair picker. Any other colour stays exactly as you drew it.
| Material | Outline | Shadow | Base | Light | Shine |
|---|
4. Using a pixel editor
You can draw in Aseprite, LibreSprite, Piskel, GIMP or any editor that saves PNGs.
- In the Workshop, choose the part kind and click Download template. You get a PNG of the right size with your character shown in pink.
- Open it in your editor and draw over the pink guide. Keep the image size the same. Use the palette colours from section 3 for anything that should recolour.
- Save as PNG. You can leave the pink in; it is removed on import. Use a transparent background.
- Back in the Workshop, click Import PNG, check the preview, name it and save.
Export PNG does the reverse: it downloads the part you are editing so you can keep working on it elsewhere.
5. Saving and sharing
- Save (top bar) downloads a character file. Any custom parts the character uses are stored inside that file.
- Load on another computer brings the character back and adds its custom parts to that browser's parts list.
- The Roster and your parts list live in the browser's storage. Clearing site data removes them, so keep character files as backups.
- Exported sprite sheets are plain images. They include custom parts like any other part.
6. Adding parts in code
Bodies, outfits, armour, capes, races and animations bend with the skeleton, so they are drawn by code and can't be made in the Workshop. They live in a few plain JavaScript files. After editing one, refresh the page.
| File | What it holds |
|---|---|
js/parts.js | Races, outfits, armour, faces, hair, headgear, capes and tails |
js/gear.js | Weapons, off-hand items and effects (slashes, sparkles, muzzle flashes) |
js/poses.js | The skeleton and every animation |
js/render.js | Layer order and job presets |
js/palette.js | Colour slots, swatches and how shades are made |
How drawing works
A part draws simple shapes into a layer L using a material (not a colour): M.skin, M.hair, M.cloth1, M.metal and so on. The engine then shades the layer, outlines it and colours it from the character's palette. Useful shapes:
L.ellipse(cx, cy, rx, ry, M.hair) // filled oval L.capsule(a, b, radius, M.wood) // thick line with round ends L.poly([p1, p2, p3], M.metal) // filled polygon L.chain([p1, p2, p3], r0, r1, M.hair) // tapering curve (tails, ponytails) L.px(x, y, M.gold, 3) // one pixel with a fixed tone (0 outline … 4 shine) L.clipped(() => L.rect(x, y, w, h, M.gold)) // paint only over what is already there (trim, belts)
Points are {x, y} in design units on a 64×64 grid; the engine draws every shape 1.5× finer, into a 96×96 pixel frame. For pixel-exact detail use L.dot, L.box or L.art, which work in pixels. The skeleton S gives you where things are: S.head (centre, with rx/ry), S.neck, S.hip, S.na.hd (near hand), S.fa.hd (far hand), and S.back, which is true in the back view. Forward is always +x.
Example: a new hairstyle
// js/parts.js, inside SF.HAIR = { ... }
sidecut: {
label: 'Side Cut',
front(L, S) {
cap(L, S); // the standard hair cap with fringe
const h = S.head;
if (!S.back) L.taper({ x: h.x + 3, y: h.y - 4 }, { x: h.x + 7, y: h.y + 1 }, 1.6, 0.6, M.hair);
},
back() {}, // anything that hangs behind the body
},
Example: a new weapon
// js/gear.js, inside SF.WEAPONS = { ... }
club: {
label: 'Club', grip: 'one', attack: 'slash', idleAng: 115, reach: 10,
draw(L, h, a) { // h = hand, a = angle the weapon points
const d = vec(a);
L.taper(add(h, d, -2), add(h, d, 10), 0.7, 1.8, M.wood);
},
},
grip is one of one, two, pole, rifle, bow or none. attack is slash, thrust, gun, bow or punch.
Example: a new race
// js/parts.js, inside SF.RACES = { ... }
giant: {
label: 'Giant',
dims: dims({ thigh: 5, shin: 5, torso: 10, sw: 5, ww: 4, armR: 1.6, legR: 1.8 }),
ears: 'round', skin: '#d9a077', hair: '#3a2e3f',
},
Flags you can add: beard, tusks, jaw, nose, snout, horns, skull, muzzle, and tail: 'lizard' | 'cat' | 'spade'. Ear types are round, long, wide, small and cat.
Example: a new job preset
// js/render.js, inside SF.JOBS = { ... }
// label weapon off-hand outfit armour headgear back colours
bard: job('Bard', 'rapier', 'none', 'vest', 'none', 'cap', 'short', { cloth1: '#8a5ab4', cloth2: '#ecc95c' }),
Example: a new animation
// js/poses.js, inside SF.ANIMS = { ... }, then add 'wave' to SF.ANIM_ORDER
wave: {
label: 'Wave', fps: 8,
build: () => [0, 1, 0, 1].map((k) => ({ fUA: 150, fFA: 160 + k * 25, free: true })),
},
Each frame lists only what differs from the standing pose. Angles are in degrees: 0 is straight down, 90 is forward, 180 is up. nUA/nFA are the near upper arm and forearm, fUA/fFA the far arm, lean tilts the body, bx/by move it, and nFoot/fFoot place the feet.
Replacing a built-in part with an image
The simplest route is the Workshop: make your version, save it, and select it. To make it the default for a job, put its id (shown in the saved character file) into the job preset.
7. Using sheets in a game
- Download PNG gives a grid: one row per animation and direction, one 96×96 frame per column (or 192 / 384 at 2× and 4×).
- Download JSON lists every row with its frame rectangles, frames per second, whether it loops and whether it is a mirrored direction.
- The pivot is the feet: pixel (48, 87) from the top-left of a frame, or (0.5, 0.094) measured from the bottom-left.
- Unity: import the PNG as a Sprite with Filter Mode "Point", Compression "None" and Pixels Per Unit 96 (times the export scale). Slice by cell size 96×96 with a custom pivot of (0.5, 0.094).
- To save space, export only the two right-facing directions and flip the sprite in the engine.
8. Troubleshooting
- My part doesn't recolour. The colours must match the palette table exactly. Use the Workshop palette, or type the hex codes from section 3.
- My part vanishes from behind. The back view (right half of the image) is empty.
- The import looks shifted. The PNG is the wrong size. Start again from Download template.
- Parts of my drawing went missing. Pink and magenta pixels are treated as guide and removed.
- My weapon looks jagged in some poses. Rotation at this size is rough. Straight, symmetrical shapes with a 1-pixel outline hold up best.
- My saved parts are gone. Browser storage was cleared. Load a character file that used them to bring them back.