Skip to content

Commit 54e9efc

Browse files
ShouqyanShouqyan
Shouqyan
authored and
Shouqyan
committed
some explanation on addLayer functionality
1 parent 156723f commit 54e9efc

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ To ensure uniqueness, we want to add various features and multiple options for e
3232
To start, copy the layers/features and their images in a flat hierarchy at a directory of your choice (by default we expect them in `./input/`). The features should contain options for each rarity that is provided via the config file.
3333

3434
After adding the `layers`, adjust them accordingly in the `config.js` by providing the directory path, positioning and sizes.
35+
Use the existing `addLayers` calls as guidance for how to add layers. This can either only use the name of the layer and will use default positioning (x=0, y=0) and sizes (width=configured width, height=configure height), or positioning and sizes can be provided for more flexibility.
3536

3637
### Allowing different rarities for certain rarity/layer combinations
3738
It is possible to provide a percentage at which e.g. a rare item would contain a rare vs. common part in a given layer. This can be done via the `addRarityPercentForLayer` that can be found in the `config.js` as well.

Diff for: input/config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ let rarityWeights = [
142142
// for each layer, call 'addLayer' with the id and optionally the positioning and size
143143
// the id would be the name of the folder in your input directory, e.g. 'ball' for ./input/ball
144144
const layers = [
145-
addLayer('ball'),
145+
addLayer('ball', { x: 0, y: 0 }, { width: width, height: height }),
146146
addLayer('eye color'),
147147
addLayer('iris'),
148148
addLayer('shine'),

0 commit comments

Comments
 (0)