diff options
Diffstat (limited to 'public/bluebey-studio/src/face.js')
| -rw-r--r-- | public/bluebey-studio/src/face.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/public/bluebey-studio/src/face.js b/public/bluebey-studio/src/face.js index f2440d3..0a00399 100644 --- a/public/bluebey-studio/src/face.js +++ b/public/bluebey-studio/src/face.js @@ -52,6 +52,8 @@ export class Face { // Drawings supplied for a beard kind (assets/beards/<shape>.png). Loaded by the // app; a kind without one falls back to the built-in drawing (see drawBeard). this.beardImages = {}; + // Drawings for the brows (assets/brows/<kind>.png), loaded the same way. + this.browImages = {}; this.eyeCanvas = makeCanvas(this.eyeLayout); this.mouthCanvas = makeCanvas(this.mouthLayout); this.hairCanvas = this.hairLayout ? makeCanvas(this.hairLayout, HAIR_SCALE) : null; @@ -163,6 +165,15 @@ export class Face { this.dirty = true; } + /** + * Set the drawings used for the brows, keyed by brow kind (`gol`). Called by the + * app once the files are loaded; the next redraw picks them up. + */ + setBrowImages(map) { + this.browImages = map ?? {}; + this.dirty = true; + } + /** `kind` is `'eyes'` or `'mouth'`; `source` is `'parametric'` or a variant key. */ setSource(kind, source) { if (kind === 'eyes') { @@ -237,6 +248,7 @@ export class Face { // object hung off the nose - see src/main.js - so it is not drawn here.) beard: p.eyes.beard, beards: this.beardImages, + brows: this.browImages, // 眼鏡 / サングラス are shared by both eyes and drawn into this same // texture, so they travel with the other shared eye fields. glasses: p.eyes.glasses, |
