@kubohiroya/turbowarp-bubble 0.12.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +40 -36
- package/README.md +35 -29
- package/dist/turbowarp-adapter.js +1457 -1283
- package/dist/turbowarp-bubble.js +723 -6
- package/dist/types/turbowarp-adapter.d.ts +3 -1
- package/docs/block-manual.ja.md +23 -23
- package/docs/block-manual.md +23 -23
- package/docs/block-reference.html +2023 -0
- package/docs/index.html +2044 -20
- package/docs/ja/index.html +2044 -20
- package/docs/release-notes-0.13.0.md +18 -0
- package/package.json +47 -35
- package/schemas/block-editor-fixed-inputs.schema.json +316 -0
|
@@ -46,7 +46,7 @@ export interface TurboWarpAssetManagerExtension {
|
|
|
46
46
|
getAssetMimeType(args: Readonly<{
|
|
47
47
|
NAME: unknown;
|
|
48
48
|
}>): string;
|
|
49
|
-
/**
|
|
49
|
+
/** Public skin-free overlay path provided by Asset Cache. */
|
|
50
50
|
getDOMImageCapability?(): AssetManagerDOMImageCapability;
|
|
51
51
|
playSound?(args: Readonly<{
|
|
52
52
|
NAME: unknown;
|
|
@@ -62,6 +62,8 @@ export interface TurboWarpAssetManagerExtension {
|
|
|
62
62
|
}
|
|
63
63
|
export interface TurboWarpBubbleRuntime {
|
|
64
64
|
readonly renderer: TurboWarpBubbleRenderer;
|
|
65
|
+
readonly ext_kubohiroyaassetcache?: TurboWarpAssetManagerExtension;
|
|
66
|
+
/** Deprecated compatibility lookup for projects that have not migrated their extension ID. */
|
|
65
67
|
readonly ext_kubohiroyaassetmanager?: TurboWarpAssetManagerExtension;
|
|
66
68
|
readonly ext_kubohiroyasvgtext?: TurboWarpSvgTextExtension;
|
|
67
69
|
requestRedraw?(): void;
|
package/docs/block-manual.ja.md
CHANGED
|
@@ -8,21 +8,21 @@
|
|
|
8
8
|
|
|
9
9
|
## 1. 必要な拡張機能
|
|
10
10
|
|
|
11
|
-
入力待ちを含む完全な例では5つの拡張機能を使います。TurboWarpの拡張機能ライブラリからTemporary Variablesを追加し、選択した機能に必要なカスタム拡張機能を「サンドボックスなしで実行」を許可して読み込みます。BubbleはSVG Text 0.10.
|
|
11
|
+
入力待ちを含む完全な例では5つの拡張機能を使います。TurboWarpの拡張機能ライブラリからTemporary Variablesを追加し、選択した機能に必要なカスタム拡張機能を「サンドボックスなしで実行」を許可して読み込みます。BubbleはSVG Text 0.10.1のhost-neutral layout providerをbundle内に持ち、既定のSVG overlayではskinを作りません。portrait、lip-sync、continue indicator、フルボイス、表示効果音などのメディアアセットにはAsset Cacheが必要です。Async InputとRuntime Expressionはconditionを使うBubble待機またはclose policyで必要です。timeoutだけのclose policyにはどちらも不要です。
|
|
12
12
|
|
|
13
13
|
| 順番 | 拡張機能 | 読み込み先 |
|
|
14
14
|
| ---: | ------------------------ | -------------------------------------------------------------------------------------------------------- |
|
|
15
15
|
| 1 | Temporary Variables | TurboWarpの拡張機能ライブラリから追加 |
|
|
16
|
-
| 2 | Async Input 0.7.
|
|
17
|
-
| 3 | Runtime Expression 0.6.
|
|
18
|
-
| 4 | Asset
|
|
19
|
-
| 5 | Bubble 0.
|
|
16
|
+
| 2 | Async Input 0.7.1 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-async-input@0.7.1/dist/async-input.js` |
|
|
17
|
+
| 3 | Runtime Expression 0.6.1 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-runtime-expression@0.6.1/dist/runtime-expression.js` |
|
|
18
|
+
| 4 | Asset Cache 0.2.2 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-asset-cache@0.2.2/dist/asset-cache.js` |
|
|
19
|
+
| 5 | Bubble 0.13.1 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.13.1/dist/turbowarp-bubble.js` |
|
|
20
20
|
|
|
21
|
-
開発中のBubbleを試す場合は、このリポジトリの`dist/turbowarp-bubble.js`をローカルカスタム拡張機能として読み込みます。既定SVG overlayに必要なrenderer APIがない場合、画像・メディア機能の使用時にAsset
|
|
21
|
+
開発中のBubbleを試す場合は、このリポジトリの`dist/turbowarp-bubble.js`をローカルカスタム拡張機能として読み込みます。既定SVG overlayに必要なrenderer APIがない場合、画像・メディア機能の使用時にAsset Cacheがない場合、condition待機の開始時にAsync InputかRuntime Expressionがない場合は、Bubbleが明示的なエラーを返します。低レベルComposition APIでは別のtext capabilityを注入できます。
|
|
22
22
|
|
|
23
23
|
参考:
|
|
24
24
|
|
|
25
|
-
- [Asset
|
|
25
|
+
- [Asset Cache 日本語ガイド](https://kubohiroya.github.io/turbowarp-asset-cache/ja/)
|
|
26
26
|
- [Async Input 日本語ガイド](https://kubohiroya.github.io/turbowarp-async-input/ja/)
|
|
27
27
|
- [Runtime Expression 日本語ガイド](https://kubohiroya.github.io/turbowarp-runtime-expression/ja/)
|
|
28
28
|
- [SVG Text 日本語ガイド](https://kubohiroya.github.io/turbowarp-svg-text/ja/)
|
|
@@ -31,19 +31,19 @@
|
|
|
31
31
|
|
|
32
32
|
例では`Assets`という素材用spriteに、次のcostumeを入れます。素材用spriteは画面上で非表示でも構いません。
|
|
33
33
|
|
|
34
|
-
| costume | Asset
|
|
35
|
-
| ----------------- |
|
|
36
|
-
| `HeroFace` | `HeroFace`
|
|
37
|
-
| `HeroEyesOpen` | `HeroEyesOpen`
|
|
38
|
-
| `HeroEyesClosed` | `HeroEyesClosed`
|
|
39
|
-
| `HeroMouthClosed` | `HeroMouthClosed`
|
|
40
|
-
| `HeroMouthOpen` | `HeroMouthOpen`
|
|
41
|
-
| `Next1` | `Next1`
|
|
42
|
-
| `Next2` | `Next2`
|
|
34
|
+
| costume | Asset Cacheへ登録する名前 | 内容 |
|
|
35
|
+
| ----------------- | ------------------------- | ------------------------------------------------ |
|
|
36
|
+
| `HeroFace` | `HeroFace` | 顔、髪、輪郭などのベース。動かす目と口は含めない |
|
|
37
|
+
| `HeroEyesOpen` | `HeroEyesOpen` | 開いた目だけを描いた透明差分 |
|
|
38
|
+
| `HeroEyesClosed` | `HeroEyesClosed` | 閉じた目だけを描いた透明差分 |
|
|
39
|
+
| `HeroMouthClosed` | `HeroMouthClosed` | 閉じた口だけを描いた透明差分 |
|
|
40
|
+
| `HeroMouthOpen` | `HeroMouthOpen` | 開いた口だけを描いた透明差分 |
|
|
41
|
+
| `Next1` | `Next1` | 「次へ」アイコンの1枚目 |
|
|
42
|
+
| `Next2` | `Next2` | 「次へ」アイコンの2枚目 |
|
|
43
43
|
|
|
44
44
|
ベース、目、口の画像は同じcanvasサイズと同じ中心位置で作ります。差分画像の背景は透明にしてください。位置やcanvasサイズが異なると、レイヤーを重ねたときに目や口がずれます。
|
|
45
45
|
|
|
46
|
-
Asset
|
|
46
|
+
Asset Cacheのブロックで各costumeを登録します。
|
|
47
47
|
|
|
48
48
|
```text
|
|
49
49
|
register resource [costume:Assets:HeroFace] as asset [HeroFace]
|
|
@@ -55,11 +55,11 @@ register resource [costume:Assets:Next1] as asset [Next1]
|
|
|
55
55
|
register resource [costume:Assets:Next2] as asset [Next2]
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
URL画像を使う場合は、`RESOURCE_ID`へHTTPS URLを指定します。Bubbleに設定できるのは、Asset
|
|
58
|
+
URL画像を使う場合は、`RESOURCE_ID`へHTTPS URLを指定します。Bubbleに設定できるのは、Asset Cacheへ登録済みでMIME typeが`image/*`のアセットだけです。
|
|
59
59
|
|
|
60
60
|
## 3. 文字layout styleを選ぶ
|
|
61
61
|
|
|
62
|
-
standalone BubbleはSVG Text 0.10.
|
|
62
|
+
standalone BubbleはSVG Text 0.10.1のlayout compositionを内包し、2つのBubble styleを組み込みます。`say`はspeech本体とspeech tail、`think`はthought本体とround trailを持ち、本体とtail/trailの形は別項目ではなく1つのvisual styleとして選びます。短い`say [MESSAGE]`/`think [MESSAGE]`ブロックが対応styleを自動選択するため、基本経路にはstyle定義もstyle入力も不要です。どちらも予約text profile `default`、内容に追従するサイズ、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.10.1をBubbleより先に別拡張として読み込んだprojectでは、Bubbleが公開`getLayoutCapability()`を使い、SVG Text blockで定義したnamed styleを維持します。handoffのない古いSVG Textがロード済みならstyleを黙って置換せず互換errorを返し、必要な場合だけ文書化済みscratch-render fallbackを選択します。
|
|
63
63
|
|
|
64
64
|
```text
|
|
65
65
|
define bubble style [hero-dialogue] using text style [default]
|
|
@@ -178,7 +178,7 @@ set continue frames [Next1,Next2]
|
|
|
178
178
|
every [0.2] seconds for bubble style [hero-dialogue]
|
|
179
179
|
```
|
|
180
180
|
|
|
181
|
-
`ASSETS`はカンマ区切りのAsset
|
|
181
|
+
`ASSETS`はカンマ区切りのAsset Cacheアセット名です。名前の前後の空白は除去されます。アセット名自体にカンマは使用できません。
|
|
182
182
|
|
|
183
183
|
- 目パチと口パクは1枚以上指定できます。1枚だけなら表示は固定されます。
|
|
184
184
|
- 「次へ」はループが分かるよう2枚以上必要です。
|
|
@@ -202,7 +202,7 @@ show [海へ出発!] with bubble style [hero-dialogue]
|
|
|
202
202
|
finish [CHARACTER] with condition [input == "pressed"] or timeout after [10] seconds
|
|
203
203
|
```
|
|
204
204
|
|
|
205
|
-
`DYNAMIC`は表示単位ごとに吹き出しの大きさと配置を再計算し、`RESERVED`は最終的な文字量を先に計測して表示中の外形を予約します。`set bubble reveal sound`は単位ごと、`set bubble voice`は表示開始時にAsset
|
|
205
|
+
`DYNAMIC`は表示単位ごとに吹き出しの大きさと配置を再計算し、`RESERVED`は最終的な文字量を先に計測して表示中の外形を予約します。`set bubble reveal sound`は単位ごと、`set bubble voice`は表示開始時にAsset Cacheの名前付き音声を再生します。音声がなくても文字表示は利用できます。
|
|
206
206
|
|
|
207
207
|
## 6. セリフを表示して入力を待つ
|
|
208
208
|
|
|
@@ -328,7 +328,7 @@ cloneが停止・削除された場合は、そのtargetに属するtimer、over
|
|
|
328
328
|
|
|
329
329
|
| 状況 | 原因と対処 |
|
|
330
330
|
| ------------------------------------ | ------------------------------------------------------------------------ |
|
|
331
|
-
| Asset
|
|
331
|
+
| Asset Cacheを要求するエラー | 画像・メディアアセットを使う前にAsset Cache 0.2.2を読み込む |
|
|
332
332
|
| SVG overlay backendのエラー | `renderer.addOverlay()`対応hostを使うか`scratch-render`を明示する |
|
|
333
333
|
| Async Inputを要求するエラー | Bubble待機より前にAsync Input 0.3.xをサンドボックスなしで読み込む |
|
|
334
334
|
| Runtime Expressionを要求するエラー | Bubble待機より前にRuntime Expression 0.3.xをサンドボックスなしで読み込む |
|
|
@@ -353,7 +353,7 @@ cloneが停止・削除された場合は、そのtargetに属するtimer、over
|
|
|
353
353
|
- projectの全停止
|
|
354
354
|
- TurboWarp runtimeの破棄
|
|
355
355
|
|
|
356
|
-
Asset
|
|
356
|
+
Asset Cacheへ登録したアセット自体はBubbleの所有物ではありません。不要になった登録画像をメモリから削除する場合は、Bubbleを閉じた後にAsset Cacheの`delete asset [NAME] from memory`を使います。
|
|
357
357
|
|
|
358
358
|
## 14. マニュアル画像の再生成
|
|
359
359
|
|
package/docs/block-manual.md
CHANGED
|
@@ -8,21 +8,21 @@ 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.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.10.1 layout provider and creates no text skin on its default SVG overlay. Asset Cache is required for portrait, lip-sync, continue indicator, voice, and display-sound assets. Async Input and Runtime Expression are required only for condition-based Bubble waits and close policies; a timeout-only close policy needs neither.
|
|
12
12
|
|
|
13
13
|
| Order | Extension | URL |
|
|
14
14
|
| ----: | ------------------------ | -------------------------------------------------------------------------------------------------------- |
|
|
15
15
|
| 1 | Temporary Variables | Add from the TurboWarp extension library |
|
|
16
|
-
| 2 | Async Input 0.7.
|
|
17
|
-
| 3 | Runtime Expression 0.6.
|
|
18
|
-
| 4 | Asset
|
|
19
|
-
| 5 | Bubble 0.
|
|
16
|
+
| 2 | Async Input 0.7.1 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-async-input@0.7.1/dist/async-input.js` |
|
|
17
|
+
| 3 | Runtime Expression 0.6.1 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-runtime-expression@0.6.1/dist/runtime-expression.js` |
|
|
18
|
+
| 4 | Asset Cache 0.2.2 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-asset-cache@0.2.2/dist/asset-cache.js` |
|
|
19
|
+
| 5 | Bubble 0.13.1 | `https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.13.1/dist/turbowarp-bubble.js` |
|
|
20
20
|
|
|
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
|
|
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 Cache, or if Async Input or Runtime Expression is missing when it starts a condition-based Bubble wait. The lower-level Composition API can inject another text capability.
|
|
22
22
|
|
|
23
23
|
See also:
|
|
24
24
|
|
|
25
|
-
- [Asset
|
|
25
|
+
- [Asset Cache guide](https://kubohiroya.github.io/turbowarp-asset-cache/)
|
|
26
26
|
- [Async Input guide](https://kubohiroya.github.io/turbowarp-async-input/)
|
|
27
27
|
- [Runtime Expression guide](https://kubohiroya.github.io/turbowarp-runtime-expression/)
|
|
28
28
|
- [SVG Text guide](https://kubohiroya.github.io/turbowarp-svg-text/)
|
|
@@ -31,19 +31,19 @@ See also:
|
|
|
31
31
|
|
|
32
32
|
The following example stores costumes in a hidden asset sprite named `Assets`.
|
|
33
33
|
|
|
34
|
-
| Costume | Asset
|
|
35
|
-
| ----------------- |
|
|
36
|
-
| `HeroFace` | `HeroFace`
|
|
37
|
-
| `HeroEyesOpen` | `HeroEyesOpen`
|
|
38
|
-
| `HeroEyesClosed` | `HeroEyesClosed`
|
|
39
|
-
| `HeroMouthClosed` | `HeroMouthClosed`
|
|
40
|
-
| `HeroMouthOpen` | `HeroMouthOpen`
|
|
41
|
-
| `Next1` | `Next1`
|
|
42
|
-
| `Next2` | `Next2`
|
|
34
|
+
| Costume | Asset Cache name | Contents |
|
|
35
|
+
| ----------------- | ----------------- | ---------------------------------------------------------- |
|
|
36
|
+
| `HeroFace` | `HeroFace` | Face, hair, and outline, excluding the animated eyes/mouth |
|
|
37
|
+
| `HeroEyesOpen` | `HeroEyesOpen` | Transparent overlay containing only the open eyes |
|
|
38
|
+
| `HeroEyesClosed` | `HeroEyesClosed` | Transparent overlay containing only the closed eyes |
|
|
39
|
+
| `HeroMouthClosed` | `HeroMouthClosed` | Transparent overlay containing only the closed mouth |
|
|
40
|
+
| `HeroMouthOpen` | `HeroMouthOpen` | Transparent overlay containing only the open mouth |
|
|
41
|
+
| `Next1` | `Next1` | First frame of the continue indicator |
|
|
42
|
+
| `Next2` | `Next2` | Second frame of the continue indicator |
|
|
43
43
|
|
|
44
44
|
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.
|
|
45
45
|
|
|
46
|
-
Register each costume with Asset
|
|
46
|
+
Register each costume with Asset Cache:
|
|
47
47
|
|
|
48
48
|
```text
|
|
49
49
|
register resource [costume:Assets:HeroFace] as asset [HeroFace]
|
|
@@ -55,11 +55,11 @@ register resource [costume:Assets:Next1] as asset [Next1]
|
|
|
55
55
|
register resource [costume:Assets:Next2] as asset [Next2]
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
For a remote image, pass its HTTPS URL as `RESOURCE_ID`. Bubble accepts only assets already registered with Asset
|
|
58
|
+
For a remote image, pass its HTTPS URL as `RESOURCE_ID`. Bubble accepts only assets already registered with Asset Cache whose MIME type is `image/*`.
|
|
59
59
|
|
|
60
60
|
## 3. Select a text layout style
|
|
61
61
|
|
|
62
|
-
Standalone Bubble bundles the SVG Text 0.10.
|
|
62
|
+
Standalone Bubble bundles the SVG Text 0.10.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.10.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]
|
|
@@ -178,7 +178,7 @@ set continue frames [Next1,Next2]
|
|
|
178
178
|
every [0.2] seconds for bubble style [hero-dialogue]
|
|
179
179
|
```
|
|
180
180
|
|
|
181
|
-
`ASSETS` is a comma-separated list of Asset
|
|
181
|
+
`ASSETS` is a comma-separated list of Asset Cache names. Surrounding whitespace is removed; commas cannot be part of an asset name.
|
|
182
182
|
|
|
183
183
|
- Blink and lip-sync animations accept one or more frames. A single frame remains static.
|
|
184
184
|
- Use two or more continue frames so the loop is visible.
|
|
@@ -202,7 +202,7 @@ show [Let's head for the sea!] with bubble style [hero-dialogue]
|
|
|
202
202
|
finish [CHARACTER] with condition [input == "pressed"] or timeout after [10] seconds
|
|
203
203
|
```
|
|
204
204
|
|
|
205
|
-
`DYNAMIC` recalculates the Bubble size and placement after each unit. `RESERVED` measures the final text first and reserves that layout while units appear. `set bubble reveal sound` plays a named Asset
|
|
205
|
+
`DYNAMIC` recalculates the Bubble size and placement after each unit. `RESERVED` measures the final text first and reserves that layout while units appear. `set bubble reveal sound` plays a named Asset Cache audio asset per unit, while `set bubble voice` plays full voice audio when the Bubble starts. Text display remains available without audio.
|
|
206
206
|
|
|
207
207
|
## 6. Show dialogue and wait for input
|
|
208
208
|
|
|
@@ -328,7 +328,7 @@ Saved projects using the former `say/think [MESSAGE] with bubble style [STYLE]`
|
|
|
328
328
|
|
|
329
329
|
| Symptom | Cause and solution |
|
|
330
330
|
| ------------------------------------ | ------------------------------------------------------------------------------- |
|
|
331
|
-
| Asset
|
|
331
|
+
| Asset Cache required error | Load Asset Cache 0.2.2 without sandbox before using image/media assets |
|
|
332
332
|
| SVG overlay backend error | Use a host with `renderer.addOverlay()` or explicitly select `scratch-render` |
|
|
333
333
|
| Async Input required error | Load Async Input 0.3.x without sandbox before using the Bubble wait |
|
|
334
334
|
| Runtime Expression required error | Load Runtime Expression 0.3.x without sandbox before using the Bubble wait |
|
|
@@ -353,7 +353,7 @@ Bubble automatically releases its owned timers, overlay DOM, and image leases in
|
|
|
353
353
|
- the whole project stops; or
|
|
354
354
|
- the TurboWarp runtime is disposed.
|
|
355
355
|
|
|
356
|
-
Assets registered with Asset
|
|
356
|
+
Assets registered with Asset Cache are not owned by Bubble. To remove an unused registered image from memory, close the Bubble first and then use Asset Cache's `delete asset [NAME] from memory` block.
|
|
357
357
|
|
|
358
358
|
## 14. Regenerating the manual assets
|
|
359
359
|
|