diff options
| author | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-10-04 01:09:24 +0900 |
|---|---|---|
| committer | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-10-04 01:09:24 +0900 |
| commit | b939182d5a51b8535dd411a754c2088f7f1bafff (patch) | |
| tree | fd9cf4c50cd9902552632efc9ef6792adf363f45 /public/bluebey-studio/src/main.js | |
| parent | e9b8f3194c8604f5d0826df1b1e6a17cf27f68f7 (diff) | |
bluebey-studio: ゴル風の眉画像と口の長さを追加
髭と同じ仕組みで、右側だけの眉画像(assets/brows/gol-right.png)を左右に描けるようにした(「ゴル風」で自動適用、チェックで切替)。口に「口の長さ」スライダーを追加。
Diffstat (limited to 'public/bluebey-studio/src/main.js')
| -rw-r--r-- | public/bluebey-studio/src/main.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/public/bluebey-studio/src/main.js b/public/bluebey-studio/src/main.js index 548be76..3f61ad5 100644 --- a/public/bluebey-studio/src/main.js +++ b/public/bluebey-studio/src/main.js @@ -54,6 +54,10 @@ function assetUrl(file, kind) { const beards = globalThis.__BLUEBEY_BEARDS__ ?? {}; return beards[file] ?? `assets/beards/${file}`; } + if (kind === 'brow') { + const brows = globalThis.__BLUEBEY_BROWS__ ?? {}; + return brows[file] ?? `assets/brows/${file}`; + } return inlined[file] ?? `assets/fonts/${file}`; } @@ -420,6 +424,30 @@ async function init() { } })(); + // Brow drawings supplied as files (`assets/brows/<kind>.png`). A file ending + // `-right.png` is one side; it is drawn twice (mirrored) at each eye. Missing + // files are skipped, so the built-in ゴル風 strokes are the fallback. + void (async () => { + const files = [{ kind: 'gol', file: 'gol-right.png' }]; + const loaded = {}; + await Promise.all(files.map(async ({ kind, file }) => { + try { + const response = await fetch(assetUrl(file, 'brow')); + if (!response.ok) return; + loaded[kind] = { + image: await createImageBitmap(await response.blob()), + half: file.endsWith('-right.png'), + }; + } catch { + /* a missing drawing falls back to the built-in strokes */ + } + })); + if (Object.keys(loaded).length) { + face.setBrowImages(loaded); + app.needsRender = true; + } + })(); + // ------------------------------------------------------------------- look const look = createLook({ renderer, |
