diff options
| author | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-10-03 19:41:34 +0900 |
|---|---|---|
| committer | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-10-03 19:41:34 +0900 |
| commit | 75796bb956d8aedc35e004f620f10ab137eb0216 (patch) | |
| tree | 17ea2fb125c08cf0c379dad1b3e54eb0afc0682e /public/bluebey-studio/src/face.js | |
| parent | e530565430622f7d1e824d27b6dc26d95024eb6f (diff) | |
public/bluebey-studio: ひげをテクスチャに、舌を外に出すを削除
ひげの種類に画像(assets/beards/<kind>.png)があれば、それを使って描くようにした。まず「ちょびひげ」を追加。画像が無い種類は今までどおり描画で出す。
「舌を外に出す」「外に出す舌の位置」を削除した。
「すべてをランダムに」は、スタイル(実写・フラット・線画)と左右反転を変えないようにし、後ろを向く・大きく傾くポーズは選ばないようにした。アイコンを「?!」に変更。
Diffstat (limited to 'public/bluebey-studio/src/face.js')
| -rw-r--r-- | public/bluebey-studio/src/face.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/public/bluebey-studio/src/face.js b/public/bluebey-studio/src/face.js index c1a0c72..0813c54 100644 --- a/public/bluebey-studio/src/face.js +++ b/public/bluebey-studio/src/face.js @@ -38,6 +38,9 @@ export class Face { }; this.customNames = new Map(); + // 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 = {}; this.eyeCanvas = makeCanvas(this.eyeLayout); this.mouthCanvas = makeCanvas(this.mouthLayout); this.eyeCtx = this.eyeCanvas.getContext('2d'); @@ -131,6 +134,16 @@ export class Face { return 'original'; } + /** + * Set the drawings used for the beards, keyed by beard kind (`scotch`, `kaiser`, + * `apron`, `cat`). Called by the app once the files are loaded; the next redraw + * picks them up. + */ + setBeardImages(map) { + this.beardImages = map ?? {}; + this.dirty = true; + } + /** `kind` is `'eyes'` or `'mouth'`; `source` is `'parametric'` or a variant key. */ setSource(kind, source) { if (kind === 'eyes') { @@ -201,6 +214,7 @@ export class Face { // ひげ is shared by the whole face as well. (鼻ちょうちん is a real 3D // object hung off the nose - see src/main.js - so it is not drawn here.) beard: p.eyes.beard, + beards: this.beardImages, // 眼鏡 / サングラス are shared by both eyes and drawn into this same // texture, so they travel with the other shared eye fields. glasses: p.eyes.glasses, |
