From 75796bb956d8aedc35e004f620f10ab137eb0216 Mon Sep 17 00:00:00 2001 From: Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> Date: Sat, 3 Oct 2026 19:41:34 +0900 Subject: public/bluebey-studio: ひげをテクスチャに、舌を外に出すを削除 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ひげの種類に画像(assets/beards/.png)があれば、それを使って描くようにした。まず「ちょびひげ」を追加。画像が無い種類は今までどおり描画で出す。 「舌を外に出す」「外に出す舌の位置」を削除した。 「すべてをランダムに」は、スタイル(実写・フラット・線画)と左右反転を変えないようにし、後ろを向く・大きく傾くポーズは選ばないようにした。アイコンを「?!」に変更。 --- public/bluebey-studio/src/face.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'public/bluebey-studio/src/face.js') 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/.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, -- cgit v1.3.1