diff options
| author | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-10-03 22:01:36 +0900 |
|---|---|---|
| committer | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-10-03 22:01:36 +0900 |
| commit | babd8555b9a3c59921748fa11430bfca09f3d2db (patch) | |
| tree | 80823dc5e03cc8e0b4dfba8fc2184e8187affec0 /public/bluebey-studio/src/panel.js | |
| parent | 75796bb956d8aedc35e004f620f10ab137eb0216 (diff) | |
public/bluebey-studio: ダリ・ペンシルのひげ画像と種類ごとの既定値
hige-2 を「ダリ」、hige-3 を「ペンシル」として取り込んだ(ルパンはペンシルに変更)。
ひげの種類ごとに既定の大きさ・高さを持つようにし、ちょびひげは 大きさ0.46 / 高さ74 を既定にした。
1ファイル版にもダリ・ペンシルの画像を同梱した。
Diffstat (limited to 'public/bluebey-studio/src/panel.js')
| -rw-r--r-- | public/bluebey-studio/src/panel.js | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/public/bluebey-studio/src/panel.js b/public/bluebey-studio/src/panel.js index 3312e9c..3f63eb6 100644 --- a/public/bluebey-studio/src/panel.js +++ b/public/bluebey-studio/src/panel.js @@ -4,7 +4,7 @@ import { } from './ui.js'; import { FACE_PRESETS, POSE_PRESETS, THEMES, BUBBLE_STYLES, CAPTION_PRESETS, - defaultState, applyPatch, + defaultState, applyPatch, BEARD_KIND_DEFAULTS, } from './presets.js'; import { STYLE_DEFS } from './styles.js'; import { EYE_VARIANTS } from './model.js'; @@ -161,13 +161,15 @@ export function buildPanel(app, root) { lookX: +rnd(-0.35, 0.35).toFixed(2), lookY: +rnd(-0.25, 0.25).toFixed(2), }); - const randomFacePatch = () => ({ - eyes: { - left: randomEye(), - right: randomEye(), - cheeks: { enabled: Math.random() < 0.5 }, - beard: { shape: pick(['off', 'scotch', 'kaiser', 'apron', 'cat']) }, - headMark: { shape: pick(['off', 'cap', 'fringe', 'fringe-up', 'wave', 'side']) }, + const randomFacePatch = () => { + const beardShape = pick(['off', 'scotch', 'kaiser', 'apron', 'cat']); + return { + eyes: { + left: randomEye(), + right: randomEye(), + cheeks: { enabled: Math.random() < 0.5 }, + beard: { shape: beardShape, ...(BEARD_KIND_DEFAULTS[beardShape] ?? { size: 1, offsetY: 0 }) }, + headMark: { shape: pick(['off', 'cap', 'fringe', 'fringe-up', 'wave', 'side']) }, brow: { enabled: true, angle: Math.round(rnd(-30, 40)), @@ -187,7 +189,8 @@ export function buildPanel(app, root) { tilt: Math.round(rnd(-12, 12)), offsetY: Math.round(rnd(-16, 16)), }, - }); + }; + }; const randomFace = () => replace({ face: randomFacePatch() }, 'face'); const randomAll = () => { // 後ろを向く(180°)や大きく傾くポーズは避ける。見える顔が変わる範囲だけ。 @@ -1122,11 +1125,20 @@ export function buildPanel(app, root) { { value: 'off', label: 'なし' }, { value: 'scotch', label: 'ちょびひげ' }, { value: 'kaiser', label: 'ダリ' }, - { value: 'apron', label: 'ルパン' }, + { value: 'apron', label: 'ペンシル' }, { value: 'cat', label: 'ねこ' }, ], value: 'off', - onChange: (value) => { state.face.eyes.beard.shape = value; app.actions.refresh('face'); }, + onChange: (value) => { + const beard = state.face.eyes.beard; + beard.shape = value; + // Each kind starts at its own size and height (a textured kind is drawn at a + // different scale from the built-in strokes). A kind with no entry resets to + // the neutral values, so switching kinds cannot leave a stray size behind. + Object.assign(beard, BEARD_KIND_DEFAULTS[value] ?? { size: 1, offsetY: 0 }); + app.actions.refresh('face'); + sync(); + }, }); faceSection.add(beardShape.el); const beardSliders = { @@ -1163,8 +1175,8 @@ export function buildPanel(app, root) { onChange: (v) => { state.face.eyes.beard.color = v; app.actions.refresh('face'); }, }); beardBox.add(beardColor.el); - beardBox.add(hint('鼻の下に、ちょびひげ・ダリ・ルパン・ねこ、の髭を描きます。' - + '「左右の間隔」「ひげの長さ」「線の間隔」は「ねこ」で使います。')); + beardBox.add(hint('鼻の下に、ちょびひげ・ダリ・ペンシル・ねこ、の瓢を描きます。' + + '「左右の間隔」「瓢の長さ」「線の間隔」は「ねこ」で使います。')); // --- mouth faceSection = section(tabFace, '口'); |
