@kubohiroya/turbowarp-bubble 0.8.0 → 0.9.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 +292 -242
- package/README_ja.md +693 -0
- package/dist/composition.js +835 -668
- package/dist/extension-manifest.json +34 -0
- package/dist/turbowarp-adapter.js +1911 -1337
- package/dist/turbowarp-bubble.js +1037 -110
- package/dist/types/bubble-svg.d.ts +4 -0
- package/dist/types/composition.d.ts +5 -0
- package/dist/types/scratch-default.d.ts +67 -0
- package/dist/types/svg-overlay-surface.d.ts +2 -2
- package/dist/types/turbowarp-adapter.d.ts +4 -1
- package/dist/types/turbowarp-svg-text-adapter.d.ts +5 -0
- package/docs/assets/block-quick-start.svg +8 -8
- package/docs/assets/bubble-lifecycle.gif +0 -0
- package/docs/assets/bubble-style-gallery.svg +2 -20
- package/docs/assets/turbowarp-say-think-block-comparison.png +0 -0
- package/docs/assets/turbowarp-say-think-stage-comparison.png +0 -0
- package/docs/block-manual.ja.md +70 -45
- package/docs/block-manual.md +55 -30
- package/docs/index.html +38 -22
- package/docs/ja/index.html +38 -22
- package/docs/release-notes-0.8.0.md +63 -12
- package/docs/release-notes-0.9.0.md +47 -0
- package/package.json +5 -3
package/docs/block-manual.md
CHANGED
|
@@ -8,15 +8,15 @@ This manual explains how to use `turbowarp-bubble` as an unsandboxed TurboWarp c
|
|
|
8
8
|
|
|
9
9
|
## 1. Load the required extensions
|
|
10
10
|
|
|
11
|
-
The complete input-wait example uses five extensions. Add Temporary Variables from TurboWarp's extension library, then load the custom extensions needed by the selected features with **Run without sandbox** enabled. Bubble bundles the host-neutral SVG Text 0.8.
|
|
11
|
+
The complete input-wait example uses five extensions. Add Temporary Variables from TurboWarp's extension library, then load the custom extensions needed by the selected features with **Run without sandbox** enabled. Bubble bundles the host-neutral SVG Text 0.8.1 layout provider and creates no text skin on its default SVG overlay. 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.
|
|
12
12
|
|
|
13
13
|
| Order | Extension | URL |
|
|
14
14
|
| ----: | ------------------------ | -------------------------------------------------------------------------------------------------------- |
|
|
15
15
|
| 1 | Temporary Variables | Add from the TurboWarp extension library |
|
|
16
16
|
| 2 | Async Input 0.4.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-async-input@0.4.0/dist/async-input.js` |
|
|
17
17
|
| 3 | Runtime Expression 0.4.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-runtime-expression@0.4.0/dist/runtime-expression.js` |
|
|
18
|
-
| 4 | Asset Manager 0.
|
|
19
|
-
| 5 | Bubble 0.
|
|
18
|
+
| 4 | Asset Manager 0.12.1 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-asset-manager@0.12.1/dist/asset-manager.js` |
|
|
19
|
+
| 5 | Bubble 0.9.0 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.9.0/dist/turbowarp-bubble.js` |
|
|
20
20
|
|
|
21
21
|
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 renderer lacks the default SVG overlay APIs, 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 inject another text capability.
|
|
22
22
|
|
|
@@ -59,17 +59,36 @@ For a remote image, pass its HTTPS URL as `RESOURCE_ID`. Bubble accepts only ass
|
|
|
59
59
|
|
|
60
60
|
## 3. Select a text layout style
|
|
61
61
|
|
|
62
|
-
Standalone Bubble bundles the SVG Text 0.8.
|
|
62
|
+
Standalone Bubble bundles the SVG Text 0.8.1 layout composition and installs two Bubble styles: `say` owns the speech body and speech tail, while `think` owns the thought body and round trail. A style's body and tail/trail shapes are one visual choice, not separately selected properties. The short `say [MESSAGE]` and `think [MESSAGE]` blocks select the matching style automatically, so the basic path needs neither a style definition nor a style input. Both styles use the reserved text profile `default`, a content-sized body, 14px Helvetica text, right-first placement with a fit-dependent left flip, 330-character block-input limit, and empty-message close behavior. Their 4px SVG stroke is painted before the white fill, hiding the inner half so the visible outline matches TurboWarp's standard bubble. Any other text style name or explicit style-setting block selects the custom profile. Custom text styles are initialized on first use with transparent-background SVG Text defaults. If a project separately loads the stock SVG Text 0.8.1 extension before Bubble, Bubble uses its public `getLayoutCapability()` instead and preserves the named styles defined by SVG Text blocks. An older loaded SVG Text extension without that handoff produces an explicit compatibility error rather than silently replacing the style; select the documented scratch-render fallback only when needed.
|
|
63
63
|
|
|
64
64
|
```text
|
|
65
65
|
define bubble style [hero-dialogue] using text style [default]
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
Application hosts that need custom fonts, colors, or alignment can define styles on `createSvgTextLayoutComposition()` and inject them through `createSvgTextOverlayTextCapability()`. The
|
|
68
|
+
Application hosts that need custom fonts, colors, or alignment can define styles on `createSvgTextLayoutComposition()` and inject them through `createSvgTextOverlayTextCapability()`. The custom profile uses the same `layoutText()` API and does not create an SVG text skin on the default overlay backend. Bubble owns placement, tail, and outer shape.
|
|
69
69
|
|
|
70
70
|
## 4. Define a Bubble style
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
For a basic Bubble, use the short blocks directly. They select the built-in Bubble styles `say` and `think`, respectively:
|
|
73
|
+
|
|
74
|
+
```text
|
|
75
|
+
say [Hello!]
|
|
76
|
+
think [Hmm…]
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### TurboWarp standard comparison
|
|
80
|
+
|
|
81
|
+
These screenshots come from one TurboWarp Editor project using the English UI, a `Cat` sprite at `x=-80`, `y=0`, size `80%`, a white Stage, and matching `Hello!` / `Hmm...` inputs. The standard Looks blocks are on the left. Bubble's short basic blocks are on the right and use their matching built-in `say` / `think` styles; no definition or setter block is used.
|
|
82
|
+
|
|
83
|
+

|
|
84
|
+
|
|
85
|
+
The Stage panels show the right-side placement, content-sized body, and the speech tail or thought trail pointing back toward the Actor in each implementation. Bubble renders an independent SVG surface, and every panel is a crop of the actual TurboWarp Stage.
|
|
86
|
+
|
|
87
|
+

|
|
88
|
+
|
|
89
|
+
The block image shows the no-setup path and the unified custom-style block. The short blocks select the matching built-in styles automatically. The callout shows each inseparable body-plus-tail/trail pair, maps both styles to the reserved text profile `default`, and lists the shared typography, geometry, colors, border paint order, and placement. Use `show [MESSAGE] with bubble style [STYLE]` for named custom styles. The former styled say/think opcodes remain hidden compatibility definitions for saved projects.
|
|
90
|
+
|
|
91
|
+
The following setters intentionally switch the style to the custom profile:
|
|
73
92
|
|
|
74
93
|
```text
|
|
75
94
|
define bubble style [hero-dialogue] using text style [default]
|
|
@@ -88,7 +107,7 @@ Each of the 16 actor-relative directions is shown as a complete mini-scene conta
|
|
|
88
107
|
|
|
89
108
|
The three stage-relative diagrams show the Stage frame, safe area, Bubble dimensions, horizontal centerline, and relevant reference edge or center. The diagrams and the TurboWarp drawable are generated by the same shared `renderBubbleSvg` implementation.
|
|
90
109
|
|
|
91
|
-
Actor-relative placement specifies the direction from the actor's center toward the center of the entire Bubble. The menu provides these 16 canonical directions:
|
|
110
|
+
Actor-relative placement applies to the custom profile and specifies the direction from the actor's center toward the center of the entire Bubble. The untouched basic profile uses Scratch's right-first placement and automatic left flip. The menu provides these 16 canonical directions:
|
|
92
111
|
|
|
93
112
|
```text
|
|
94
113
|
up / up-up-right / up-right / right-up-right
|
|
@@ -179,7 +198,7 @@ set bubble reveal unit [CHARACTER] every [0.05] seconds layout [RESERVED] for bu
|
|
|
179
198
|
set bubble word delimiters [ /] show [false] for bubble style [hero-dialogue]
|
|
180
199
|
set bubble reveal sound [Typewriter] for bubble style [hero-dialogue]
|
|
181
200
|
set bubble voice [HeroVoice] for bubble style [hero-dialogue]
|
|
182
|
-
|
|
201
|
+
show [Let's head for the sea!] with bubble style [hero-dialogue]
|
|
183
202
|
finish [CHARACTER] with condition [input == "pressed"] or timeout after [10] seconds
|
|
184
203
|
```
|
|
185
204
|
|
|
@@ -193,7 +212,7 @@ finish [CHARACTER] with condition [input == "pressed"] or timeout after [10] sec
|
|
|
193
212
|
set runtime variable [input] to []
|
|
194
213
|
listen for key [Space] set runtime var [input] to [pressed]
|
|
195
214
|
listen for touch on this sprite set runtime var [input] to [pressed]
|
|
196
|
-
|
|
215
|
+
show [Let's head for the sea!] with bubble style [hero-dialogue]
|
|
197
216
|
wait with this bubble until condition [input == "pressed"] or timeout after [10] seconds
|
|
198
217
|
close this bubble
|
|
199
218
|
```
|
|
@@ -235,14 +254,15 @@ animate bubble shape to [WAVY] speed [1] for [0.5] seconds
|
|
|
235
254
|
|
|
236
255
|
The TurboWarp adapter advances these motions on scheduler frames and applies `ease` to each frame. `shake` applies direction and count to the complete Bubble surface, `explode` expands and returns the relative scale of text and portrait together, and `animate bubble shape` cross-fades the current outline into styles such as `THINKING`, `DREAMING`, `YELLING`, `WAVY`, or `WHISPERING` during the requested speed and duration.
|
|
237
256
|
|
|
238
|
-
|
|
257
|
+
Use `close this bubble` to remove the current Bubble. It runs the configured hide animation and then releases the Bubble's timers and rendering resources. `set bubble hide animation ...` only configures that exit effect; it does not remove a Bubble by itself. For the built-in basic profile, passing an empty value to `say` or `think` also closes the Bubble, matching TurboWarp's standard behavior. Bubble does not expose a separate `hide` block because closing destroys the display rather than preserving a hidden instance for later reuse.
|
|
258
|
+
|
|
259
|
+
## 9. Showing a named Bubble style
|
|
239
260
|
|
|
240
261
|
```text
|
|
241
|
-
|
|
242
|
-
think [MESSAGE] with bubble style [STYLE]
|
|
262
|
+
show [MESSAGE] with bubble style [STYLE]
|
|
243
263
|
```
|
|
244
264
|
|
|
245
|
-
|
|
265
|
+
The selected Bubble style determines the body and tail/trail together, along with its text profile, portrait layers, placement, and animation settings. `set bubble visual style` selects an inseparable pair such as `NORMAL` (speech body + speech tail) or `THINKING` (thought body + round trail); there is no independent tail-shape setting. The standalone extension derives its internal rendering kind from that style instead of asking the display block for a second, potentially conflicting choice.
|
|
246
266
|
|
|
247
267
|
Running a new `say` or `think` 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.
|
|
248
268
|
|
|
@@ -263,7 +283,7 @@ When a clone stops or is deleted, its timers, overlay DOM, and image leases are
|
|
|
263
283
|
| `define bubble style [STYLE] using text style [TEXT_STYLE]` | Define or redefine a Bubble style |
|
|
264
284
|
| `set bubble placement [PLACEMENT] for bubble style [STYLE]` | Set an actor direction/angle or a stage-relative region |
|
|
265
285
|
| `set bubble distance [DISTANCE] for bubble style [STYLE]` | Set the distance from actor bounds to the tail tip |
|
|
266
|
-
| `set bubble visual style [VISUAL_STYLE] for bubble style [STYLE]` | Select one of ten SVG body
|
|
286
|
+
| `set bubble visual style [VISUAL_STYLE] for bubble style [STYLE]` | Select one of ten inseparable SVG body + tail/trail pairs |
|
|
267
287
|
| `set bubble tail length [LENGTH] for bubble style [STYLE]` | Set the nominal border-to-tip tail length |
|
|
268
288
|
| `set bubble offset x [X] y [Y] scale [SCALE] % for bubble style [STYLE]` | Set body position and whole-Bubble scale, including text |
|
|
269
289
|
| `set portrait base [ASSET] for bubble style [STYLE]` | Set the portrait base image |
|
|
@@ -282,29 +302,32 @@ When a clone stops or is deleted, its timers, overlay DOM, and image leases are
|
|
|
282
302
|
| `shake this bubble direction [DIRECTION] count [COUNT] ease [EASE]` | Shake the complete Bubble surface |
|
|
283
303
|
| `explode this bubble relative scale [SCALE] count [COUNT] ease [EASE]` | Apply relative scale cycles to the Bubble |
|
|
284
304
|
| `animate bubble shape to [VISUAL_STYLE] speed [SPEED] for [SECONDS] seconds` | Transition the Bubble outline |
|
|
285
|
-
| `say [MESSAGE]
|
|
286
|
-
| `think [MESSAGE]
|
|
305
|
+
| `say [MESSAGE]` | Show built-in style `say`: speech body and speech tail |
|
|
306
|
+
| `think [MESSAGE]` | Show built-in style `think`: thought body and round trail |
|
|
307
|
+
| `show [MESSAGE] with bubble style [STYLE]` | Show the complete body and tail/trail pair owned by a style |
|
|
287
308
|
| `set this bubble animation mode [MODE]` | Select `talking`, `awaiting-continue`, or `idle` for this Bubble |
|
|
288
309
|
| `wait with this bubble until condition [CONDITION] or timeout after [TIMEOUT] seconds` | Await a Runtime Expression condition or optional timeout |
|
|
289
310
|
| `close this bubble` | Release this target's Bubble and owned resources |
|
|
290
311
|
| `Bubble version` | Report the Bubble implementation version |
|
|
291
312
|
|
|
313
|
+
Saved projects using the former `say/think [MESSAGE] with bubble style [STYLE]` opcodes continue to run, but those two compatibility blocks are hidden from the palette. New scripts use the unified `show` block so the selected style alone determines the complete body and tail/trail shape.
|
|
314
|
+
|
|
292
315
|
## 12. Troubleshooting
|
|
293
316
|
|
|
294
|
-
| Symptom | Cause and solution
|
|
295
|
-
| ------------------------------------ |
|
|
296
|
-
| Asset Manager required error | Load Asset Manager 0.
|
|
297
|
-
| SVG overlay backend error | Use a host with `renderer.addOverlay()` or explicitly select `scratch-render`
|
|
298
|
-
| Async Input required error | Load Async Input 0.3.x without sandbox before using the Bubble wait
|
|
299
|
-
| Runtime Expression required error | Load Runtime Expression 0.3.x without sandbox before using the Bubble wait
|
|
300
|
-
| `bubble style is not defined` |
|
|
301
|
-
| Image asset is not registered | Wait for `register resource ... as asset ...` before showing the Bubble
|
|
302
|
-
| Asset is not an image | Confirm `MIME type of asset [NAME]` is `image/*`
|
|
303
|
-
| Only one continue frame | Supply at least two frames, or clear the setting
|
|
304
|
-
| Frame interval error | Use a finite `SECONDS` value greater than zero
|
|
305
|
-
| Actor-relative Bubble from the Stage | Use `HEADER_LIKE`, `CENTER`, or `FOOTER_LIKE`
|
|
306
|
-
| Invalid placement | Use a 16-way direction, alias, 0–360 degree angle, or stage-relative value
|
|
307
|
-
| Eyes or mouth are misaligned | Match canvas size, center, and transparent area across all portrait layers
|
|
317
|
+
| Symptom | Cause and solution |
|
|
318
|
+
| ------------------------------------ | ------------------------------------------------------------------------------- |
|
|
319
|
+
| Asset Manager required error | Load Asset Manager 0.12.x without sandbox before using image/media assets |
|
|
320
|
+
| SVG overlay backend error | Use a host with `renderer.addOverlay()` or explicitly select `scratch-render` |
|
|
321
|
+
| Async Input required error | Load Async Input 0.3.x without sandbox before using the Bubble wait |
|
|
322
|
+
| Runtime Expression required error | Load Runtime Expression 0.3.x without sandbox before using the Bubble wait |
|
|
323
|
+
| `bubble style is not defined` | Use the built-in short say/think blocks, or define the named custom style first |
|
|
324
|
+
| Image asset is not registered | Wait for `register resource ... as asset ...` before showing the Bubble |
|
|
325
|
+
| Asset is not an image | Confirm `MIME type of asset [NAME]` is `image/*` |
|
|
326
|
+
| Only one continue frame | Supply at least two frames, or clear the setting |
|
|
327
|
+
| Frame interval error | Use a finite `SECONDS` value greater than zero |
|
|
328
|
+
| Actor-relative Bubble from the Stage | Use `HEADER_LIKE`, `CENTER`, or `FOOTER_LIKE` |
|
|
329
|
+
| Invalid placement | Use a 16-way direction, alias, 0–360 degree angle, or stage-relative value |
|
|
330
|
+
| Eyes or mouth are misaligned | Match canvas size, center, and transparent area across all portrait layers |
|
|
308
331
|
|
|
309
332
|
## 13. Automatic cleanup
|
|
310
333
|
|
|
@@ -323,6 +346,8 @@ Assets registered with Asset Manager are not owned by Bubble. To remove an unuse
|
|
|
323
346
|
|
|
324
347
|
The diagrams and GIF are generated from scripts in this repository. GIF generation requires the ImageMagick `magick` command.
|
|
325
348
|
|
|
349
|
+
The two `turbowarp-say-think-*-comparison.png` files are real TurboWarp Editor screenshots rather than generated renderer previews. They use the capture conditions documented in section 4 and are not overwritten by `docs:render`.
|
|
350
|
+
|
|
326
351
|
```sh
|
|
327
352
|
pnpm docs:render
|
|
328
353
|
pnpm docs:check
|
package/docs/index.html
CHANGED
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
</blockquote>
|
|
75
75
|
<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>
|
|
76
76
|
<h2 id="requirements">1. Load the required extensions</h2>
|
|
77
|
-
<p>The complete input-wait example uses five 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. Bubble bundles the host-neutral SVG Text 0.8.
|
|
77
|
+
<p>The complete input-wait example uses five 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. Bubble bundles the host-neutral SVG Text 0.8.1 layout provider and creates no text skin on its default SVG overlay. 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>
|
|
78
78
|
<table>
|
|
79
79
|
<thead>
|
|
80
80
|
<tr>
|
|
@@ -100,13 +100,13 @@
|
|
|
100
100
|
</tr>
|
|
101
101
|
<tr>
|
|
102
102
|
<td align="right">4</td>
|
|
103
|
-
<td>Asset Manager 0.
|
|
104
|
-
<td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-asset-manager@0.
|
|
103
|
+
<td>Asset Manager 0.12.1</td>
|
|
104
|
+
<td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-asset-manager@0.12.1/dist/asset-manager.js</code></td>
|
|
105
105
|
</tr>
|
|
106
106
|
<tr>
|
|
107
107
|
<td align="right">5</td>
|
|
108
|
-
<td>Bubble 0.
|
|
109
|
-
<td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.
|
|
108
|
+
<td>Bubble 0.9.0</td>
|
|
109
|
+
<td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.9.0/dist/turbowarp-bubble.js</code></td>
|
|
110
110
|
</tr>
|
|
111
111
|
</tbody></table>
|
|
112
112
|
<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 the renderer lacks the default SVG overlay APIs, 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 inject another text capability.</p>
|
|
@@ -175,12 +175,22 @@ register resource [costume:Assets:Next2] as asset [Next2]
|
|
|
175
175
|
</code></pre>
|
|
176
176
|
<p>For a remote image, pass its HTTPS URL as <code>RESOURCE_ID</code>. Bubble accepts only assets already registered with Asset Manager whose MIME type is <code>image/*</code>.</p>
|
|
177
177
|
<h2 id="text-style">3. Select a text layout style</h2>
|
|
178
|
-
<p>Standalone Bubble bundles the SVG Text 0.8.
|
|
178
|
+
<p>Standalone Bubble bundles the SVG Text 0.8.1 layout composition and installs two Bubble styles: <code>say</code> owns the speech body and speech tail, while <code>think</code> owns the thought body and round trail. A style's body and tail/trail shapes are one visual choice, not separately selected properties. The short <code>say [MESSAGE]</code> and <code>think [MESSAGE]</code> blocks select the matching style automatically, so the basic path needs neither a style definition nor a style input. Both styles use the reserved text profile <code>default</code>, a content-sized body, 14px Helvetica text, right-first placement with a fit-dependent left flip, 330-character block-input limit, and empty-message close behavior. Their 4px SVG stroke is painted before the white fill, hiding the inner half so the visible outline matches TurboWarp's standard bubble. Any other text style name or explicit style-setting block selects the custom profile. Custom text styles are initialized on first use with transparent-background SVG Text defaults. If a project separately loads the stock SVG Text 0.8.1 extension before Bubble, Bubble uses its public <code>getLayoutCapability()</code> instead and preserves the named styles defined by SVG Text blocks. An older loaded SVG Text extension without that handoff produces an explicit compatibility error rather than silently replacing the style; select the documented scratch-render fallback only when needed.</p>
|
|
179
179
|
<pre><code class="language-text">define bubble style [hero-dialogue] using text style [default]
|
|
180
180
|
</code></pre>
|
|
181
|
-
<p>Application hosts that need custom fonts, colors, or alignment can define styles on <code>createSvgTextLayoutComposition()</code> and inject them through <code>createSvgTextOverlayTextCapability()</code>. The
|
|
181
|
+
<p>Application hosts that need custom fonts, colors, or alignment can define styles on <code>createSvgTextLayoutComposition()</code> and inject them through <code>createSvgTextOverlayTextCapability()</code>. The custom profile uses the same <code>layoutText()</code> API and does not create an SVG text skin on the default overlay backend. Bubble owns placement, tail, and outer shape.</p>
|
|
182
182
|
<h2 id="bubble-style">4. Define a Bubble style</h2>
|
|
183
|
-
<p>
|
|
183
|
+
<p>For a basic Bubble, use the short blocks directly. They select the built-in Bubble styles <code>say</code> and <code>think</code>, respectively:</p>
|
|
184
|
+
<pre><code class="language-text">say [Hello!]
|
|
185
|
+
think [Hmm…]
|
|
186
|
+
</code></pre>
|
|
187
|
+
<h3>TurboWarp standard comparison</h3>
|
|
188
|
+
<p>These screenshots come from one TurboWarp Editor project using the English UI, a <code>Cat</code> sprite at <code>x=-80</code>, <code>y=0</code>, size <code>80%</code>, a white Stage, and matching <code>Hello!</code> / <code>Hmm...</code> inputs. The standard Looks blocks are on the left. Bubble's short basic blocks are on the right and use their matching built-in <code>say</code> / <code>think</code> styles; no definition or setter block is used.</p>
|
|
189
|
+
<p><img src="./assets/turbowarp-say-think-stage-comparison.png" alt="TurboWarp standard say and think bubbles compared on the Stage with Bubble's basic profile"></p>
|
|
190
|
+
<p>The Stage panels show the right-side placement, content-sized body, and the speech tail or thought trail pointing back toward the Actor in each implementation. Bubble renders an independent SVG surface, and every panel is a crop of the actual TurboWarp Stage.</p>
|
|
191
|
+
<p><img src="./assets/turbowarp-say-think-block-comparison.png" alt="TurboWarp standard say and think blocks compared with Bubble's no-setup basic say and think blocks and built-in default profile values"></p>
|
|
192
|
+
<p>The block image shows the no-setup path and the unified custom-style block. The short blocks select the matching built-in styles automatically. The callout shows each inseparable body-plus-tail/trail pair, maps both styles to the reserved text profile <code>default</code>, and lists the shared typography, geometry, colors, border paint order, and placement. Use <code>show [MESSAGE] with bubble style [STYLE]</code> for named custom styles. The former styled say/think opcodes remain hidden compatibility definitions for saved projects.</p>
|
|
193
|
+
<p>The following setters intentionally switch the style to the custom profile:</p>
|
|
184
194
|
<pre><code class="language-text">define bubble style [hero-dialogue] using text style [default]
|
|
185
195
|
set bubble placement [up-right] for bubble style [hero-dialogue]
|
|
186
196
|
set bubble distance [12] for bubble style [hero-dialogue]
|
|
@@ -192,7 +202,7 @@ set bubble offset x [0] y [0] scale [100] % for bubble style [hero-dialogue]
|
|
|
192
202
|
<p><img src="./assets/placement-guide.svg" alt="Actor-relative 16-way and angle placement compared with three stage-relative placements"></p>
|
|
193
203
|
<p>Each of the 16 actor-relative directions is shown as a complete mini-scene containing an actor, Bubble body, tail, and text. The two tail-base points lie on the body border. The renderer uses a JSClipper union to produce a single path, so no internal border remains at the join.</p>
|
|
194
204
|
<p>The three stage-relative diagrams show the Stage frame, safe area, Bubble dimensions, horizontal centerline, and relevant reference edge or center. The diagrams and the TurboWarp drawable are generated by the same shared <code>renderBubbleSvg</code> implementation.</p>
|
|
195
|
-
<p>Actor-relative placement specifies the direction from the actor's center toward the center of the entire Bubble. The menu provides these 16 canonical directions:</p>
|
|
205
|
+
<p>Actor-relative placement applies to the custom profile and specifies the direction from the actor's center toward the center of the entire Bubble. The untouched basic profile uses Scratch's right-first placement and automatic left flip. The menu provides these 16 canonical directions:</p>
|
|
196
206
|
<pre><code class="language-text">up / up-up-right / up-right / right-up-right
|
|
197
207
|
right / right-down-right / down-right / down-down-right
|
|
198
208
|
down / down-down-left / down-left / left-down-left
|
|
@@ -271,7 +281,7 @@ set continue frames [Next1,Next2]
|
|
|
271
281
|
set bubble word delimiters [ /] show [false] for bubble style [hero-dialogue]
|
|
272
282
|
set bubble reveal sound [Typewriter] for bubble style [hero-dialogue]
|
|
273
283
|
set bubble voice [HeroVoice] for bubble style [hero-dialogue]
|
|
274
|
-
|
|
284
|
+
show [Let's head for the sea!] with bubble style [hero-dialogue]
|
|
275
285
|
finish [CHARACTER] with condition [input == "pressed"] or timeout after [10] seconds
|
|
276
286
|
</code></pre>
|
|
277
287
|
<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>
|
|
@@ -280,7 +290,7 @@ finish [CHARACTER] with condition [input == "pressed"] or timeout afte
|
|
|
280
290
|
<pre><code class="language-text">set runtime variable [input] to []
|
|
281
291
|
listen for key [Space] set runtime var [input] to [pressed]
|
|
282
292
|
listen for touch on this sprite set runtime var [input] to [pressed]
|
|
283
|
-
|
|
293
|
+
show [Let's head for the sea!] with bubble style [hero-dialogue]
|
|
284
294
|
wait with this bubble until condition [input == "pressed"] or timeout after [10] seconds
|
|
285
295
|
close this bubble
|
|
286
296
|
</code></pre>
|
|
@@ -334,11 +344,11 @@ explode this bubble relative scale [1.15] count [2] ease [easeOut]
|
|
|
334
344
|
animate bubble shape to [WAVY] speed [1] for [0.5] seconds
|
|
335
345
|
</code></pre>
|
|
336
346
|
<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>
|
|
337
|
-
<
|
|
338
|
-
<
|
|
339
|
-
|
|
347
|
+
<p>Use <code>close this bubble</code> to remove the current Bubble. It runs the configured hide animation and then releases the Bubble's timers and rendering resources. <code>set bubble hide animation ...</code> only configures that exit effect; it does not remove a Bubble by itself. For the built-in basic profile, passing an empty value to <code>say</code> or <code>think</code> also closes the Bubble, matching TurboWarp's standard behavior. Bubble does not expose a separate <code>hide</code> block because closing destroys the display rather than preserving a hidden instance for later reuse.</p>
|
|
348
|
+
<h2 id="reference">9. Showing a named Bubble style</h2>
|
|
349
|
+
<pre><code class="language-text">show [MESSAGE] with bubble style [STYLE]
|
|
340
350
|
</code></pre>
|
|
341
|
-
<p>
|
|
351
|
+
<p>The selected Bubble style determines the body and tail/trail together, along with its text profile, portrait layers, placement, and animation settings. <code>set bubble visual style</code> selects an inseparable pair such as <code>NORMAL</code> (speech body + speech tail) or <code>THINKING</code> (thought body + round trail); there is no independent tail-shape setting. The standalone extension derives its internal rendering kind from that style instead of asking the display block for a second, potentially conflicting choice.</p>
|
|
342
352
|
<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>
|
|
343
353
|
<h2 id="troubleshooting">10. Using Bubble with clones</h2>
|
|
344
354
|
<p>Bubble style definitions are shared within the extension, but each sprite or clone owns its currently displayed Bubble.</p>
|
|
@@ -370,7 +380,7 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
370
380
|
</tr>
|
|
371
381
|
<tr>
|
|
372
382
|
<td><code>set bubble visual style [VISUAL_STYLE] for bubble style [STYLE]</code></td>
|
|
373
|
-
<td>Select one of ten SVG body
|
|
383
|
+
<td>Select one of ten inseparable SVG body + tail/trail pairs</td>
|
|
374
384
|
</tr>
|
|
375
385
|
<tr>
|
|
376
386
|
<td><code>set bubble tail length [LENGTH] for bubble style [STYLE]</code></td>
|
|
@@ -445,12 +455,16 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
445
455
|
<td>Transition the Bubble outline</td>
|
|
446
456
|
</tr>
|
|
447
457
|
<tr>
|
|
448
|
-
<td><code>say [MESSAGE]
|
|
449
|
-
<td>
|
|
458
|
+
<td><code>say [MESSAGE]</code></td>
|
|
459
|
+
<td>Show built-in style <code>say</code>: speech body and speech tail</td>
|
|
460
|
+
</tr>
|
|
461
|
+
<tr>
|
|
462
|
+
<td><code>think [MESSAGE]</code></td>
|
|
463
|
+
<td>Show built-in style <code>think</code>: thought body and round trail</td>
|
|
450
464
|
</tr>
|
|
451
465
|
<tr>
|
|
452
|
-
<td><code>
|
|
453
|
-
<td>
|
|
466
|
+
<td><code>show [MESSAGE] with bubble style [STYLE]</code></td>
|
|
467
|
+
<td>Show the complete body and tail/trail pair owned by a style</td>
|
|
454
468
|
</tr>
|
|
455
469
|
<tr>
|
|
456
470
|
<td><code>set this bubble animation mode [MODE]</code></td>
|
|
@@ -469,6 +483,7 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
469
483
|
<td>Report the Bubble implementation version</td>
|
|
470
484
|
</tr>
|
|
471
485
|
</tbody></table>
|
|
486
|
+
<p>Saved projects using the former <code>say/think [MESSAGE] with bubble style [STYLE]</code> opcodes continue to run, but those two compatibility blocks are hidden from the palette. New scripts use the unified <code>show</code> block so the selected style alone determines the complete body and tail/trail shape.</p>
|
|
472
487
|
<h2 id="regeneration">12. Troubleshooting</h2>
|
|
473
488
|
<table>
|
|
474
489
|
<thead>
|
|
@@ -479,7 +494,7 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
479
494
|
</thead>
|
|
480
495
|
<tbody><tr>
|
|
481
496
|
<td>Asset Manager required error</td>
|
|
482
|
-
<td>Load Asset Manager 0.
|
|
497
|
+
<td>Load Asset Manager 0.12.x without sandbox before using image/media assets</td>
|
|
483
498
|
</tr>
|
|
484
499
|
<tr>
|
|
485
500
|
<td>SVG overlay backend error</td>
|
|
@@ -495,7 +510,7 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
495
510
|
</tr>
|
|
496
511
|
<tr>
|
|
497
512
|
<td><code>bubble style is not defined</code></td>
|
|
498
|
-
<td>
|
|
513
|
+
<td>Use the built-in short say/think blocks, or define the named custom style first</td>
|
|
499
514
|
</tr>
|
|
500
515
|
<tr>
|
|
501
516
|
<td>Image asset is not registered</td>
|
|
@@ -539,6 +554,7 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
539
554
|
<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>
|
|
540
555
|
<h2>14. Regenerating the manual assets</h2>
|
|
541
556
|
<p>The diagrams and GIF are generated from scripts in this repository. GIF generation requires the ImageMagick <code>magick</code> command.</p>
|
|
557
|
+
<p>The two <code>turbowarp-say-think-*-comparison.png</code> files are real TurboWarp Editor screenshots rather than generated renderer previews. They use the capture conditions documented in section 4 and are not overwritten by <code>docs:render</code>.</p>
|
|
542
558
|
<pre><code class="language-sh">pnpm docs:render
|
|
543
559
|
pnpm docs:check
|
|
544
560
|
</code></pre>
|
package/docs/ja/index.html
CHANGED
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
</blockquote>
|
|
75
75
|
<p><img src="../assets/block-quick-start.svg" alt="Next1とNext2を個別登録し、入力listenerを準備してBubble内蔵待機を使うブロック例"></p>
|
|
76
76
|
<h2 id="requirements">1. 必要な拡張機能</h2>
|
|
77
|
-
<p>入力待ちを含む完全な例では5つの拡張機能を使います。TurboWarpの拡張機能ライブラリからTemporary Variablesを追加し、選択した機能に必要なカスタム拡張機能を「サンドボックスなしで実行」を許可して読み込みます。BubbleはSVG Text 0.8.
|
|
77
|
+
<p>入力待ちを含む完全な例では5つの拡張機能を使います。TurboWarpの拡張機能ライブラリからTemporary Variablesを追加し、選択した機能に必要なカスタム拡張機能を「サンドボックスなしで実行」を許可して読み込みます。BubbleはSVG Text 0.8.1のhost-neutral layout providerをbundle内に持ち、既定のSVG overlayではskinを作りません。portrait、lip-sync、continue indicator、フルボイス、表示効果音などのメディアアセットにはAsset Managerが必要です。Async InputとRuntime ExpressionはBubble待機を使う場合だけ必要です。</p>
|
|
78
78
|
<table>
|
|
79
79
|
<thead>
|
|
80
80
|
<tr>
|
|
@@ -100,13 +100,13 @@
|
|
|
100
100
|
</tr>
|
|
101
101
|
<tr>
|
|
102
102
|
<td align="right">4</td>
|
|
103
|
-
<td>Asset Manager 0.
|
|
104
|
-
<td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-asset-manager@0.
|
|
103
|
+
<td>Asset Manager 0.12.1</td>
|
|
104
|
+
<td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-asset-manager@0.12.1/dist/asset-manager.js</code></td>
|
|
105
105
|
</tr>
|
|
106
106
|
<tr>
|
|
107
107
|
<td align="right">5</td>
|
|
108
|
-
<td>Bubble 0.
|
|
109
|
-
<td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.
|
|
108
|
+
<td>Bubble 0.9.0</td>
|
|
109
|
+
<td><code>https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.9.0/dist/turbowarp-bubble.js</code></td>
|
|
110
110
|
</tr>
|
|
111
111
|
</tbody></table>
|
|
112
112
|
<p>開発中のBubbleを試す場合は、このリポジトリの<code>dist/turbowarp-bubble.js</code>をローカルカスタム拡張機能として読み込みます。既定SVG overlayに必要なrenderer APIがない場合、画像・メディア機能の使用時にAsset Managerがない場合、待機開始時にAsync InputかRuntime Expressionがない場合は、Bubbleが明示的なエラーを返します。低レベルComposition APIでは別のtext capabilityを注入できます。</p>
|
|
@@ -175,12 +175,22 @@ register resource [costume:Assets:Next2] as asset [Next2]
|
|
|
175
175
|
</code></pre>
|
|
176
176
|
<p>URL画像を使う場合は、<code>RESOURCE_ID</code>へHTTPS URLを指定します。Bubbleに設定できるのは、Asset Managerへ登録済みでMIME typeが<code>image/*</code>のアセットだけです。</p>
|
|
177
177
|
<h2 id="text-style">3. 文字layout styleを選ぶ</h2>
|
|
178
|
-
<p>standalone BubbleはSVG Text 0.8.
|
|
178
|
+
<p>standalone BubbleはSVG Text 0.8.1のlayout compositionを内包し、2つのBubble styleを組み込みます。<code>say</code>はspeech本体とspeech tail、<code>think</code>はthought本体とround trailを持ち、本体とtail/trailの形は別項目ではなく1つのvisual styleとして選びます。短い<code>say [MESSAGE]</code>/<code>think [MESSAGE]</code>ブロックが対応styleを自動選択するため、基本経路にはstyle定義もstyle入力も不要です。どちらも予約text profile <code>default</code>、内容に追従するサイズ、14px Helvetica、右側優先・収まりに応じた左反転、block入力の330文字上限、空文字でのcloseを使います。4pxのSVG strokeを白いfillより先に描き、内側半分を隠すことで、見かけの輪郭をTurboWarp標準と同じ細さにします。それ以外のtext style名やstyle設定ブロックを使うとcustom profileになります。custom text styleは初回参照時に背景透明のSVG Text既定styleとして初期化されます。stock SVG Text 0.8.1をBubbleより先に別拡張として読み込んだprojectでは、Bubbleが公開<code>getLayoutCapability()</code>を使い、SVG Text blockで定義したnamed styleを維持します。handoffのない古いSVG Textがロード済みならstyleを黙って置換せず互換errorを返し、必要な場合だけ文書化済みscratch-render fallbackを選択します。</p>
|
|
179
179
|
<pre><code class="language-text">define bubble style [hero-dialogue] using text style [default]
|
|
180
180
|
</code></pre>
|
|
181
|
-
<p>独自のfont、色、alignmentを使うアプリhostは、<code>createSvgTextLayoutComposition()</code>へstyleを定義し、<code>createSvgTextOverlayTextCapability()</code>でBubble
|
|
181
|
+
<p>独自のfont、色、alignmentを使うアプリhostは、<code>createSvgTextLayoutComposition()</code>へstyleを定義し、<code>createSvgTextOverlayTextCapability()</code>でBubbleへ注入します。custom profileは同じ<code>layoutText()</code>を使い、既定overlay backendではSVG文字skinを生成しません。Bubbleの配置、tail、吹き出し外形はBubble側が担当します。</p>
|
|
182
182
|
<h2 id="bubble-style">4. Bubble styleを定義する</h2>
|
|
183
|
-
<p
|
|
183
|
+
<p>基本Bubbleでは短いブロックをそのまま使います。組み込みBubble style <code>say</code>/<code>think</code>がそれぞれ自動選択されます。</p>
|
|
184
|
+
<pre><code class="language-text">say [こんにちは!]
|
|
185
|
+
think [うーん…]
|
|
186
|
+
</code></pre>
|
|
187
|
+
<h3>TurboWarp標準との比較</h3>
|
|
188
|
+
<p>次の画像は、1つのTurboWarp Editor projectで英語UIを使い、<code>Cat</code> spriteを<code>x=-80</code>、<code>y=0</code>、サイズ<code>80%</code>、Stageを白背景、入力を<code>Hello!</code>/<code>Hmm...</code>に揃えて撮影した実画面です。左列はTurboWarp標準の見た目ブロックです。右列は対応する組み込み<code>say</code>/<code>think</code> styleを使うBubbleの短い基本ブロックで、定義ブロックもsetterも使っていません。</p>
|
|
189
|
+
<p><img src="../assets/turbowarp-say-think-stage-comparison.png" alt="TurboWarp標準のsay・think吹き出しとBubble基本profileを同じStageで比較した実画面"></p>
|
|
190
|
+
<p>Stage図では、右側配置、内容に追従する本体、Actor側へ向くspeech tail/thought trailを同じ条件で確認できます。Bubbleは独立したSVG surfaceを描画しており、全4panelとも実際のTurboWarp Stageを切り出したものです。</p>
|
|
191
|
+
<p><img src="../assets/turbowarp-say-think-block-comparison.png" alt="TurboWarp標準のsay・thinkブロックと、設定不要のBubble基本say・thinkブロックおよび組み込みdefault profile値を比較したスクリーンショット"></p>
|
|
192
|
+
<p>ブロック図は設定不要の基本経路と、custom style用の統合表示ブロックを示します。短いブロックは対応する組み込みstyleを自動選択します。calloutでは不可分な本体+tail/trailの組、両styleが使う予約text profile <code>default</code>、共通のfont、行高、幅、padding、角丸、色、border描画順、配置を示します。named custom styleには<code>show [MESSAGE] with bubble style [STYLE]</code>を使います。旧styled say/think opcodeは保存済みproject互換用の非表示定義として残します。</p>
|
|
193
|
+
<p>次のsetterを使うと、意図的にcustom profileへ切り替わります。</p>
|
|
184
194
|
<pre><code class="language-text">define bubble style [hero-dialogue] using text style [default]
|
|
185
195
|
set bubble placement [up-right] for bubble style [hero-dialogue]
|
|
186
196
|
set bubble distance [12] for bubble style [hero-dialogue]
|
|
@@ -192,7 +202,7 @@ set bubble offset x [0] y [0] scale [100] % for bubble style [hero-dialogue]
|
|
|
192
202
|
<p><img src="../assets/placement-guide.svg" alt="Actor相対の16方向・角度指定と、背景相対の3配置を比較する図"></p>
|
|
193
203
|
<p>Actor相対の16方向は、各方向をActor、Bubble外形、tail、文字を含む独立したミニシーンで示しています。三角形tailの基部2点は実際の本体border上にあり、本体polygonとのJSClipper union後の単一pathを描くため、接合部に内部border線は残りません。</p>
|
|
194
204
|
<p>背景相対3図はStage外枠、安全領域、Bubble外形寸法、水平中央線、基準辺/中心を示します。外形はBubble側の共有<code>renderBubbleSvg</code>で生成しており、TurboWarp Editorで本体drawableを生成するrendererと同じです。</p>
|
|
195
|
-
<p>Actor
|
|
205
|
+
<p>Actor相対placementはcustom profileへ適用され、Actor中心からBubble全体の中心へ向かう方向を指定します。未変更の基本profileはScratch標準の右側優先・自動左反転を使います。menuには次の16正規方向があります。</p>
|
|
196
206
|
<pre><code class="language-text">up / up-up-right / up-right / right-up-right
|
|
197
207
|
right / right-down-right / down-right / down-down-right
|
|
198
208
|
down / down-down-left / down-left / left-down-left
|
|
@@ -271,7 +281,7 @@ set continue frames [Next1,Next2]
|
|
|
271
281
|
set bubble word delimiters [ /] show [false] for bubble style [hero-dialogue]
|
|
272
282
|
set bubble reveal sound [Typewriter] for bubble style [hero-dialogue]
|
|
273
283
|
set bubble voice [HeroVoice] for bubble style [hero-dialogue]
|
|
274
|
-
|
|
284
|
+
show [海へ出発!] with bubble style [hero-dialogue]
|
|
275
285
|
finish [CHARACTER] with condition [input == "pressed"] or timeout after [10] seconds
|
|
276
286
|
</code></pre>
|
|
277
287
|
<p><code>DYNAMIC</code>は表示単位ごとに吹き出しの大きさと配置を再計算し、<code>RESERVED</code>は最終的な文字量を先に計測して表示中の外形を予約します。<code>set bubble reveal sound</code>は単位ごと、<code>set bubble voice</code>は表示開始時にAsset Managerの名前付き音声を再生します。音声がなくても文字表示は利用できます。</p>
|
|
@@ -280,7 +290,7 @@ finish [CHARACTER] with condition [input == "pressed"] or timeout afte
|
|
|
280
290
|
<pre><code class="language-text">set runtime variable [input] to []
|
|
281
291
|
listen for key [Space] set runtime var [input] to [pressed]
|
|
282
292
|
listen for touch on this sprite set runtime var [input] to [pressed]
|
|
283
|
-
|
|
293
|
+
show [海へ出発!] with bubble style [hero-dialogue]
|
|
284
294
|
wait with this bubble until condition [input == "pressed"] or timeout after [10] seconds
|
|
285
295
|
close this bubble
|
|
286
296
|
</code></pre>
|
|
@@ -334,11 +344,11 @@ explode this bubble relative scale [1.15] count [2] ease [easeOut]
|
|
|
334
344
|
animate bubble shape to [WAVY] speed [1] for [0.5] seconds
|
|
335
345
|
</code></pre>
|
|
336
346
|
<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>
|
|
337
|
-
<
|
|
338
|
-
<
|
|
339
|
-
|
|
347
|
+
<p>表示中のBubbleを消すときは<code>close this bubble</code>を使います。設定済みの表示終了animationを実行してから、Bubbleのtimerと描画resourceを解放します。<code>set bubble hide animation ...</code>は終了時の演出を設定するだけで、このブロック自体はBubbleを消しません。組み込み基本profileでは、<code>say</code>/<code>think</code>へ空文字を渡してもTurboWarp標準と同様にcloseします。closeは非表示instanceを保持せず表示を破棄するため、別の<code>hide</code>ブロックは公開しません。</p>
|
|
348
|
+
<h2 id="reference">9. named Bubble styleを表示する</h2>
|
|
349
|
+
<pre><code class="language-text">show [MESSAGE] with bubble style [STYLE]
|
|
340
350
|
</code></pre>
|
|
341
|
-
<p
|
|
351
|
+
<p>選択したBubble styleが、本体とtail/trailの形を一体で決め、text profile、表情レイヤー、placement、animation設定も保持します。<code>set bubble visual style</code>は<code>NORMAL</code>(speech本体+speech tail)や<code>THINKING</code>(thought本体+round trail)のような不可分の組を選ぶブロックで、tail形状だけを独立して指定する設定はありません。standalone extensionは、表示ブロックに競合し得る別の種類を選ばせず、そのstyleから内部描画kindを導きます。</p>
|
|
342
352
|
<p>同じsprite、clone、またはStageで新しい<code>say</code>/<code>think</code>を実行すると、以前のBubbleをtimerやdrawableごと破棄してから置き換えます。Stageでは背景相対placementだけを使用できます。</p>
|
|
343
353
|
<h2 id="troubleshooting">10. cloneで使う</h2>
|
|
344
354
|
<p>Bubble styleの定義は拡張機能内で共有されますが、表示中のBubbleはsprite/cloneごとに所有されます。</p>
|
|
@@ -370,7 +380,7 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
370
380
|
</tr>
|
|
371
381
|
<tr>
|
|
372
382
|
<td><code>set bubble visual style [VISUAL_STYLE] for bubble style [STYLE]</code></td>
|
|
373
|
-
<td
|
|
383
|
+
<td>不可分なSVG本体+tail/trailの組を10種類から設定する</td>
|
|
374
384
|
</tr>
|
|
375
385
|
<tr>
|
|
376
386
|
<td><code>set bubble tail length [LENGTH] for bubble style [STYLE]</code></td>
|
|
@@ -445,12 +455,16 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
445
455
|
<td>Bubble外形を時間経過で切り替える</td>
|
|
446
456
|
</tr>
|
|
447
457
|
<tr>
|
|
448
|
-
<td><code>say [MESSAGE]
|
|
449
|
-
<td
|
|
458
|
+
<td><code>say [MESSAGE]</code></td>
|
|
459
|
+
<td>組み込み<code>say</code> styleのspeech本体+tailを表示する</td>
|
|
460
|
+
</tr>
|
|
461
|
+
<tr>
|
|
462
|
+
<td><code>think [MESSAGE]</code></td>
|
|
463
|
+
<td>組み込み<code>think</code> styleのthought本体+round trailを表示する</td>
|
|
450
464
|
</tr>
|
|
451
465
|
<tr>
|
|
452
|
-
<td><code>
|
|
453
|
-
<td
|
|
466
|
+
<td><code>show [MESSAGE] with bubble style [STYLE]</code></td>
|
|
467
|
+
<td>styleが持つ本体+tail/trailの一組を表示する</td>
|
|
454
468
|
</tr>
|
|
455
469
|
<tr>
|
|
456
470
|
<td><code>set this bubble animation mode [MODE]</code></td>
|
|
@@ -469,6 +483,7 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
469
483
|
<td>Bubble実装versionを返す</td>
|
|
470
484
|
</tr>
|
|
471
485
|
</tbody></table>
|
|
486
|
+
<p>旧<code>say/think [MESSAGE] with bubble style [STYLE]</code> opcodeを使う保存済みprojectは引き続き動作しますが、この互換ブロック2個はpaletteに表示しません。新しいscriptでは統合<code>show</code>ブロックを使い、選択styleだけで本体とtail/trailの形を決めます。</p>
|
|
472
487
|
<h2 id="regeneration">12. よくあるエラー</h2>
|
|
473
488
|
<table>
|
|
474
489
|
<thead>
|
|
@@ -479,7 +494,7 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
479
494
|
</thead>
|
|
480
495
|
<tbody><tr>
|
|
481
496
|
<td>Asset Managerを要求するエラー</td>
|
|
482
|
-
<td>画像・メディアアセットを使う前にAsset Manager 0.
|
|
497
|
+
<td>画像・メディアアセットを使う前にAsset Manager 0.12.xを読み込む</td>
|
|
483
498
|
</tr>
|
|
484
499
|
<tr>
|
|
485
500
|
<td>SVG overlay backendのエラー</td>
|
|
@@ -495,7 +510,7 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
495
510
|
</tr>
|
|
496
511
|
<tr>
|
|
497
512
|
<td><code>bubble style is not defined</code></td>
|
|
498
|
-
<td
|
|
513
|
+
<td>組み込みの短いsay/thinkを使うか、named custom styleを先に定義する</td>
|
|
499
514
|
</tr>
|
|
500
515
|
<tr>
|
|
501
516
|
<td>image assetが未登録</td>
|
|
@@ -539,6 +554,7 @@ think [MESSAGE] with bubble style [STYLE]
|
|
|
539
554
|
<p>Asset Managerへ登録したアセット自体はBubbleの所有物ではありません。不要になった登録画像をメモリから削除する場合は、Bubbleを閉じた後にAsset Managerの<code>delete asset [NAME] from memory</code>を使います。</p>
|
|
540
555
|
<h2>14. マニュアル画像の再生成</h2>
|
|
541
556
|
<p>図とGIFはリポジトリ内のスクリプトから再生成できます。GIF生成にはImageMagickの<code>magick</code>コマンドが必要です。</p>
|
|
557
|
+
<p>2つの<code>turbowarp-say-think-*-comparison.png</code>はrenderer previewから生成した図ではなく、TurboWarp Editorの実画面です。第4章に記載した撮影条件を使い、<code>docs:render</code>では上書きしません。</p>
|
|
542
558
|
<pre><code class="language-sh">pnpm docs:render
|
|
543
559
|
pnpm docs:check
|
|
544
560
|
</code></pre>
|