@kubohiroya/turbowarp-bubble 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +171 -89
- package/dist/composition.js +1005 -697
- package/dist/extension-manifest.json +224 -0
- package/dist/turbowarp-adapter.js +1333 -903
- package/dist/turbowarp-bubble.js +1158 -30
- package/dist/types/bubble-svg.d.ts +10 -0
- package/dist/types/composition.d.ts +47 -1
- package/dist/types/reveal.d.ts +26 -0
- package/dist/types/turbowarp-adapter.d.ts +2 -0
- package/docs/assets/animation-mode-guide.svg +3 -12
- package/docs/assets/bubble-lifecycle.gif +0 -0
- package/docs/block-manual.ja.md +71 -30
- package/docs/block-manual.md +71 -30
- package/docs/index.html +75 -11
- package/docs/ja/index.html +75 -11
- package/package.json +30 -26
package/docs/index.html
CHANGED
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
<p>This manual explains how to use <code>turbowarp-bubble</code> as an unsandboxed TurboWarp custom extension. A Bubble combines an SVG body, text, a character portrait, blinking and lip-sync layers, and an animated continue indicator.</p>
|
|
72
72
|
<p><img src="./assets/block-quick-start.svg" alt="A quick-start block sequence that registers Next1 and Next2 separately, prepares input listeners, then uses Bubble's integrated wait"></p>
|
|
73
73
|
<h2 id="requirements">1. Load the required extensions</h2>
|
|
74
|
-
<p>The complete input-wait example uses six extensions. Add Temporary Variables from TurboWarp's extension library, then load the custom extensions needed by the selected features with <strong>Run without sandbox</strong> enabled. SVG Text and Bubble are required for text bubbles. Asset Manager is required for portrait, lip-sync, continue indicator,
|
|
74
|
+
<p>The complete input-wait example uses six extensions. Add Temporary Variables from TurboWarp's extension library, then load the custom extensions needed by the selected features with <strong>Run without sandbox</strong> enabled. SVG Text and Bubble are required for text bubbles. Asset Manager is required for portrait, lip-sync, continue indicator, voice, and display-sound assets. Async Input and Runtime Expression are required only before using a Bubble wait.</p>
|
|
75
75
|
<table>
|
|
76
76
|
<thead>
|
|
77
77
|
<tr>
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
</tr>
|
|
108
108
|
<tr>
|
|
109
109
|
<td align="right">6</td>
|
|
110
|
-
<td>Bubble 0.
|
|
111
|
-
<td>After npm publication: <code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.
|
|
110
|
+
<td>Bubble 0.3.1</td>
|
|
111
|
+
<td>After npm publication: <code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.3.1/dist/turbowarp-bubble.js</code></td>
|
|
112
112
|
</tr>
|
|
113
113
|
</tbody></table>
|
|
114
114
|
<p>To try a development build, load this repository's <code>dist/turbowarp-bubble.js</code> as a local custom extension. Bubble reports an explicit error if SVG Text is missing when it displays a Bubble, if an image/media feature is used without Asset Manager, or if Async Input or Runtime Expression is missing when it starts a Bubble wait.</p>
|
|
@@ -270,7 +270,17 @@ set continue frames [Next1,Next2]
|
|
|
270
270
|
<li>An empty <code>ASSETS</code> input removes that animation.</li>
|
|
271
271
|
<li>An empty portrait base removes the whole portrait.</li>
|
|
272
272
|
</ul>
|
|
273
|
-
<h2 id="lifecycle">5.
|
|
273
|
+
<h2 id="lifecycle">5. Sequential reveal, audio, and layout</h2>
|
|
274
|
+
<p>Bubble can reveal a message as <code>CHARACTER</code>, <code>WORD</code>, <code>LINE</code>, or <code>BLOCK</code> units. <code>WORD</code> does not perform morphological analysis; it uses whitespace or the configured delimiter character set. Delimiters can remain visible or be hidden.</p>
|
|
275
|
+
<pre><code class="language-text">set bubble reveal unit [CHARACTER] every [0.05] seconds layout [RESERVED] for bubble style [hero-dialogue]
|
|
276
|
+
set bubble word delimiters [ /] show [false] for bubble style [hero-dialogue]
|
|
277
|
+
set bubble reveal sound [Typewriter] for bubble style [hero-dialogue]
|
|
278
|
+
set bubble voice [HeroVoice] for bubble style [hero-dialogue]
|
|
279
|
+
say [Let's head for the sea!] with bubble style [hero-dialogue]
|
|
280
|
+
finish [CHARACTER] with condition [input == "pressed"] or timeout after [10] seconds
|
|
281
|
+
</code></pre>
|
|
282
|
+
<p><code>DYNAMIC</code> recalculates the Bubble size and placement after each unit. <code>RESERVED</code> measures the final text first and reserves that layout while units appear. <code>set bubble reveal sound</code> plays a named Asset Manager audio asset per unit, while <code>set bubble voice</code> plays full voice audio when the Bubble starts. Text display remains available without audio.</p>
|
|
283
|
+
<h2 id="animation-modes">6. Show dialogue and wait for input</h2>
|
|
274
284
|
<p><code>say</code> and <code>think</code> show a Bubble immediately, continue to the next block, and begin in <code>talking</code> animation mode.</p>
|
|
275
285
|
<pre><code class="language-text">set runtime variable [input] to []
|
|
276
286
|
listen for key [Space] set runtime var [input] to [pressed]
|
|
@@ -285,7 +295,7 @@ close this bubble
|
|
|
285
295
|
<p><img src="./assets/bubble-lifecycle.gif" alt="A say Bubble lip-syncs, shows continue frames while awaiting continue, then closes after input"></p>
|
|
286
296
|
<p>If animated GIF playback is unavailable, use this static animation-mode comparison:</p>
|
|
287
297
|
<p><img src="./assets/animation-mode-guide.svg" alt="Blink, lip-sync, and continue-frame states in talking, awaiting-continue, and idle modes"></p>
|
|
288
|
-
<h2 id="
|
|
298
|
+
<h2 id="say-think">7. Bubble animation modes</h2>
|
|
289
299
|
<table>
|
|
290
300
|
<thead>
|
|
291
301
|
<tr>
|
|
@@ -319,13 +329,23 @@ close this bubble
|
|
|
319
329
|
</tr>
|
|
320
330
|
</tbody></table>
|
|
321
331
|
<p><code>set this bubble animation mode [MODE]</code> changes only the Bubble owned by the calling sprite, clone, or Stage. It reports an error if that target has not first run <code>say</code> or <code>think</code>.</p>
|
|
322
|
-
<h2 id="
|
|
332
|
+
<h2 id="clones">8. Show, in-display, and hide animations</h2>
|
|
333
|
+
<p>Use <code>fadeIn</code>, <code>floatIn</code>, <code>zoomIn</code>, or <code>riseUp</code> when a Bubble starts displaying, and <code>fadeOut</code>, <code>floatOut</code>, <code>zoomOut</code>, or <code>sink</code> when it finishes displaying. These animations work with both <code>DYNAMIC</code> and <code>RESERVED</code> layout.</p>
|
|
334
|
+
<pre><code class="language-text">set bubble show animation [fadeIn] for [0.2] seconds for bubble style [hero-dialogue]
|
|
335
|
+
set bubble hide animation [fadeOut] for [0.2] seconds for bubble style [hero-dialogue]
|
|
336
|
+
animate this bubble [shake]
|
|
337
|
+
shake this bubble direction [90] count [2] ease [easeInOut]
|
|
338
|
+
explode this bubble relative scale [1.15] count [2] ease [easeOut]
|
|
339
|
+
animate bubble shape to [WAVY] speed [1] for [0.5] seconds
|
|
340
|
+
</code></pre>
|
|
341
|
+
<p>The TurboWarp adapter advances these motions on scheduler frames and applies <code>ease</code> to each frame. <code>shake</code> applies direction and count to the complete Bubble surface, <code>explode</code> expands and returns the relative scale of text and portrait together, and <code>animate bubble shape</code> cross-fades the current outline into styles such as <code>THINKING</code>, <code>DREAMING</code>, <code>YELLING</code>, <code>WAVY</code>, or <code>WHISPERING</code> during the requested speed and duration.</p>
|
|
342
|
+
<h2 id="reference">9. <code>say</code> and <code>think</code></h2>
|
|
323
343
|
<pre><code class="language-text">say [MESSAGE] with bubble style [STYLE]
|
|
324
344
|
think [MESSAGE] with bubble style [STYLE]
|
|
325
345
|
</code></pre>
|
|
326
346
|
<p>Both blocks support the same visual styles, portrait layers, placement, and animation-mode control. The block name does not force a shape; explicitly choose <code>NORMAL</code>, <code>THINKING</code>, or another shape with <code>set bubble visual style</code>. The Composition API surface still receives a <code>say</code>/<code>think</code> kind, so a custom host can add its own kind-dependent behavior.</p>
|
|
327
347
|
<p>Running a new <code>say</code> or <code>think</code> on the same sprite, clone, or Stage disposes the previous Bubble and its timers/drawables before replacing it. The Stage supports stage-relative placement only.</p>
|
|
328
|
-
<h2 id="
|
|
348
|
+
<h2 id="troubleshooting">10. Using Bubble with clones</h2>
|
|
329
349
|
<p>Bubble style definitions are shared within the extension, but each sprite or clone owns its currently displayed Bubble.</p>
|
|
330
350
|
<ol>
|
|
331
351
|
<li>Define assets and styles once from the original sprite when the green flag is clicked.</li>
|
|
@@ -333,7 +353,7 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
333
353
|
<li>Change the animation mode and close the Bubble from the same clone that displayed it.</li>
|
|
334
354
|
</ol>
|
|
335
355
|
<p>When a clone stops or is deleted, timers, SVG Text skins, and renderer drawables owned by that target are released automatically.</p>
|
|
336
|
-
<h2 id="
|
|
356
|
+
<h2 id="cleanup">11. Block reference</h2>
|
|
337
357
|
<table>
|
|
338
358
|
<thead>
|
|
339
359
|
<tr>
|
|
@@ -382,6 +402,50 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
382
402
|
<td>Set the animation shown during <code>awaiting-continue</code></td>
|
|
383
403
|
</tr>
|
|
384
404
|
<tr>
|
|
405
|
+
<td><code>set bubble reveal unit [UNIT] every [SECONDS] seconds layout [LAYOUT] for bubble style [STYLE]</code></td>
|
|
406
|
+
<td>Configure CHARACTER/WORD/LINE/BLOCK sequential reveal</td>
|
|
407
|
+
</tr>
|
|
408
|
+
<tr>
|
|
409
|
+
<td><code>set bubble word delimiters [DELIMITERS] show [SHOW] for bubble style [STYLE]</code></td>
|
|
410
|
+
<td>Configure WORD delimiters and visibility</td>
|
|
411
|
+
</tr>
|
|
412
|
+
<tr>
|
|
413
|
+
<td><code>set bubble reveal sound [ASSET] for bubble style [STYLE]</code></td>
|
|
414
|
+
<td>Set the per-unit reveal sound</td>
|
|
415
|
+
</tr>
|
|
416
|
+
<tr>
|
|
417
|
+
<td><code>set bubble voice [ASSET] for bubble style [STYLE]</code></td>
|
|
418
|
+
<td>Set full voice played when display starts</td>
|
|
419
|
+
</tr>
|
|
420
|
+
<tr>
|
|
421
|
+
<td><code>finish [UNIT] with condition [CONDITION] or timeout after [TIMEOUT] seconds</code></td>
|
|
422
|
+
<td>Reveal remaining units and wait for condition or timeout</td>
|
|
423
|
+
</tr>
|
|
424
|
+
<tr>
|
|
425
|
+
<td><code>set bubble show animation [MOTION] for [SECONDS] seconds for bubble style [STYLE]</code></td>
|
|
426
|
+
<td>Configure show animation</td>
|
|
427
|
+
</tr>
|
|
428
|
+
<tr>
|
|
429
|
+
<td><code>set bubble hide animation [MOTION] for [SECONDS] seconds for bubble style [STYLE]</code></td>
|
|
430
|
+
<td>Configure hide animation</td>
|
|
431
|
+
</tr>
|
|
432
|
+
<tr>
|
|
433
|
+
<td><code>animate this bubble [MOTION]</code></td>
|
|
434
|
+
<td>Play a whole-Bubble animation</td>
|
|
435
|
+
</tr>
|
|
436
|
+
<tr>
|
|
437
|
+
<td><code>shake this bubble direction [DIRECTION] count [COUNT] ease [EASE]</code></td>
|
|
438
|
+
<td>Shake the complete Bubble surface</td>
|
|
439
|
+
</tr>
|
|
440
|
+
<tr>
|
|
441
|
+
<td><code>explode this bubble relative scale [SCALE] count [COUNT] ease [EASE]</code></td>
|
|
442
|
+
<td>Apply relative scale cycles to the Bubble</td>
|
|
443
|
+
</tr>
|
|
444
|
+
<tr>
|
|
445
|
+
<td><code>animate bubble shape to [VISUAL_STYLE] speed [SPEED] for [SECONDS] seconds</code></td>
|
|
446
|
+
<td>Transition the Bubble outline</td>
|
|
447
|
+
</tr>
|
|
448
|
+
<tr>
|
|
385
449
|
<td><code>say [MESSAGE] with bubble style [STYLE]</code></td>
|
|
386
450
|
<td>Start or replace a <code>say</code> Bubble in <code>talking</code> mode</td>
|
|
387
451
|
</tr>
|
|
@@ -406,7 +470,7 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
406
470
|
<td>Report the Bubble implementation version</td>
|
|
407
471
|
</tr>
|
|
408
472
|
</tbody></table>
|
|
409
|
-
<h2 id="
|
|
473
|
+
<h2 id="regeneration">12. Troubleshooting</h2>
|
|
410
474
|
<table>
|
|
411
475
|
<thead>
|
|
412
476
|
<tr>
|
|
@@ -463,7 +527,7 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
463
527
|
<td>Match canvas size, center, and transparent area across all portrait layers</td>
|
|
464
528
|
</tr>
|
|
465
529
|
</tbody></table>
|
|
466
|
-
<h2
|
|
530
|
+
<h2>13. Automatic cleanup</h2>
|
|
467
531
|
<p>Bubble automatically releases its owned timers, SVG Text skins, and renderer drawables when:</p>
|
|
468
532
|
<ul>
|
|
469
533
|
<li><code>close this bubble</code> runs;</li>
|
|
@@ -474,7 +538,7 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
474
538
|
<li>the TurboWarp runtime is disposed.</li>
|
|
475
539
|
</ul>
|
|
476
540
|
<p>Assets registered with Asset Manager are not owned by Bubble. To remove an unused registered image from memory, close the Bubble first and then use Asset Manager's <code>delete asset [NAME] from memory</code> block.</p>
|
|
477
|
-
<h2
|
|
541
|
+
<h2>14. Regenerating the manual assets</h2>
|
|
478
542
|
<p>The diagrams and GIF are generated from scripts in this repository. GIF generation requires the ImageMagick <code>magick</code> command.</p>
|
|
479
543
|
<pre><code class="language-sh">pnpm docs:render
|
|
480
544
|
pnpm docs:check
|
package/docs/ja/index.html
CHANGED
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
<p>このマニュアルでは、<code>turbowarp-bubble</code>をTurboWarpのカスタム拡張機能として使い、SVG本体、文字、キャラクター表情、目パチ、口パク、「次へ」アイコンを組み合わせたBubbleを表示します。</p>
|
|
72
72
|
<p><img src="../assets/block-quick-start.svg" alt="Next1とNext2を個別登録し、入力listenerを準備してBubble内蔵待機を使うブロック例"></p>
|
|
73
73
|
<h2 id="requirements">1. 必要な拡張機能</h2>
|
|
74
|
-
<p>入力待ちを含む完全な例では6つの拡張機能を使います。TurboWarpの拡張機能ライブラリからTemporary Variablesを追加し、選択した機能に必要なカスタム拡張機能を「サンドボックスなしで実行」を許可して読み込みます。文字BubbleにはSVG TextとBubbleが必要です。portrait、lip-sync、continue indicator
|
|
74
|
+
<p>入力待ちを含む完全な例では6つの拡張機能を使います。TurboWarpの拡張機能ライブラリからTemporary Variablesを追加し、選択した機能に必要なカスタム拡張機能を「サンドボックスなしで実行」を許可して読み込みます。文字BubbleにはSVG TextとBubbleが必要です。portrait、lip-sync、continue indicator、フルボイス、表示効果音などのメディアアセットにはAsset Managerが必要です。Async InputとRuntime ExpressionはBubble待機を使う場合だけ必要です。</p>
|
|
75
75
|
<table>
|
|
76
76
|
<thead>
|
|
77
77
|
<tr>
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
</tr>
|
|
108
108
|
<tr>
|
|
109
109
|
<td align="right">6</td>
|
|
110
|
-
<td>Bubble 0.
|
|
111
|
-
<td>npm公開後は<code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.
|
|
110
|
+
<td>Bubble 0.3.1</td>
|
|
111
|
+
<td>npm公開後は<code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.3.1/dist/turbowarp-bubble.js</code></td>
|
|
112
112
|
</tr>
|
|
113
113
|
</tbody></table>
|
|
114
114
|
<p>開発中のBubbleを試す場合は、このリポジトリの<code>dist/turbowarp-bubble.js</code>をローカルカスタム拡張機能として読み込みます。表示時にSVG Textが、画像・メディア機能の使用時にAsset Managerが、待機開始時にAsync InputかRuntime Expressionが見つからなければ、Bubbleは明示的なエラーを返します。</p>
|
|
@@ -270,7 +270,17 @@ set continue frames [Next1,Next2]
|
|
|
270
270
|
<li><code>ASSETS</code>を空にすると、そのアニメーション設定を解除します。</li>
|
|
271
271
|
<li>表情ベースを空にするとportrait全体を解除します。</li>
|
|
272
272
|
</ul>
|
|
273
|
-
<h2 id="lifecycle">5.
|
|
273
|
+
<h2 id="lifecycle">5. 逐次表示、音声、表示サイズ</h2>
|
|
274
|
+
<p>Bubbleはセリフ全体を一度に描画するだけでなく、<code>CHARACTER</code>、<code>WORD</code>、<code>LINE</code>、<code>BLOCK</code>の単位で順次表示できます。<code>WORD</code>は形態素解析を行わず、空白または指定した区切り文字集合で分割します。区切り文字を表示するかどうかも選べます。</p>
|
|
275
|
+
<pre><code class="language-text">set bubble reveal unit [CHARACTER] every [0.05] seconds layout [RESERVED] for bubble style [hero-dialogue]
|
|
276
|
+
set bubble word delimiters [ /] show [false] for bubble style [hero-dialogue]
|
|
277
|
+
set bubble reveal sound [Typewriter] for bubble style [hero-dialogue]
|
|
278
|
+
set bubble voice [HeroVoice] for bubble style [hero-dialogue]
|
|
279
|
+
say [海へ出発!] with bubble style [hero-dialogue]
|
|
280
|
+
finish [CHARACTER] with condition [input == "pressed"] or timeout after [10] seconds
|
|
281
|
+
</code></pre>
|
|
282
|
+
<p><code>DYNAMIC</code>は表示単位ごとに吹き出しの大きさと配置を再計算し、<code>RESERVED</code>は最終的な文字量を先に計測して表示中の外形を予約します。<code>set bubble reveal sound</code>は単位ごと、<code>set bubble voice</code>は表示開始時にAsset Managerの名前付き音声を再生します。音声がなくても文字表示は利用できます。</p>
|
|
283
|
+
<h2 id="animation-modes">6. セリフを表示して入力を待つ</h2>
|
|
274
284
|
<p><code>say</code>または<code>think</code>はBubbleを表示するとすぐ次のブロックへ進み、初期animation modeは<code>talking</code>になります。</p>
|
|
275
285
|
<pre><code class="language-text">set runtime variable [input] to []
|
|
276
286
|
listen for key [Space] set runtime var [input] to [pressed]
|
|
@@ -285,7 +295,7 @@ close this bubble
|
|
|
285
295
|
<p><img src="../assets/bubble-lifecycle.gif" alt="sayで口パクし、awaiting-continueでcontinue framesを動かし、入力成立後にBubbleを閉じるアニメーション"></p>
|
|
286
296
|
<p>アニメーションGIFを再生できない環境では、次の比較図で各animation modeを確認できます。</p>
|
|
287
297
|
<p><img src="../assets/animation-mode-guide.svg" alt="talking、awaiting-continue、idleの目パチ、口パク、continue framesの状態比較"></p>
|
|
288
|
-
<h2 id="
|
|
298
|
+
<h2 id="say-think">7. Animation modeの使い分け</h2>
|
|
289
299
|
<table>
|
|
290
300
|
<thead>
|
|
291
301
|
<tr>
|
|
@@ -319,13 +329,23 @@ close this bubble
|
|
|
319
329
|
</tr>
|
|
320
330
|
</tbody></table>
|
|
321
331
|
<p><code>set this bubble animation mode [MODE]</code>は、呼び出したsprite、clone、またはStageが所有するBubbleだけを変更します。先に<code>say</code>または<code>think</code>を実行していない場合はエラーになります。</p>
|
|
322
|
-
<h2 id="
|
|
332
|
+
<h2 id="clones">8. 表示開始・表示中・表示終了animation</h2>
|
|
333
|
+
<p>表示開始は<code>fadeIn</code>、<code>floatIn</code>、<code>zoomIn</code>、<code>riseUp</code>、表示終了は<code>fadeOut</code>、<code>floatOut</code>、<code>zoomOut</code>、<code>sink</code>から選べます。これらは<code>DYNAMIC</code>と<code>RESERVED</code>のどちらにも適用できます。</p>
|
|
334
|
+
<pre><code class="language-text">set bubble show animation [fadeIn] for [0.2] seconds for bubble style [hero-dialogue]
|
|
335
|
+
set bubble hide animation [fadeOut] for [0.2] seconds for bubble style [hero-dialogue]
|
|
336
|
+
animate this bubble [shake]
|
|
337
|
+
shake this bubble direction [90] count [2] ease [easeInOut]
|
|
338
|
+
explode this bubble relative scale [1.15] count [2] ease [easeOut]
|
|
339
|
+
animate bubble shape to [WAVY] speed [1] for [0.5] seconds
|
|
340
|
+
</code></pre>
|
|
341
|
+
<p>TurboWarp adapterはこれらをschedulerのフレームごとに進め、各フレームの進行率へ<code>ease</code>を適用します。<code>shake</code>は吹き出し全体を方向・回数付きで揺らし、<code>explode</code>はportraitと文字を含むsurface全体を拡大して元へ戻し、<code>animate bubble shape</code>は指定時間中に現在の外形から<code>THINKING</code>、<code>DREAMING</code>、<code>YELLING</code>、<code>WAVY</code>、<code>WHISPERING</code>などへcross-fadeします。仕様では、吹き出しが表示される時点を「表示開始」、隠れる時点を「表示終了」と呼びます。</p>
|
|
342
|
+
<h2 id="reference">9. sayとthink</h2>
|
|
323
343
|
<pre><code class="language-text">say [MESSAGE] with bubble style [STYLE]
|
|
324
344
|
think [MESSAGE] with bubble style [STYLE]
|
|
325
345
|
</code></pre>
|
|
326
346
|
<p>どちらも同じvisual style、表情レイヤー、placement、animation mode制御を使えます。<code>say</code>/<code>think</code>だけで形状を固定せず、<code>set bubble visual style</code>で<code>NORMAL</code>、<code>THINKING</code>などを明示的に選びます。Composition APIのsurfaceには<code>say</code>/<code>think</code>のkindも渡されるため、独自hostではkindに応じた追加表現も可能です。</p>
|
|
327
347
|
<p>同じsprite、clone、またはStageで新しい<code>say</code>/<code>think</code>を実行すると、以前のBubbleをtimerやdrawableごと破棄してから置き換えます。Stageでは背景相対placementだけを使用できます。</p>
|
|
328
|
-
<h2 id="
|
|
348
|
+
<h2 id="troubleshooting">10. cloneで使う</h2>
|
|
329
349
|
<p>Bubble styleの定義は拡張機能内で共有されますが、表示中のBubbleはsprite/cloneごとに所有されます。</p>
|
|
330
350
|
<ol>
|
|
331
351
|
<li>元spriteで、緑の旗が押されたときにアセットとstyleを1回定義します。</li>
|
|
@@ -333,7 +353,7 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
333
353
|
<li>animation mode変更とcloseも、表示したのと同じcloneから実行します。</li>
|
|
334
354
|
</ol>
|
|
335
355
|
<p>cloneが停止・削除された場合は、そのtargetに属するtimer、SVG Text skin、drawableが自動解放されます。</p>
|
|
336
|
-
<h2 id="
|
|
356
|
+
<h2 id="cleanup">11. ブロック一覧</h2>
|
|
337
357
|
<table>
|
|
338
358
|
<thead>
|
|
339
359
|
<tr>
|
|
@@ -382,6 +402,50 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
382
402
|
<td><code>awaiting-continue</code>中の「次へ」アニメーションを設定する</td>
|
|
383
403
|
</tr>
|
|
384
404
|
<tr>
|
|
405
|
+
<td><code>set bubble reveal unit [UNIT] every [SECONDS] seconds layout [LAYOUT] for bubble style [STYLE]</code></td>
|
|
406
|
+
<td>CHARACTER/WORD/LINE/BLOCKの逐次表示を設定する</td>
|
|
407
|
+
</tr>
|
|
408
|
+
<tr>
|
|
409
|
+
<td><code>set bubble word delimiters [DELIMITERS] show [SHOW] for bubble style [STYLE]</code></td>
|
|
410
|
+
<td>WORDの区切り文字集合と表示可否を設定する</td>
|
|
411
|
+
</tr>
|
|
412
|
+
<tr>
|
|
413
|
+
<td><code>set bubble reveal sound [ASSET] for bubble style [STYLE]</code></td>
|
|
414
|
+
<td>表示単位ごとの効果音を設定する</td>
|
|
415
|
+
</tr>
|
|
416
|
+
<tr>
|
|
417
|
+
<td><code>set bubble voice [ASSET] for bubble style [STYLE]</code></td>
|
|
418
|
+
<td>表示開始時のフルボイスを設定する</td>
|
|
419
|
+
</tr>
|
|
420
|
+
<tr>
|
|
421
|
+
<td><code>finish [UNIT] with condition [CONDITION] or timeout after [TIMEOUT] seconds</code></td>
|
|
422
|
+
<td>未表示単位を最後まで進め、条件またはtimeoutを待つ</td>
|
|
423
|
+
</tr>
|
|
424
|
+
<tr>
|
|
425
|
+
<td><code>set bubble show animation [MOTION] for [SECONDS] seconds for bubble style [STYLE]</code></td>
|
|
426
|
+
<td>表示開始animationを設定する</td>
|
|
427
|
+
</tr>
|
|
428
|
+
<tr>
|
|
429
|
+
<td><code>set bubble hide animation [MOTION] for [SECONDS] seconds for bubble style [STYLE]</code></td>
|
|
430
|
+
<td>表示終了animationを設定する</td>
|
|
431
|
+
</tr>
|
|
432
|
+
<tr>
|
|
433
|
+
<td><code>animate this bubble [MOTION]</code></td>
|
|
434
|
+
<td>Bubble全体のanimationを再生する</td>
|
|
435
|
+
</tr>
|
|
436
|
+
<tr>
|
|
437
|
+
<td><code>shake this bubble direction [DIRECTION] count [COUNT] ease [EASE]</code></td>
|
|
438
|
+
<td>吹き出し全体を指定方向へ揺らす</td>
|
|
439
|
+
</tr>
|
|
440
|
+
<tr>
|
|
441
|
+
<td><code>explode this bubble relative scale [SCALE] count [COUNT] ease [EASE]</code></td>
|
|
442
|
+
<td>吹き出し全体を相対倍率で変化させる</td>
|
|
443
|
+
</tr>
|
|
444
|
+
<tr>
|
|
445
|
+
<td><code>animate bubble shape to [VISUAL_STYLE] speed [SPEED] for [SECONDS] seconds</code></td>
|
|
446
|
+
<td>Bubble外形を時間経過で切り替える</td>
|
|
447
|
+
</tr>
|
|
448
|
+
<tr>
|
|
385
449
|
<td><code>say [MESSAGE] with bubble style [STYLE]</code></td>
|
|
386
450
|
<td><code>talking</code> modeでsay表示を開始・置換する</td>
|
|
387
451
|
</tr>
|
|
@@ -406,7 +470,7 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
406
470
|
<td>Bubble実装versionを返す</td>
|
|
407
471
|
</tr>
|
|
408
472
|
</tbody></table>
|
|
409
|
-
<h2 id="
|
|
473
|
+
<h2 id="regeneration">12. よくあるエラー</h2>
|
|
410
474
|
<table>
|
|
411
475
|
<thead>
|
|
412
476
|
<tr>
|
|
@@ -463,7 +527,7 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
463
527
|
<td>ベースと全差分のcanvasサイズ、中心、透明領域を揃える</td>
|
|
464
528
|
</tr>
|
|
465
529
|
</tbody></table>
|
|
466
|
-
<h2
|
|
530
|
+
<h2>13. 自動解放されるタイミング</h2>
|
|
467
531
|
<p>次の場合、Bubbleが所有するtimer、SVG Text skin、renderer drawableは自動的に解放されます。</p>
|
|
468
532
|
<ul>
|
|
469
533
|
<li><code>close this bubble</code></li>
|
|
@@ -474,7 +538,7 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
474
538
|
<li>TurboWarp runtimeの破棄</li>
|
|
475
539
|
</ul>
|
|
476
540
|
<p>Asset Managerへ登録したアセット自体はBubbleの所有物ではありません。不要になった登録画像をメモリから削除する場合は、Bubbleを閉じた後にAsset Managerの<code>delete asset [NAME] from memory</code>を使います。</p>
|
|
477
|
-
<h2
|
|
541
|
+
<h2>14. マニュアル画像の再生成</h2>
|
|
478
542
|
<p>図とGIFはリポジトリ内のスクリプトから再生成できます。GIF生成にはImageMagickの<code>magick</code>コマンドが必要です。</p>
|
|
479
543
|
<pre><code class="language-sh">pnpm docs:render
|
|
480
544
|
pnpm docs:check
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubohiroya/turbowarp-bubble",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Composable say and think bubbles with portrait layers and animated continue indicators for TurboWarp.",
|
|
5
5
|
"author": "Hiroya Kubo <hiroya@cuc.ac.jp>",
|
|
6
6
|
"type": "module",
|
|
@@ -43,6 +43,29 @@
|
|
|
43
43
|
"access": "public",
|
|
44
44
|
"registry": "https://registry.npmjs.org/"
|
|
45
45
|
},
|
|
46
|
+
"packageManager": "pnpm@11.18.0",
|
|
47
|
+
"scripts": {
|
|
48
|
+
"typecheck": "tsc --noEmit",
|
|
49
|
+
"build": "pnpm build:extension && pnpm build:composition && pnpm build:turbowarp-adapter && pnpm build:types",
|
|
50
|
+
"build:extension": "vite build",
|
|
51
|
+
"build:composition": "vite build --config vite.composition.config.ts",
|
|
52
|
+
"build:turbowarp-adapter": "vite build --config vite.turbowarp-adapter.config.ts",
|
|
53
|
+
"build:types": "tsc --project tsconfig.build.json",
|
|
54
|
+
"types:composition:check": "tsc --project tsconfig.composition-consumer.json",
|
|
55
|
+
"lint": "eslint src tests scripts vite.config.ts vite.composition.config.ts vite.turbowarp-adapter.config.ts eslint.config.mjs",
|
|
56
|
+
"format": "prettier --check .",
|
|
57
|
+
"format:write": "prettier --write .",
|
|
58
|
+
"docs:render": "node scripts/render-block-manual-assets.mjs && pnpm docs:pages",
|
|
59
|
+
"docs:pages": "node scripts/render-pages.mjs",
|
|
60
|
+
"docs:pages:check": "node scripts/render-pages.mjs --check",
|
|
61
|
+
"docs:check": "node scripts/check-block-manual.mjs && pnpm docs:pages:check",
|
|
62
|
+
"test": "vitest run",
|
|
63
|
+
"check:dist": "pnpm build && node scripts/check-dist.mjs",
|
|
64
|
+
"pack:check": "npm pack --dry-run --ignore-scripts",
|
|
65
|
+
"release:check": "pnpm publish --dry-run --access public",
|
|
66
|
+
"check": "pnpm typecheck && pnpm lint && pnpm format && pnpm test && pnpm docs:check && pnpm check:dist && pnpm types:composition:check && pnpm pack:check",
|
|
67
|
+
"prepack": "pnpm check"
|
|
68
|
+
},
|
|
46
69
|
"peerDependencies": {
|
|
47
70
|
"@kubohiroya/turbowarp-asset-manager": ">=0.7.0 <1",
|
|
48
71
|
"@kubohiroya/turbowarp-async-input": ">=0.3.0 <1",
|
|
@@ -69,6 +92,7 @@
|
|
|
69
92
|
"@kubohiroya/vite-plugin-turbowarp-extension": "0.1.1",
|
|
70
93
|
"@types/node": "^26.1.2",
|
|
71
94
|
"eslint": "^10.8.0",
|
|
95
|
+
"jsclipper": "github:platener/jsclipper#56aed19845113e1939d8971c47233054659436b1",
|
|
72
96
|
"marked": "18.0.9",
|
|
73
97
|
"prettier": "^3.9.6",
|
|
74
98
|
"typescript": "^6.0.3",
|
|
@@ -83,31 +107,11 @@
|
|
|
83
107
|
"speech-bubble",
|
|
84
108
|
"portrait",
|
|
85
109
|
"lip-sync",
|
|
86
|
-
"continue-indicator"
|
|
110
|
+
"continue-indicator",
|
|
111
|
+
"sequential-reveal",
|
|
112
|
+
"bubble-animation"
|
|
87
113
|
],
|
|
88
114
|
"dependencies": {
|
|
89
|
-
"@cto.af/linebreak": "4.0.3"
|
|
90
|
-
"jsclipper": "github:platener/jsclipper#56aed19845113e1939d8971c47233054659436b1"
|
|
91
|
-
},
|
|
92
|
-
"scripts": {
|
|
93
|
-
"typecheck": "tsc --noEmit",
|
|
94
|
-
"build": "pnpm build:extension && pnpm build:composition && pnpm build:turbowarp-adapter && pnpm build:types",
|
|
95
|
-
"build:extension": "vite build",
|
|
96
|
-
"build:composition": "vite build --config vite.composition.config.ts",
|
|
97
|
-
"build:turbowarp-adapter": "vite build --config vite.turbowarp-adapter.config.ts",
|
|
98
|
-
"build:types": "tsc --project tsconfig.build.json",
|
|
99
|
-
"types:composition:check": "tsc --project tsconfig.composition-consumer.json",
|
|
100
|
-
"lint": "eslint src tests scripts vite.config.ts vite.composition.config.ts vite.turbowarp-adapter.config.ts eslint.config.mjs",
|
|
101
|
-
"format": "prettier --check .",
|
|
102
|
-
"format:write": "prettier --write .",
|
|
103
|
-
"docs:render": "node scripts/render-block-manual-assets.mjs && pnpm docs:pages",
|
|
104
|
-
"docs:pages": "node scripts/render-pages.mjs",
|
|
105
|
-
"docs:pages:check": "node scripts/render-pages.mjs --check",
|
|
106
|
-
"docs:check": "node scripts/check-block-manual.mjs && pnpm docs:pages:check",
|
|
107
|
-
"test": "vitest run",
|
|
108
|
-
"check:dist": "pnpm build && node scripts/check-dist.mjs",
|
|
109
|
-
"pack:check": "npm pack --dry-run --ignore-scripts",
|
|
110
|
-
"release:check": "pnpm publish --dry-run --access public",
|
|
111
|
-
"check": "pnpm typecheck && pnpm lint && pnpm format && pnpm test && pnpm docs:check && pnpm check:dist && pnpm types:composition:check && pnpm pack:check"
|
|
115
|
+
"@cto.af/linebreak": "4.0.3"
|
|
112
116
|
}
|
|
113
|
-
}
|
|
117
|
+
}
|