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/main.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'public/bluebey-studio/src/main.js') diff --git a/public/bluebey-studio/src/main.js b/public/bluebey-studio/src/main.js index 051554d..b94fca0 100644 --- a/public/bluebey-studio/src/main.js +++ b/public/bluebey-studio/src/main.js @@ -50,6 +50,10 @@ function assetUrl(file, kind) { const backdrops = globalThis.__BLUEBEY_BACKGROUNDS__ ?? {}; return backdrops[file] ?? `assets/backgrounds/${file}.webp`; } + if (kind === 'beard') { + const beards = globalThis.__BLUEBEY_BEARDS__ ?? {}; + return beards[file] ?? `assets/beards/${file}`; + } return inlined[file] ?? `assets/fonts/${file}`; } @@ -385,6 +389,29 @@ async function init() { }); const animator = new Animator({ state }); + // Beard drawings supplied as files (`assets/beards/.png`): a kind that has + // one is drawn from the file instead of the built-in strokes. A missing file is + // skipped, so the app works before any are added. + void (async () => { + // Only the kinds that actually ship a drawing. Add a name here when its file is + // added to assets/beards/, so no 404s are logged for the ones without one. + const kinds = ['scotch']; + const loaded = {}; + await Promise.all(kinds.map(async (kind) => { + try { + const response = await fetch(assetUrl(`${kind}.png`, 'beard')); + if (!response.ok) return; + loaded[kind] = await createImageBitmap(await response.blob()); + } catch { + /* no drawing for this kind: the built-in one is used */ + } + })); + if (Object.keys(loaded).length) { + face.setBeardImages(loaded); + app.needsRender = true; + } + })(); + // ------------------------------------------------------------------- look const look = createLook({ renderer, -- cgit v1.3.1