@kubohiroya/turbowarp-bubble 0.1.1 → 0.2.0
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 +225 -31
- package/dist/composition.js +696 -625
- package/dist/extension-manifest.json +22 -22
- package/dist/turbowarp-adapter.js +1209 -533
- package/dist/turbowarp-bubble.js +1800 -346
- package/dist/types/composition.d.ts +49 -17
- package/dist/types/turbowarp-adapter.d.ts +10 -2
- package/docs/assets/animation-mode-guide.svg +2 -2
- package/docs/assets/block-quick-start.svg +8 -8
- package/docs/assets/bubble-lifecycle.gif +0 -0
- package/docs/block-manual.ja.md +37 -37
- package/docs/block-manual.md +44 -44
- package/docs/index.html +31 -31
- package/docs/ja/index.html +23 -23
- package/package.json +42 -33
package/docs/index.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
-
<meta name="description" content="Block manual for TurboWarp Bubble, including shapes, placement, portraits, blinking, lip-sync, and the animated
|
|
6
|
+
<meta name="description" content="Block manual for TurboWarp Bubble, including shapes, placement, portraits, blinking, lip-sync, and the animated continue indicator.">
|
|
7
7
|
<title>TurboWarp Bubble Block Manual</title>
|
|
8
8
|
<style>
|
|
9
9
|
:root { color-scheme: light dark; --ink: #25283a; --muted: #667085; --accent: #d94b68; --accent-strong: #b83255; --accent-soft: #fff0f4; --line: #d9deea; --panel: #fff; --page: #f2f4f8; --code: #25283a; }
|
|
@@ -68,10 +68,10 @@
|
|
|
68
68
|
</header>
|
|
69
69
|
<main id="manual" class="manual">
|
|
70
70
|
<h1>TurboWarp Bubble Block Manual</h1>
|
|
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
|
|
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
|
|
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, and future voice or 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>
|
|
@@ -102,16 +102,16 @@
|
|
|
102
102
|
</tr>
|
|
103
103
|
<tr>
|
|
104
104
|
<td align="right">5</td>
|
|
105
|
-
<td>SVG Text 0.
|
|
106
|
-
<td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-svg-text@0.
|
|
105
|
+
<td>SVG Text 0.4.0</td>
|
|
106
|
+
<td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-svg-text@0.4.0/dist/svg-text.js</code></td>
|
|
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.2.0</td>
|
|
111
|
+
<td>After npm publication: <code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.2.0/dist/turbowarp-bubble.js</code></td>
|
|
112
112
|
</tr>
|
|
113
113
|
</tbody></table>
|
|
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
|
|
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>
|
|
115
115
|
<p>See also:</p>
|
|
116
116
|
<ul>
|
|
117
117
|
<li><a href="https://kubohiroya.github.io/turbowarp-asset-manager/">Asset Manager guide</a></li>
|
|
@@ -157,12 +157,12 @@
|
|
|
157
157
|
<tr>
|
|
158
158
|
<td><code>Next1</code></td>
|
|
159
159
|
<td><code>Next1</code></td>
|
|
160
|
-
<td>First frame of the
|
|
160
|
+
<td>First frame of the continue indicator</td>
|
|
161
161
|
</tr>
|
|
162
162
|
<tr>
|
|
163
163
|
<td><code>Next2</code></td>
|
|
164
164
|
<td><code>Next2</code></td>
|
|
165
|
-
<td>Second frame of the
|
|
165
|
+
<td>Second frame of the continue indicator</td>
|
|
166
166
|
</tr>
|
|
167
167
|
</tbody></table>
|
|
168
168
|
<p>Use the same canvas size and center point for the base, eye, and mouth images. Keep overlay backgrounds transparent; mismatched canvases or centers make the layers drift when composed.</p>
|
|
@@ -187,7 +187,7 @@ register resource [costume:Assets:Next2] as asset [Next2]
|
|
|
187
187
|
bubble direction [up]
|
|
188
188
|
</code></pre>
|
|
189
189
|
<p>Bubble refers to this style as <code>dialogue-text</code>. Text and Bubble styles are runtime state, so normally define them again whenever the green flag is clicked.</p>
|
|
190
|
-
<p>SVG Text 0.
|
|
190
|
+
<p>SVG Text 0.4.x is a text provider: it defines named text styles, creates SVG text skins, and measures text. Bubble placement is configured by <code>set bubble placement</code>; the SVG Text provider does not own Bubble direction, tail, or outer shape.</p>
|
|
191
191
|
<h2 id="bubble-style">4. Define a Bubble style</h2>
|
|
192
192
|
<p>First associate a Bubble style name with an SVG Text style name.</p>
|
|
193
193
|
<pre><code class="language-text">define bubble style [hero-dialogue] using text style [dialogue-text]
|
|
@@ -237,7 +237,7 @@ left / left-up-left / up-left / up-up-left
|
|
|
237
237
|
<li><code>tail length</code> (default <code>18</code>) is the nominal distance from the Bubble border to the tail tip at the normal position.</li>
|
|
238
238
|
<li><code>offset x/y/scale</code> (default <code>[0, 0, 100]</code>) uses positive x to the right, positive y upward, and scale as a percentage. <code>[10, -10, 120]</code> moves the body 10 right and 10 down, then scales it to 120%.</li>
|
|
239
239
|
</ul>
|
|
240
|
-
<p>Scale applies to the body, SVG Text, portrait base, blink/lip-sync layers,
|
|
240
|
+
<p>Scale applies to the body, SVG Text, portrait base, blink/lip-sync layers, continue indicator, and internal padding as one unit, so the displayed font size scales by the same factor. When scale alone changes, the body center moves away from the actor by the increase in radius, preserving the actor-side gap. The x/y offset is added afterward. The tail tip remains fixed and the union with the body border is regenerated, so an offset can change the effective tail length.</p>
|
|
241
241
|
<p>Near a Stage edge, keeping the scaled Bubble on-screen takes priority and can reduce the requested distance. Actor-relative distance, tail, offset, and scale settings do not apply to <code>HEADER_LIKE</code>, <code>CENTER</code>, or <code>FOOTER_LIKE</code>.</p>
|
|
242
242
|
<h3>Width, automatic wrapping, and Japanese line-breaking rules</h3>
|
|
243
243
|
<p><img src="./assets/width-linebreak-guide.svg" alt="Automatic wrapping at different maxWidth values and Japanese line-breaking examples"></p>
|
|
@@ -250,22 +250,22 @@ left / left-up-left / up-left / up-up-left
|
|
|
250
250
|
<p>The diagram and TurboWarp drawable both use Bubble's shared <code>renderBubbleSvg</code> function. Shapes with triangular tails use a <a href="https://github.com/platener/jsclipper">platener/jsclipper</a> union between the body and tail. <code>THINKING</code> and <code>DREAMING</code> use circular trails and are excluded from that union. Actor-relative placement points the tail toward the actor; stage-relative placement has no tail. <code>NO_BUBBLE</code> hides the body drawable and displays only text, portrait, and other layers.</p>
|
|
251
251
|
<p>The default visual style is <code>NORMAL</code>. The body drawable is created before text and portrait drawables so it remains behind them. <code>close this bubble</code>, target/clone disposal, and runtime disposal release the body drawable and its owned SVG skin.</p>
|
|
252
252
|
<p><code>NEGATIVE</code> is not a separate style because it can be expressed with fill and border colors. Orientation and segments are also not public inputs; dimensions are calculated from width, font, character count, and the number of lines after wrapping.</p>
|
|
253
|
-
<p>Now configure the portrait and
|
|
253
|
+
<p>Now configure the portrait and continue animation layers:</p>
|
|
254
254
|
<pre><code class="language-text">set portrait base [HeroFace] for bubble style [hero-dialogue]
|
|
255
255
|
|
|
256
256
|
set blink frames [HeroEyesOpen,HeroEyesClosed]
|
|
257
257
|
every [0.4] seconds for bubble style [hero-dialogue]
|
|
258
258
|
|
|
259
|
-
set
|
|
259
|
+
set lip-sync frames [HeroMouthClosed,HeroMouthOpen]
|
|
260
260
|
every [0.1] seconds for bubble style [hero-dialogue]
|
|
261
261
|
|
|
262
|
-
set
|
|
262
|
+
set continue frames [Next1,Next2]
|
|
263
263
|
every [0.2] seconds for bubble style [hero-dialogue]
|
|
264
264
|
</code></pre>
|
|
265
265
|
<p><code>ASSETS</code> is a comma-separated list of Asset Manager names. Surrounding whitespace is removed; commas cannot be part of an asset name.</p>
|
|
266
266
|
<ul>
|
|
267
|
-
<li>Blink and
|
|
268
|
-
<li>Use two or more
|
|
267
|
+
<li>Blink and lip-sync animations accept one or more frames. A single frame remains static.</li>
|
|
268
|
+
<li>Use two or more continue frames so the loop is visible.</li>
|
|
269
269
|
<li><code>SECONDS</code> must be a finite number greater than zero.</li>
|
|
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>
|
|
@@ -279,12 +279,12 @@ say [Let's head for the sea!] with bubble style [hero-dialogue]
|
|
|
279
279
|
wait with this bubble until condition [input == "pressed"] or timeout after [10] seconds
|
|
280
280
|
close this bubble
|
|
281
281
|
</code></pre>
|
|
282
|
-
<p>Initialize <code>input</code> with Temporary Variables before registering the Async Input listeners. The listeners update that runtime variable when Space is pressed or the sprite is tapped. The Bubble wait delegates <code>input == "pressed"</code> to Runtime Expression immediately and once per VM frame. While waiting it automatically enters <code>awaiting-
|
|
282
|
+
<p>Initialize <code>input</code> with Temporary Variables before registering the Async Input listeners. The listeners update that runtime variable when Space is pressed or the sprite is tapped. The Bubble wait delegates <code>input == "pressed"</code> to Runtime Expression immediately and once per VM frame. While waiting it automatically enters <code>awaiting-continue</code>, stops lip-sync, and loops the images configured by <code>set continue frames</code>. When the condition becomes true or the timeout expires, it enters <code>idle</code> and continues to <code>close this bubble</code>. Set the timeout to <code>0</code> to wait without a timeout.</p>
|
|
283
283
|
<p>Reset <code>input</code> to an empty string before each later wait; otherwise the previous <code>pressed</code> value makes the next condition succeed immediately. Starting another Bubble, closing it, stopping its target, restarting or stopping the project, and disposing the runtime all cancel the target-owned wait and release its listener and timer.</p>
|
|
284
|
-
<p>When combining Bubble with audio or a separate text-reveal system, switch to <code>awaiting-
|
|
285
|
-
<p><img src="./assets/bubble-lifecycle.gif" alt="A say Bubble lip-syncs, shows
|
|
284
|
+
<p>When combining Bubble with audio or a separate text-reveal system, switch to <code>awaiting-continue</code> when that process completes.</p>
|
|
285
|
+
<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
286
|
<p>If animated GIF playback is unavailable, use this static animation-mode comparison:</p>
|
|
287
|
-
<p><img src="./assets/animation-mode-guide.svg" alt="Blink, lip-sync, and
|
|
287
|
+
<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
288
|
<h2 id="animation-modes">6. Bubble animation modes</h2>
|
|
289
289
|
<table>
|
|
290
290
|
<thead>
|
|
@@ -292,7 +292,7 @@ close this bubble
|
|
|
292
292
|
<th>Mode</th>
|
|
293
293
|
<th>Blink</th>
|
|
294
294
|
<th>Lip-sync</th>
|
|
295
|
-
<th>
|
|
295
|
+
<th>Continue frames</th>
|
|
296
296
|
<th>Typical use</th>
|
|
297
297
|
</tr>
|
|
298
298
|
</thead>
|
|
@@ -304,11 +304,11 @@ close this bubble
|
|
|
304
304
|
<td>Dialogue display or audio playback</td>
|
|
305
305
|
</tr>
|
|
306
306
|
<tr>
|
|
307
|
-
<td><code>awaiting-
|
|
307
|
+
<td><code>awaiting-continue</code></td>
|
|
308
308
|
<td>Runs</td>
|
|
309
309
|
<td>Stops/hidden</td>
|
|
310
310
|
<td>Loops</td>
|
|
311
|
-
<td>Await the user's request to
|
|
311
|
+
<td>Await the user's request to continue</td>
|
|
312
312
|
</tr>
|
|
313
313
|
<tr>
|
|
314
314
|
<td><code>idle</code></td>
|
|
@@ -374,12 +374,12 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
374
374
|
<td>Set blink overlays and interval</td>
|
|
375
375
|
</tr>
|
|
376
376
|
<tr>
|
|
377
|
-
<td><code>set
|
|
377
|
+
<td><code>set lip-sync frames [ASSETS] every [SECONDS] seconds for bubble style [STYLE]</code></td>
|
|
378
378
|
<td>Set lip-sync overlays and interval</td>
|
|
379
379
|
</tr>
|
|
380
380
|
<tr>
|
|
381
|
-
<td><code>set
|
|
382
|
-
<td>Set the animation shown during <code>awaiting-
|
|
381
|
+
<td><code>set continue frames [ASSETS] every [SECONDS] seconds for bubble style [STYLE]</code></td>
|
|
382
|
+
<td>Set the animation shown during <code>awaiting-continue</code></td>
|
|
383
383
|
</tr>
|
|
384
384
|
<tr>
|
|
385
385
|
<td><code>say [MESSAGE] with bubble style [STYLE]</code></td>
|
|
@@ -391,7 +391,7 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
391
391
|
</tr>
|
|
392
392
|
<tr>
|
|
393
393
|
<td><code>set this bubble animation mode [MODE]</code></td>
|
|
394
|
-
<td>Select <code>talking</code>, <code>awaiting-
|
|
394
|
+
<td>Select <code>talking</code>, <code>awaiting-continue</code>, or <code>idle</code> for this Bubble</td>
|
|
395
395
|
</tr>
|
|
396
396
|
<tr>
|
|
397
397
|
<td><code>wait with this bubble until condition [CONDITION] or timeout after [TIMEOUT] seconds</code></td>
|
|
@@ -416,11 +416,11 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
416
416
|
</thead>
|
|
417
417
|
<tbody><tr>
|
|
418
418
|
<td>Asset Manager required error</td>
|
|
419
|
-
<td>Load Asset Manager 0.7.x without sandbox</td>
|
|
419
|
+
<td>Load Asset Manager 0.7.x without sandbox before using image/media assets</td>
|
|
420
420
|
</tr>
|
|
421
421
|
<tr>
|
|
422
422
|
<td>SVG Text required error</td>
|
|
423
|
-
<td>Load SVG Text 0.
|
|
423
|
+
<td>Load SVG Text 0.4.x without sandbox</td>
|
|
424
424
|
</tr>
|
|
425
425
|
<tr>
|
|
426
426
|
<td>Async Input required error</td>
|
|
@@ -443,7 +443,7 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
443
443
|
<td>Confirm <code>MIME type of asset [NAME]</code> is <code>image/*</code></td>
|
|
444
444
|
</tr>
|
|
445
445
|
<tr>
|
|
446
|
-
<td>Only one
|
|
446
|
+
<td>Only one continue frame</td>
|
|
447
447
|
<td>Supply at least two frames, or clear the setting</td>
|
|
448
448
|
</tr>
|
|
449
449
|
<tr>
|
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
|
|
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>
|
|
@@ -102,16 +102,16 @@
|
|
|
102
102
|
</tr>
|
|
103
103
|
<tr>
|
|
104
104
|
<td align="right">5</td>
|
|
105
|
-
<td>SVG Text 0.
|
|
106
|
-
<td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-svg-text@0.
|
|
105
|
+
<td>SVG Text 0.4.0</td>
|
|
106
|
+
<td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-svg-text@0.4.0/dist/svg-text.js</code></td>
|
|
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.2.0</td>
|
|
111
|
+
<td>npm公開後は<code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.2.0/dist/turbowarp-bubble.js</code></td>
|
|
112
112
|
</tr>
|
|
113
113
|
</tbody></table>
|
|
114
|
-
<p>開発中のBubbleを試す場合は、このリポジトリの<code>dist/turbowarp-bubble.js</code>をローカルカスタム拡張機能として読み込みます。表示時にAsset Manager
|
|
114
|
+
<p>開発中のBubbleを試す場合は、このリポジトリの<code>dist/turbowarp-bubble.js</code>をローカルカスタム拡張機能として読み込みます。表示時にSVG Textが、画像・メディア機能の使用時にAsset Managerが、待機開始時にAsync InputかRuntime Expressionが見つからなければ、Bubbleは明示的なエラーを返します。</p>
|
|
115
115
|
<p>参考:</p>
|
|
116
116
|
<ul>
|
|
117
117
|
<li><a href="https://kubohiroya.github.io/turbowarp-asset-manager/ja/">Asset Manager 日本語ガイド</a></li>
|
|
@@ -187,7 +187,7 @@ register resource [costume:Assets:Next2] as asset [Next2]
|
|
|
187
187
|
bubble direction [up]
|
|
188
188
|
</code></pre>
|
|
189
189
|
<p>Bubbleは<code>dialogue-text</code>という名前を参照します。文字styleとBubble styleはruntime状態なので、通常は緑の旗が押されたときに毎回定義します。</p>
|
|
190
|
-
<p>SVG Text 0.
|
|
190
|
+
<p>SVG Text 0.4.xは文字providerです。名前付き文字styleの定義、SVG文字skinの生成、文字幅の測定を担当します。Bubbleの配置は<code>set bubble placement</code>で設定し、tailや吹き出し外形はSVG Text providerの責務ではありません。</p>
|
|
191
191
|
<h2 id="bubble-style">4. Bubble styleを定義する</h2>
|
|
192
192
|
<p>まず、Bubble style名とSVG Textのstyle名を関連付けます。</p>
|
|
193
193
|
<pre><code class="language-text">define bubble style [hero-dialogue] using text style [dialogue-text]
|
|
@@ -256,10 +256,10 @@ left / left-up-left / up-left / up-up-left
|
|
|
256
256
|
set blink frames [HeroEyesOpen,HeroEyesClosed]
|
|
257
257
|
every [0.4] seconds for bubble style [hero-dialogue]
|
|
258
258
|
|
|
259
|
-
set
|
|
259
|
+
set lip-sync frames [HeroMouthClosed,HeroMouthOpen]
|
|
260
260
|
every [0.1] seconds for bubble style [hero-dialogue]
|
|
261
261
|
|
|
262
|
-
set
|
|
262
|
+
set continue frames [Next1,Next2]
|
|
263
263
|
every [0.2] seconds for bubble style [hero-dialogue]
|
|
264
264
|
</code></pre>
|
|
265
265
|
<p><code>ASSETS</code>はカンマ区切りのAsset Managerアセット名です。名前の前後の空白は除去されます。アセット名自体にカンマは使用できません。</p>
|
|
@@ -279,12 +279,12 @@ say [海へ出発!] with bubble style [hero-dialogue]
|
|
|
279
279
|
wait with this bubble until condition [input == "pressed"] or timeout after [10] seconds
|
|
280
280
|
close this bubble
|
|
281
281
|
</code></pre>
|
|
282
|
-
<p>まずTemporary Variablesで<code>input</code>を初期化してから、Async Inputのキー入力とタップのlistenerを登録します。Bubbleの待機ブロックは、<code>input == "pressed"</code>をRuntime Expressionへ委譲し、開始直後とVMの各フレームで評価します。待機中は自動的に<code>awaiting-
|
|
282
|
+
<p>まずTemporary Variablesで<code>input</code>を初期化してから、Async Inputのキー入力とタップのlistenerを登録します。Bubbleの待機ブロックは、<code>input == "pressed"</code>をRuntime Expressionへ委譲し、開始直後とVMの各フレームで評価します。待機中は自動的に<code>awaiting-continue</code>となり、口パクを停止して<code>set continue frames</code>の画像をループします。条件成立またはtimeout後は<code>idle</code>へ移り、次の<code>close this bubble</code>へ進みます。timeoutを<code>0</code>にすると時間制限なしです。</p>
|
|
283
283
|
<p>次の待機に入る前に<code>input</code>を空文字へ戻してください。前回の<code>pressed</code>が残っていると、次の条件が直ちに成立します。別のBubble表示、close、対象targetの停止、projectの開始・停止、runtime破棄では、targetが所有する待機とlistener、timerをキャンセルして解放します。</p>
|
|
284
|
-
<p>音声再生や別の文字送り処理と組み合わせる場合は、それらが完了した時点で<code>awaiting-
|
|
285
|
-
<p><img src="../assets/bubble-lifecycle.gif" alt="sayで口パクし、awaiting-
|
|
284
|
+
<p>音声再生や別の文字送り処理と組み合わせる場合は、それらが完了した時点で<code>awaiting-continue</code>へ切り替えます。</p>
|
|
285
|
+
<p><img src="../assets/bubble-lifecycle.gif" alt="sayで口パクし、awaiting-continueでcontinue framesを動かし、入力成立後にBubbleを閉じるアニメーション"></p>
|
|
286
286
|
<p>アニメーションGIFを再生できない環境では、次の比較図で各animation modeを確認できます。</p>
|
|
287
|
-
<p><img src="../assets/animation-mode-guide.svg" alt="talking、awaiting-
|
|
287
|
+
<p><img src="../assets/animation-mode-guide.svg" alt="talking、awaiting-continue、idleの目パチ、口パク、continue framesの状態比較"></p>
|
|
288
288
|
<h2 id="animation-modes">6. Animation modeの使い分け</h2>
|
|
289
289
|
<table>
|
|
290
290
|
<thead>
|
|
@@ -292,7 +292,7 @@ close this bubble
|
|
|
292
292
|
<th>mode</th>
|
|
293
293
|
<th>目パチ</th>
|
|
294
294
|
<th>口パク</th>
|
|
295
|
-
<th>
|
|
295
|
+
<th>continue frames</th>
|
|
296
296
|
<th>主な用途</th>
|
|
297
297
|
</tr>
|
|
298
298
|
</thead>
|
|
@@ -304,7 +304,7 @@ close this bubble
|
|
|
304
304
|
<td>セリフ表示中、音声再生中</td>
|
|
305
305
|
</tr>
|
|
306
306
|
<tr>
|
|
307
|
-
<td><code>awaiting-
|
|
307
|
+
<td><code>awaiting-continue</code></td>
|
|
308
308
|
<td>実行</td>
|
|
309
309
|
<td>停止・非表示</td>
|
|
310
310
|
<td>ループ</td>
|
|
@@ -374,12 +374,12 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
374
374
|
<td>目パチ差分と間隔を設定する</td>
|
|
375
375
|
</tr>
|
|
376
376
|
<tr>
|
|
377
|
-
<td><code>set
|
|
377
|
+
<td><code>set lip-sync frames [ASSETS] every [SECONDS] seconds for bubble style [STYLE]</code></td>
|
|
378
378
|
<td>口パク差分と間隔を設定する</td>
|
|
379
379
|
</tr>
|
|
380
380
|
<tr>
|
|
381
|
-
<td><code>set
|
|
382
|
-
<td><code>awaiting-
|
|
381
|
+
<td><code>set continue frames [ASSETS] every [SECONDS] seconds for bubble style [STYLE]</code></td>
|
|
382
|
+
<td><code>awaiting-continue</code>中の「次へ」アニメーションを設定する</td>
|
|
383
383
|
</tr>
|
|
384
384
|
<tr>
|
|
385
385
|
<td><code>say [MESSAGE] with bubble style [STYLE]</code></td>
|
|
@@ -391,7 +391,7 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
391
391
|
</tr>
|
|
392
392
|
<tr>
|
|
393
393
|
<td><code>set this bubble animation mode [MODE]</code></td>
|
|
394
|
-
<td><code>talking</code>、<code>awaiting-
|
|
394
|
+
<td><code>talking</code>、<code>awaiting-continue</code>、<code>idle</code>からmodeを選ぶ</td>
|
|
395
395
|
</tr>
|
|
396
396
|
<tr>
|
|
397
397
|
<td><code>wait with this bubble until condition [CONDITION] or timeout after [TIMEOUT] seconds</code></td>
|
|
@@ -416,11 +416,11 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
416
416
|
</thead>
|
|
417
417
|
<tbody><tr>
|
|
418
418
|
<td>Asset Managerを要求するエラー</td>
|
|
419
|
-
<td
|
|
419
|
+
<td>画像・メディアアセットを使う前にAsset Manager 0.7.xを読み込む</td>
|
|
420
420
|
</tr>
|
|
421
421
|
<tr>
|
|
422
422
|
<td>SVG Textを要求するエラー</td>
|
|
423
|
-
<td>SVG Text 0.
|
|
423
|
+
<td>SVG Text 0.4.xをサンドボックスなしで読み込む</td>
|
|
424
424
|
</tr>
|
|
425
425
|
<tr>
|
|
426
426
|
<td>Async Inputを要求するエラー</td>
|
|
@@ -443,8 +443,8 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
443
443
|
<td><code>MIME type of asset [NAME]</code>で<code>image/*</code>か確認する</td>
|
|
444
444
|
</tr>
|
|
445
445
|
<tr>
|
|
446
|
-
<td>
|
|
447
|
-
<td>2枚以上にするか、空にして
|
|
446
|
+
<td>continue framesが1枚</td>
|
|
447
|
+
<td>2枚以上にするか、空にしてcontinue表示を解除する</td>
|
|
448
448
|
</tr>
|
|
449
449
|
<tr>
|
|
450
450
|
<td>frame intervalエラー</td>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubohiroya/turbowarp-bubble",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Composable say and think bubbles with portrait layers and animated
|
|
3
|
+
"version": "0.2.0",
|
|
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",
|
|
7
7
|
"license": "MPL-2.0",
|
|
@@ -43,45 +43,32 @@
|
|
|
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
|
-
},
|
|
69
46
|
"peerDependencies": {
|
|
70
|
-
"@kubohiroya/turbowarp-async-input": ">=0.3.0 <1",
|
|
71
47
|
"@kubohiroya/turbowarp-asset-manager": ">=0.7.0 <1",
|
|
48
|
+
"@kubohiroya/turbowarp-async-input": ">=0.3.0 <1",
|
|
72
49
|
"@kubohiroya/turbowarp-runtime-expression": ">=0.3.0 <1",
|
|
73
|
-
"@kubohiroya/turbowarp-svg-text": ">=0.
|
|
50
|
+
"@kubohiroya/turbowarp-svg-text": ">=0.4.0 <1"
|
|
51
|
+
},
|
|
52
|
+
"peerDependenciesMeta": {
|
|
53
|
+
"@kubohiroya/turbowarp-async-input": {
|
|
54
|
+
"optional": true
|
|
55
|
+
},
|
|
56
|
+
"@kubohiroya/turbowarp-asset-manager": {
|
|
57
|
+
"optional": true
|
|
58
|
+
},
|
|
59
|
+
"@kubohiroya/turbowarp-runtime-expression": {
|
|
60
|
+
"optional": true
|
|
61
|
+
}
|
|
74
62
|
},
|
|
75
63
|
"devDependencies": {
|
|
76
64
|
"@eslint/js": "^10.0.1",
|
|
77
|
-
"@kubohiroya/turbowarp-async-input": "0.3.0",
|
|
78
65
|
"@kubohiroya/turbowarp-asset-manager": "0.7.0",
|
|
66
|
+
"@kubohiroya/turbowarp-async-input": "0.3.0",
|
|
79
67
|
"@kubohiroya/turbowarp-runtime-expression": "0.3.0",
|
|
80
|
-
"@kubohiroya/turbowarp-svg-text": "0.
|
|
68
|
+
"@kubohiroya/turbowarp-svg-text": "0.4.0",
|
|
81
69
|
"@kubohiroya/vite-plugin-turbowarp-extension": "0.1.1",
|
|
82
70
|
"@types/node": "^26.1.2",
|
|
83
71
|
"eslint": "^10.8.0",
|
|
84
|
-
"jsclipper": "github:platener/jsclipper#56aed19845113e1939d8971c47233054659436b1",
|
|
85
72
|
"marked": "18.0.9",
|
|
86
73
|
"prettier": "^3.9.6",
|
|
87
74
|
"typescript": "^6.0.3",
|
|
@@ -96,9 +83,31 @@
|
|
|
96
83
|
"speech-bubble",
|
|
97
84
|
"portrait",
|
|
98
85
|
"lip-sync",
|
|
99
|
-
"
|
|
86
|
+
"continue-indicator"
|
|
100
87
|
],
|
|
101
88
|
"dependencies": {
|
|
102
|
-
"@cto.af/linebreak": "4.0.3"
|
|
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"
|
|
103
112
|
}
|
|
104
|
-
}
|
|
113
|
+
}
|