@kubohiroya/turbowarp-bubble 0.6.0 → 0.7.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.
@@ -15,7 +15,7 @@ The complete input-wait example uses six extensions. Add Temporary Variables fro
15
15
  | 3 | Runtime Expression 0.3.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-runtime-expression@0.3.0/dist/runtime-expression.js` |
16
16
  | 4 | Asset Manager 0.7.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-asset-manager@0.7.0/dist/asset-manager.js` |
17
17
  | 5 | SVG Text 0.4.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-svg-text@0.4.0/dist/svg-text.js` |
18
- | 6 | Bubble 0.6.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.6.0/dist/turbowarp-bubble.js` |
18
+ | 6 | Bubble 0.7.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.7.0/dist/turbowarp-bubble.js` |
19
19
 
20
20
  To try a development build, load this repository's `dist/turbowarp-bubble.js` as a local custom extension. Bubble reports an explicit error if the default SVG Text adapter 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. The lower-level Composition API can use another text capability and does not require SVG Text.
21
21
 
@@ -154,6 +154,7 @@ Now configure the portrait and continue animation layers:
154
154
 
155
155
  ```text
156
156
  set portrait base [HeroFace] for bubble style [hero-dialogue]
157
+ set portrait [top-left] offset x [-4] y [6] zoom [120] % corner radius [12] px for bubble style [hero-dialogue]
157
158
 
158
159
  set blink frames [HeroEyesOpen,HeroEyesClosed]
159
160
  every [0.4] seconds for bubble style [hero-dialogue]
@@ -171,7 +172,10 @@ set continue frames [Next1,Next2]
171
172
  - Use two or more continue frames so the loop is visible.
172
173
  - `SECONDS` must be a finite number greater than zero.
173
174
  - An empty `ASSETS` input removes that animation.
174
- - An empty portrait base removes the whole portrait.
175
+ - Portrait placement defaults to `left`. `left` and `right` center the image vertically at the corresponding edge; `top-left`, `top-right`, `bottom-left`, and `bottom-right` align it to that corner. The portrait keeps its own column, so it does not overlap the text unless a large offset moves it there.
176
+ - Portrait x is positive to the right and y is positive upward. Zoom is a positive percentage of the 96 px portrait box and is applied before the whole-Bubble scale. Corner radius is zero or greater in pixels and is capped at half of the displayed portrait width or height.
177
+ - Selecting `none`, or using an empty portrait base, removes the whole portrait including blink and lip-sync settings. Set the base again before choosing another layout.
178
+ - Rounded corners use the Bubble fill as a mask over the base, blink, and lip-sync layers. `NO_BUBBLE` has no fill to supply that mask, so its portrait remains rectangular.
175
179
 
176
180
  ## 5. Sequential reveal, audio, and layout
177
181
 
@@ -261,35 +265,36 @@ When a clone stops or is deleted, timers, SVG Text skins, and renderer drawables
261
265
 
262
266
  ## 11. Block reference
263
267
 
264
- | Block | Description |
265
- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------- |
266
- | `define bubble style [STYLE] using text style [TEXT_STYLE]` | Define or redefine a Bubble style |
267
- | `set bubble placement [PLACEMENT] for bubble style [STYLE]` | Set an actor direction/angle or a stage-relative region |
268
- | `set bubble distance [DISTANCE] for bubble style [STYLE]` | Set the distance from actor bounds to the tail tip |
269
- | `set bubble visual style [VISUAL_STYLE] for bubble style [STYLE]` | Select one of ten SVG body shapes |
270
- | `set bubble tail length [LENGTH] for bubble style [STYLE]` | Set the nominal border-to-tip tail length |
271
- | `set bubble offset x [X] y [Y] scale [SCALE] % for bubble style [STYLE]` | Set body position and whole-Bubble scale, including text |
272
- | `set portrait base [ASSET] for bubble style [STYLE]` | Set the portrait base image |
273
- | `set blink frames [ASSETS] every [SECONDS] seconds for bubble style [STYLE]` | Set blink overlays and interval |
274
- | `set lip-sync frames [ASSETS] every [SECONDS] seconds for bubble style [STYLE]` | Set lip-sync overlays and interval |
275
- | `set continue frames [ASSETS] every [SECONDS] seconds for bubble style [STYLE]` | Set the animation shown during `awaiting-continue` |
276
- | `set bubble reveal unit [UNIT] every [SECONDS] seconds layout [LAYOUT] for bubble style [STYLE]` | Configure CHARACTER/WORD/LINE/BLOCK sequential reveal |
277
- | `set bubble word delimiters [DELIMITERS] show [SHOW] for bubble style [STYLE]` | Configure WORD delimiters and visibility |
278
- | `set bubble reveal sound [ASSET] for bubble style [STYLE]` | Set the per-unit reveal sound |
279
- | `set bubble voice [ASSET] for bubble style [STYLE]` | Set full voice played when display starts |
280
- | `finish [UNIT] with condition [CONDITION] or timeout after [TIMEOUT] seconds` | Reveal remaining units and wait for condition or timeout |
281
- | `set bubble show animation [MOTION] for [SECONDS] seconds for bubble style [STYLE]` | Configure show animation |
282
- | `set bubble hide animation [MOTION] for [SECONDS] seconds for bubble style [STYLE]` | Configure hide animation |
283
- | `animate this bubble [MOTION]` | Play a whole-Bubble animation |
284
- | `shake this bubble direction [DIRECTION] count [COUNT] ease [EASE]` | Shake the complete Bubble surface |
285
- | `explode this bubble relative scale [SCALE] count [COUNT] ease [EASE]` | Apply relative scale cycles to the Bubble |
286
- | `animate bubble shape to [VISUAL_STYLE] speed [SPEED] for [SECONDS] seconds` | Transition the Bubble outline |
287
- | `say [MESSAGE] with bubble style [STYLE]` | Start or replace a `say` Bubble in `talking` mode |
288
- | `think [MESSAGE] with bubble style [STYLE]` | Start or replace a `think` Bubble in `talking` mode |
289
- | `set this bubble animation mode [MODE]` | Select `talking`, `awaiting-continue`, or `idle` for this Bubble |
290
- | `wait with this bubble until condition [CONDITION] or timeout after [TIMEOUT] seconds` | Await a Runtime Expression condition or optional timeout |
291
- | `close this bubble` | Release this target's Bubble and owned resources |
292
- | `Bubble version` | Report the Bubble implementation version |
268
+ | Block | Description |
269
+ | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
270
+ | `define bubble style [STYLE] using text style [TEXT_STYLE]` | Define or redefine a Bubble style |
271
+ | `set bubble placement [PLACEMENT] for bubble style [STYLE]` | Set an actor direction/angle or a stage-relative region |
272
+ | `set bubble distance [DISTANCE] for bubble style [STYLE]` | Set the distance from actor bounds to the tail tip |
273
+ | `set bubble visual style [VISUAL_STYLE] for bubble style [STYLE]` | Select one of ten SVG body shapes |
274
+ | `set bubble tail length [LENGTH] for bubble style [STYLE]` | Set the nominal border-to-tip tail length |
275
+ | `set bubble offset x [X] y [Y] scale [SCALE] % for bubble style [STYLE]` | Set body position and whole-Bubble scale, including text |
276
+ | `set portrait base [ASSET] for bubble style [STYLE]` | Set the portrait base image |
277
+ | `set portrait [PLACEMENT] offset x [X] y [Y] zoom [ZOOM] % corner radius [RADIUS] px for bubble style [STYLE]` | Set portrait visibility, edge/corner placement, transform, and rounding |
278
+ | `set blink frames [ASSETS] every [SECONDS] seconds for bubble style [STYLE]` | Set blink overlays and interval |
279
+ | `set lip-sync frames [ASSETS] every [SECONDS] seconds for bubble style [STYLE]` | Set lip-sync overlays and interval |
280
+ | `set continue frames [ASSETS] every [SECONDS] seconds for bubble style [STYLE]` | Set the animation shown during `awaiting-continue` |
281
+ | `set bubble reveal unit [UNIT] every [SECONDS] seconds layout [LAYOUT] for bubble style [STYLE]` | Configure CHARACTER/WORD/LINE/BLOCK sequential reveal |
282
+ | `set bubble word delimiters [DELIMITERS] show [SHOW] for bubble style [STYLE]` | Configure WORD delimiters and visibility |
283
+ | `set bubble reveal sound [ASSET] for bubble style [STYLE]` | Set the per-unit reveal sound |
284
+ | `set bubble voice [ASSET] for bubble style [STYLE]` | Set full voice played when display starts |
285
+ | `finish [UNIT] with condition [CONDITION] or timeout after [TIMEOUT] seconds` | Reveal remaining units and wait for condition or timeout |
286
+ | `set bubble show animation [MOTION] for [SECONDS] seconds for bubble style [STYLE]` | Configure show animation |
287
+ | `set bubble hide animation [MOTION] for [SECONDS] seconds for bubble style [STYLE]` | Configure hide animation |
288
+ | `animate this bubble [MOTION]` | Play a whole-Bubble animation |
289
+ | `shake this bubble direction [DIRECTION] count [COUNT] ease [EASE]` | Shake the complete Bubble surface |
290
+ | `explode this bubble relative scale [SCALE] count [COUNT] ease [EASE]` | Apply relative scale cycles to the Bubble |
291
+ | `animate bubble shape to [VISUAL_STYLE] speed [SPEED] for [SECONDS] seconds` | Transition the Bubble outline |
292
+ | `say [MESSAGE] with bubble style [STYLE]` | Start or replace a `say` Bubble in `talking` mode |
293
+ | `think [MESSAGE] with bubble style [STYLE]` | Start or replace a `think` Bubble in `talking` mode |
294
+ | `set this bubble animation mode [MODE]` | Select `talking`, `awaiting-continue`, or `idle` for this Bubble |
295
+ | `wait with this bubble until condition [CONDITION] or timeout after [TIMEOUT] seconds` | Await a Runtime Expression condition or optional timeout |
296
+ | `close this bubble` | Release this target's Bubble and owned resources |
297
+ | `Bubble version` | Report the Bubble implementation version |
293
298
 
294
299
  ## 12. Troubleshooting
295
300
 
package/docs/index.html CHANGED
@@ -107,8 +107,8 @@
107
107
  </tr>
108
108
  <tr>
109
109
  <td align="right">6</td>
110
- <td>Bubble 0.6.0</td>
111
- <td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.6.0/dist/turbowarp-bubble.js</code></td>
110
+ <td>Bubble 0.7.0</td>
111
+ <td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.7.0/dist/turbowarp-bubble.js</code></td>
112
112
  </tr>
113
113
  </tbody></table>
114
114
  <p>To try a development build, load this repository&#39;s <code>dist/turbowarp-bubble.js</code> as a local custom extension. Bubble reports an explicit error if the default SVG Text adapter 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. The lower-level Composition API can use another text capability and does not require SVG Text.</p>
@@ -252,6 +252,7 @@ left / left-up-left / up-left / up-up-left
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
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
+ set portrait [top-left] offset x [-4] y [6] zoom [120] % corner radius [12] px for bubble style [hero-dialogue]
255
256
 
256
257
  set blink frames [HeroEyesOpen,HeroEyesClosed]
257
258
  every [0.4] seconds for bubble style [hero-dialogue]
@@ -268,7 +269,10 @@ set continue frames [Next1,Next2]
268
269
  <li>Use two or more continue frames so the loop is visible.</li>
269
270
  <li><code>SECONDS</code> must be a finite number greater than zero.</li>
270
271
  <li>An empty <code>ASSETS</code> input removes that animation.</li>
271
- <li>An empty portrait base removes the whole portrait.</li>
272
+ <li>Portrait placement defaults to <code>left</code>. <code>left</code> and <code>right</code> center the image vertically at the corresponding edge; <code>top-left</code>, <code>top-right</code>, <code>bottom-left</code>, and <code>bottom-right</code> align it to that corner. The portrait keeps its own column, so it does not overlap the text unless a large offset moves it there.</li>
273
+ <li>Portrait x is positive to the right and y is positive upward. Zoom is a positive percentage of the 96 px portrait box and is applied before the whole-Bubble scale. Corner radius is zero or greater in pixels and is capped at half of the displayed portrait width or height.</li>
274
+ <li>Selecting <code>none</code>, or using an empty portrait base, removes the whole portrait including blink and lip-sync settings. Set the base again before choosing another layout.</li>
275
+ <li>Rounded corners use the Bubble fill as a mask over the base, blink, and lip-sync layers. <code>NO_BUBBLE</code> has no fill to supply that mask, so its portrait remains rectangular.</li>
272
276
  </ul>
273
277
  <h2 id="lifecycle">5. Sequential reveal, audio, and layout</h2>
274
278
  <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>
@@ -390,6 +394,10 @@ think [MESSAGE] with bubble style [STYLE]
390
394
  <td>Set the portrait base image</td>
391
395
  </tr>
392
396
  <tr>
397
+ <td><code>set portrait [PLACEMENT] offset x [X] y [Y] zoom [ZOOM] % corner radius [RADIUS] px for bubble style [STYLE]</code></td>
398
+ <td>Set portrait visibility, edge/corner placement, transform, and rounding</td>
399
+ </tr>
400
+ <tr>
393
401
  <td><code>set blink frames [ASSETS] every [SECONDS] seconds for bubble style [STYLE]</code></td>
394
402
  <td>Set blink overlays and interval</td>
395
403
  </tr>
@@ -107,8 +107,8 @@
107
107
  </tr>
108
108
  <tr>
109
109
  <td align="right">6</td>
110
- <td>Bubble 0.6.0</td>
111
- <td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.6.0/dist/turbowarp-bubble.js</code></td>
110
+ <td>Bubble 0.7.0</td>
111
+ <td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.7.0/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 adapterが、画像・メディア機能の使用時にAsset Managerが、待機開始時にAsync InputかRuntime Expressionが見つからなければ、Bubbleは明示的なエラーを返します。低レベルComposition APIでは別のtext capabilityを注入でき、その場合SVG Textは不要です。</p>
@@ -252,6 +252,7 @@ left / left-up-left / up-left / up-up-left
252
252
  <p><code>NEGATIVE</code>はfill colorとborder colorで表現できるため独立styleにはしません。orientationとsegmentsも公開入力にせず、幅、フォント、文字数、禁則処理後の行数から外形寸法を自動計算する方針です。</p>
253
253
  <p>続けて、表情レイヤーと入力待ちアイコンを設定します。</p>
254
254
  <pre><code class="language-text">set portrait base [HeroFace] for bubble style [hero-dialogue]
255
+ set portrait [top-left] offset x [-4] y [6] zoom [120] % corner radius [12] px for bubble style [hero-dialogue]
255
256
 
256
257
  set blink frames [HeroEyesOpen,HeroEyesClosed]
257
258
  every [0.4] seconds for bubble style [hero-dialogue]
@@ -268,7 +269,10 @@ set continue frames [Next1,Next2]
268
269
  <li>「次へ」はループが分かるよう2枚以上必要です。</li>
269
270
  <li><code>SECONDS</code>は0より大きい秒数です。</li>
270
271
  <li><code>ASSETS</code>を空にすると、そのアニメーション設定を解除します。</li>
271
- <li>表情ベースを空にするとportrait全体を解除します。</li>
272
+ <li>portrait配置の既定値は<code>left</code>です。<code>left</code>/<code>right</code>は対応する端の上下中央、<code>top-left</code>/<code>top-right</code>/<code>bottom-left</code>/<code>bottom-right</code>は対応する隅へ揃えます。portrait用の列は維持されるため、大きなoffsetで移動しない限り文字と重なりません。</li>
273
+ <li>portraitのxは右正、yは上正です。zoomは96pxのportrait枠に対する0より大きい百分率で、Bubble全体のscaleより先に適用します。角丸半径は0以上のpixel値で、表示幅または表示高の半分を上限にします。</li>
274
+ <li><code>none</code>を選ぶか表情ベースを空にすると、目パチ・口パク設定を含むportrait全体を解除します。別の配置へ戻すときは、先に表情ベースを再設定します。</li>
275
+ <li>角丸はBubbleのfill色でベース・目パチ・口パクの各レイヤーをmaskします。<code>NO_BUBBLE</code>にはmaskに使うfillがないため、portraitは矩形表示のままです。</li>
272
276
  </ul>
273
277
  <h2 id="lifecycle">5. 逐次表示、音声、表示サイズ</h2>
274
278
  <p>Bubbleはセリフ全体を一度に描画するだけでなく、<code>CHARACTER</code>、<code>WORD</code>、<code>LINE</code>、<code>BLOCK</code>の単位で順次表示できます。<code>WORD</code>は形態素解析を行わず、空白または指定した区切り文字集合で分割します。区切り文字を表示するかどうかも選べます。</p>
@@ -390,6 +394,10 @@ think [MESSAGE] with bubble style [STYLE]
390
394
  <td>portraitのベース画像を設定する</td>
391
395
  </tr>
392
396
  <tr>
397
+ <td><code>set portrait [PLACEMENT] offset x [X] y [Y] zoom [ZOOM] % corner radius [RADIUS] px for bubble style [STYLE]</code></td>
398
+ <td>portraitの有無、端/隅の配置、変形、角丸を設定する</td>
399
+ </tr>
400
+ <tr>
393
401
  <td><code>set blink frames [ASSETS] every [SECONDS] seconds for bubble style [STYLE]</code></td>
394
402
  <td>目パチ差分と間隔を設定する</td>
395
403
  </tr>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubohiroya/turbowarp-bubble",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
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",