Welcome traveler!
Want to make a dress-up doll maker but don't want to deal with drag and drop elements?
Do you want the user to be able to download their finished creation?
Do you want to EASILY add more clothing/accessories/ hairstyles as you draw them?
Do you NOT want to upload 30 color variations of one item, but instead have a cool color-slider that saves you time AND allows for the user to get exactly the colors they want!?!?

WELL!! Do I have the doll maker for you. Follow these steps and you'll have a doll maker working on your webpage in no time.

I have a version of this doll maker here! It's a fairy doll maker I made as a proof of concept. You will be able to change things like theme colors and styles later if desired.


Click to try out my version of this doll maker!

NOTE: This tutorial wont work on Neocities as they do not allow for .php pages to be created :(
♡ 1. Getting Started
1

Choose a folder for your Doll Maker

Create a folder somewhere on your website where all of the Doll Maker files will live.

dollmaker/
2

Create the files

Create these five files inside your Doll Maker folder. I will give you code to put into each one in a moment.

dollmaker/
├── index.html
├── doll.css
├── doll.js
├── getAssets.php
└── parts.json
♡ 2. Copy and paste code into each file
1

Put the following code in index.html

This is the main webpage that users will visit to use your doll maker. It contains the Doll Maker's interface, preview area, dropdowns, color controls, random button, reset button, and save button. *Please leave the link to my site intact, thanks!*

2

Put the following code in doll.css

This controls the appearance and layout of your maker. You can change colors, borders, spacing, fonts, backgrounds, buttons, the doll preview, and so much more.

3

Put the following code in doll.js

This is the brain of the Doll Maker. It handles asset/image loading, dropdown functions, layering, recoloring, randomization, reset, and saving. Remember to change DOLL_WIDTH and DOLL_HEIGHT here to match your canvas size.

4

Put the following code in getAssets.php

This script scans the folders listed in parts.json and returns the available image files as JSON.

What this does: When you upload a new image into one of the parts folders, this script can find it automatically!!
5

Put the following code in parts.json

This tells getAssets.php which folders are part of the Doll Maker.

IMPORTANT: The folder names here NEED TO MATCH the actual folder names on your server.
(Next step is making the folders!)
♡ 3. Add the Doll Parts Folders

Create these exact folders in the same folder as the 5 main files you just made above. Each folder, of course, represents one category of doll accessory type that I thought the most amount of people would utilize. If you don't put images into a folder, it's ok, it'll just say "no artwork found" on the dropdown.

dollmaker/
├── body/
├── bottom/
├── eyes/
├── hair/
├── hairaccessory/
├── makeup/
├── overall/
├── shoes/
├── socks/
└── top/
Folder
Example Contents
body
Body/base artwork - be careful with arm or leg position changes as of course your clothing wont fit right unless you're strategic about it ;)
eyes
Different eye sets - eyes closed, winking, etc.
hair
Different hairstyles!! If you want a bald option you can upload a blank/transparent image called "bald" and upload it to the folder :)
top
Shirts, tops, jackets, tank tops, tube tops, etc. go crazy.
bottom
Skirts, pants, shorts, skorts, bikini bottoms? I don't know XD
overall
I made this folder category for overall outfits like full length gowns, or literal overalls, etc.
You get the idea ;) If you want more things like backpack/background elements, you can alays make more folders later once you understand the doll maker better.
♡ 4. Add Your Artwork
All of the images you add MUST use the same canvas dimensions THAT YOU MUST CHANGE AT THE TOP OF doll.js or the image will be stretched out and not correctly aligned.
1

Add the base/body image

Start with the body or base of the doll.

body/
└── default.gif
2

Add in some artwork!

For example:

eyes/
├── blue_eyes.gif
└── green_eyes.gif
hair/
├── long_hair.gif
└── ponytail.gif
top/
├── pink_shirt.gif
└── jacket.gif
3

Keep every piece aligned

Their pixels should line up exactly in your art program of choice (it's like using layers in any software like photoshop, painttool sai, graphics gale, etc.)

Check the samples for correct/incorrect alignment: First pic shows that the bow image is saved with lots of white space above it, allowing it to align with the fairy sitting nicely on top.
The second pic shows a cropped save of the bow, which results in a weird stretched out bow image on the doll maker end result x_x
Yes yes:

No no:

I think most people who do doll making and sprite work can easily understand this concept, I just like to be extra sometimes with explanations because sometimes tutorials are hard xwx;;
♡ 5. Adding more Files / Item Names

Name the file something useful

getAssets.php scans the folder and reports the available files to JavaScript. The maker can turn filenames into readable variation names. Here are some samples of file names, and how they will actually display in the doll maker! SO HANDY!!! It capitalizes the words for your automatically too.

TIP: Use filenames you and your users can easily understand. Your future self and and future users will thank you.
♡ 6. Layering Your Doll

So you have your doll maker up and running now!! You've added a few pieces of art in...and maybe something isn't layering the way you expect it to. Doll Maker pieces are transparent layers stacked all on top of one another. The order matters! (we don't want the cute skirt you made appearing BEHIND the doll body after all!)

For this dollmaker, the order of the categories is handled by parts.json.

1

Find your parts.json and check the order of categories:

Think of the first item as being farther toward the back and the later items as being progressively farther toward the front.

2

Put something farther back like so.

I moved body to the top of the list so it appears behind everything else:

For example, if an accessory should sit behind the hair, place that category before hair.

♡ Layering note: The order of layers is very personal to your specific doll, so please get familiar with this step and create your artwork accordingly. (some people might want eyes to display over hair/bangs, and some people might want the hair to hide the eyes....UP TO YOU!!)
Once you master making new folders and layering them, you can do fun stuff like creating front and backs to hairstyles!
♡ 7. Color Slider / Hue Shifter

This doll maker has the ability to recolor individual elements! This allows you to not have to upload a bazillion color variations, but instead let the user choose the exact shade of red (or whatever) they desire.
Each element can be individually changed!

Mode
Purpose
Color Slider
Applies a selected color while preserving the artwork's brightness/shading. Colors become monochrome version of whatever the user sets it to.
Hue Shifter
Moves the artwork toward another hue while preserving unique colors. This mode allows for multiple colors in one asset.
♡ 8. Features

1

Choose a random item

The Random Doll button will select random artwork from each available category.
2

Randomize colors

You can also randomize colors along with the items!

3

Locking options

Useres will have the ability to lock an item, a color of an item category, or BOTH!

3

Reset

This will reset the doll to the default option, which is the first file name in the category folder by alphabetical order.

TIP: You can make a file called "zebra_top.gif" show as the default option by changing the file name to ".zebra_top.gif".
♡ 9. Saving the Finished Doll

The finished layers will be combined into one transparent image then exported to the user for download. Please note that at this time, animated .gifs are not supported. You can have them appear in the doll maker, but changing the color will stop the animation and the user can only download a static image.

♡ 10. Help / Troubleshooting
?

"No artwork found"

Check that the folder exists and that its name appears in parts.json.

?

My new file doesn't appear

Check the filename, folder, extension, and then refresh the page.

TIP: A hard refresh or viewing "incognito mode" can help if your browser is still showing an older version of a file.
?

The doll pieces don't line up

Check the source artwork itself. Make sure every image uses the same canvas size and that the pixels sit in the same coordinates. Open them in your image editing program and make sure they layer correctly there too.

?

My page is stuck loading

Open getAssets.php directly in your browser.

It should return the JSON rather than a PHP error.

?

An art element/asset is behind the wrong layer

Check your parts.json category order. Move the category name higher on the list to make it go farther back. Move the category name lower on the list to make it appear more in front.
See Layering your Doll for specifics on how to do this.

?

How do I add another folder for assets/doll parts?

You must do 3 things to get another folder dropdown working:
1. Create a new folder with the desired name (ex. backpack) where all your backpack images will go.
2. Edit the .json file to include "backpack", and order it on the list however you desire
3. Edit the doll.js file to include an id: (id must match folder name) and label: (label is what people see on the maker) for backpack like so: