TurboWarp-Bubble Block Manual

This manual explains how to use turbowarp-bubble 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.

Kamishibai DSL 4.0 bundle: In the combined runtime palette, click the documentation button directly below the Bubble member heading to open this manual. The bundled blocks keep the styles, placement, portrait, reveal, audio, wait, animation, clone, and cleanup behavior documented here; their member namespace and Bubble icon identify their origin.

A quick-start block sequence that registers Next1 and Next2 separately, prepares input listeners, then uses Bubble's integrated wait

1. Load the required extensions

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.17.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.

Order Extension URL
1 Temporary Variables Add from the TurboWarp extension library
2 Async Input 0.15.0 https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-async-input@0.15.0/dist/async-input.js
3 Runtime Expression 0.12.1 https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-runtime-expression@0.12.1/dist/runtime-expression.js
4 Asset Cache 0.10.1 https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-asset-cache@0.10.1/dist/asset-cache.js
5 Bubble 0.22.4 https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-bubble@0.22.4/dist/turbowarp-bubble.js

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.

See also:

2. Prepare portrait assets

The following example stores costumes in a hidden asset sprite named Assets.

Costume Asset Cache name Contents
HeroFace HeroFace Face, hair, and outline, excluding the animated eyes/mouth
HeroEyesOpen HeroEyesOpen Transparent overlay containing only the open eyes
HeroEyesClosed HeroEyesClosed Transparent overlay containing only the closed eyes
HeroMouthClosed HeroMouthClosed Transparent overlay containing only the closed mouth
HeroMouthOpen HeroMouthOpen Transparent overlay containing only the open mouth
Next1 Next1 First frame of the continue indicator
Next2 Next2 Second frame of the continue indicator

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.

Register each costume with Asset Cache:

register resource [costume:Assets:HeroFace] as asset [HeroFace]
register resource [costume:Assets:HeroEyesOpen] as asset [HeroEyesOpen]
register resource [costume:Assets:HeroEyesClosed] as asset [HeroEyesClosed]
register resource [costume:Assets:HeroMouthClosed] as asset [HeroMouthClosed]
register resource [costume:Assets:HeroMouthOpen] as asset [HeroMouthOpen]
register resource [costume:Assets:Next1] as asset [Next1]
register resource [costume:Assets:Next2] as asset [Next2]

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/*.

3. Select a text layout style

Standalone Bubble bundles the SVG Text 0.17.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.17.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.

define bubble style [hero-dialogue] using text style [default]

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.

4. Define a Bubble style

For a basic Bubble, use the short blocks directly. They select the built-in Bubble styles say and think, respectively:

say [Hello!]
think [Hmm…]

TurboWarp standard comparison

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.

TurboWarp standard say and think bubbles compared on the Stage with Bubble's basic profile

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.

TurboWarp standard say and think blocks compared with Bubble's no-setup basic say and think blocks and built-in default profile values

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.

The following setters intentionally switch the style to the custom profile:

define bubble style [hero-dialogue] using text style [default]
set bubble placement [up-right] for bubble style [hero-dialogue]
set bubble distance [12] for bubble style [hero-dialogue]
set bubble visual style [NORMAL] for bubble style [hero-dialogue]
set bubble tail length [18] for bubble style [hero-dialogue]
set bubble offset x [0] y [0] scale [100] % for bubble style [hero-dialogue]

Actor-relative and stage-relative placement

Actor-relative 16-way and angle placement compared with three stage-relative placements

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.

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.

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:

up / up-up-right / up-right / right-up-right
right / right-down-right / down-right / down-down-right
down / down-down-left / down-left / left-down-left
left / left-up-left / up-left / up-up-left

Compass aliases such as north, north-northeast, and northeast may also be typed directly or supplied by a reporter. A number uses Scratch direction semantics from 0 through 360 degrees: 0 is up, 90 right, 180 down, 270 left, and 360 normalizes to 0. Arbitrary angles are not rounded to the 16 menu directions. The default is up-right.

Stage-relative placements do not point at an actor and are positioned within the Stage safe area.

Placement Position
HEADER_LIKE Top of the Stage safe area, centered
CENTER Horizontal and vertical center of the Stage
FOOTER_LIKE Bottom of the Stage safe area, centered

These placements do not depend on actor coordinates, bounds, or visibility. Use one of them when running say or think from the Stage. A stage-relative Bubble has no actor-pointing tail.

Actor distance, tail, body offset, and scale

Real Bubble SVGs comparing distance, tail length, offset, and scale

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.

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 HEADER_LIKE, CENTER, or FOOTER_LIKE.

Width, automatic wrapping, and Japanese line-breaking rules

Automatic wrapping at different maxWidth values and Japanese line-breaking examples

The diagram is generated by running the production wrapText implementation. @cto.af/linebreak supplies Unicode UAX #14 break opportunities, which are filtered against Intl.Segmenter grapheme boundaries. The renderer then chooses the last candidate that fits the measured width. It avoids unnatural breaks before punctuation, closing brackets, small kana and prolonged sound marks, and inside a combined emoji grapheme.

Bubble visual styles

Ten Bubble visual styles rendered by the production SVG renderer

Available shapes are NORMAL, THINKING, DREAMING, YELLING, OFF_PANEL, WAVY, WHISPERING, ANNOUNCEMENT, NARRATION, and NO_BUBBLE.

set bubble visual style [YELLING] for bubble style [hero-dialogue]

The diagram and TurboWarp drawable both use Bubble's shared renderBubbleSvg function. Shapes with triangular tails use a platener/jsclipper union between the body and tail. THINKING and DREAMING use circular trails and are excluded from that union. Actor-relative placement points the tail toward the actor; stage-relative placement has no tail. NO_BUBBLE hides the body drawable and displays only text, portrait, and other layers.

The default visual style is NORMAL. The body drawable is created before text and portrait drawables so it remains behind them. close this bubble, target/clone disposal, and runtime disposal release the body drawable and its owned SVG skin.

NEGATIVE 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.

Now configure the portrait and continue animation layers:

set portrait base [HeroFace] for bubble style [hero-dialogue]
set portrait [top-left] offset x [-4] y [6] zoom [120] % corner radius [12] px for bubble style [hero-dialogue]

set blink frames [HeroEyesOpen,HeroEyesClosed]
  every [0.4] seconds for bubble style [hero-dialogue]

set lip-sync frames [HeroMouthClosed,HeroMouthOpen]
  every [0.1] seconds for bubble style [hero-dialogue]

set continue frames [Next1,Next2]
  every [0.2] seconds for bubble style [hero-dialogue]

ASSETS is a comma-separated list of Asset Cache names. Surrounding whitespace is removed; commas cannot be part of an asset name.

5. Sequential reveal, audio, and layout

Bubble can reveal a message as CHARACTER, WORD, LINE, or BLOCK units. WORD does not perform morphological analysis; it uses whitespace or the configured delimiter character set. Delimiters can remain visible or be hidden.

set bubble reveal unit [CHARACTER] every [0.05] seconds layout [RESERVED] for bubble style [hero-dialogue]
set bubble word delimiters [ /] show [false] for bubble style [hero-dialogue]
set bubble reveal sound [Typewriter] for bubble style [hero-dialogue]
set bubble voice [HeroVoice] for bubble style [hero-dialogue]
show [Let's head for the sea!] with bubble style [hero-dialogue]
finish [CHARACTER] with condition [input == "pressed"] or timeout after [10] seconds

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.

6. Show dialogue and wait for input

say and think show a Bubble immediately, continue to the next block, and begin in talking animation mode.

set runtime variable [input] to []
listen for key [Space] set runtime var [input] to [pressed]
listen for touch on this sprite set runtime var [input] to [pressed]
show [Let's head for the sea!] with bubble style [hero-dialogue]
wait with this bubble until condition [input == "pressed"] or timeout after [10] seconds
close this bubble

Initialize input 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 input == "pressed" to Runtime Expression immediately and once per VM frame. While waiting it automatically enters awaiting-continue, stops lip-sync, and loops the images configured by set continue frames. When the condition becomes true or the timeout expires, it enters idle and continues to close this bubble. Set the timeout to 0 to wait without a timeout.

Reset input to an empty string before each later wait; otherwise the previous pressed 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.

Use a named Bubble close policy when the same closing rule is reused. The trigger is explicit: condition, timeout, or condition-or-timeout. Applying a policy snapshots its definition, waits, runs the Bubble's hide animation, and releases the Bubble in one blocking command.

define bubble close policy [advance-or-timeout] trigger [condition-or-timeout] condition [input == "pressed"] timeout [10] seconds
show [Let's head for the sea!] with bubble style [hero-dialogue]
wait and close this bubble using close policy [advance-or-timeout]

A timeout-only policy leaves the current animation mode unchanged and needs no input extension. A policy containing a condition enters awaiting-continue and uses the same Async Input and Runtime Expression setup as the integrated wait. Redefining the same name during a pending wait affects only later applications. Bubble replacement or lifecycle cleanup cancels the pending policy and does not close the replacement Bubble.

When combining Bubble with audio or a separate text-reveal system, switch to awaiting-continue when that process completes.

A say Bubble lip-syncs, shows continue frames while awaiting continue, then closes after input

If animated GIF playback is unavailable, use this static animation-mode comparison:

Blink, lip-sync, and continue-frame states in talking, awaiting-continue, and idle modes

7. Bubble animation modes

Mode Blink Lip-sync Continue frames Typical use
talking Runs Runs Hidden Dialogue display or audio playback
awaiting-continue Runs Stops/hidden Loops Await the user's request to continue
idle Runs Stops/hidden Stops/hidden Keep a Bubble visible and still

set this bubble animation mode [MODE] changes only the Bubble owned by the calling sprite, clone, or Stage. It reports an error if that target has not first run say or think.

8. Show, in-display, and hide animations

Use fadeIn, floatIn, zoomIn, or riseUp when a Bubble starts displaying, and fadeOut, floatOut, zoomOut, or sink when it finishes displaying. These animations work with both DYNAMIC and RESERVED layout.

set bubble show animation [fadeIn] for [0.2] seconds for bubble style [hero-dialogue]
set bubble hide animation [fadeOut] for [0.2] seconds for bubble style [hero-dialogue]
animate this bubble [shake]
shake this bubble direction [90] count [2] ease [easeInOut]
explode this bubble relative scale [1.15] count [2] ease [easeOut]
animate bubble shape to [WAVY] speed [1] for [0.5] seconds

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.

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.

9. Showing a named Bubble style

show [MESSAGE] with bubble style [STYLE]

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.

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.

10. Using Bubble with clones

Bubble style definitions are shared within the extension, but each sprite or clone owns its currently displayed Bubble.

  1. Define assets and styles once from the original sprite when the green flag is clicked.
  2. Run say or think from each clone itself.
  3. Change the animation mode and close the Bubble from the same clone that displayed it.

When a clone stops or is deleted, its timers, overlay DOM, and image leases are released automatically. Explicit scratch-render mode also releases skins and drawables.

11. Block reference

Block Description
define bubble style [STYLE] using text style [TEXT_STYLE] Define or redefine a Bubble style
define bubble close policy [POLICY] trigger [TRIGGER] condition [CONDITION] timeout [TIMEOUT] seconds Define or replace a named closing condition
set bubble placement [PLACEMENT] for bubble style [STYLE] Set an actor direction/angle or a stage-relative region
set bubble distance [DISTANCE] for bubble style [STYLE] Set the distance from actor bounds to the tail tip
set bubble visual style [VISUAL_STYLE] for bubble style [STYLE] Select one of ten inseparable SVG body + tail/trail pairs
set bubble tail length [LENGTH] for bubble style [STYLE] Set the nominal border-to-tip tail length
set bubble offset x [X] y [Y] scale [SCALE] % for bubble style [STYLE] Set body position and whole-Bubble scale, including text
set portrait base [ASSET] for bubble style [STYLE] Set the portrait base image
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
set blink frames [ASSETS] every [SECONDS] seconds for bubble style [STYLE] Set blink overlays and interval
set lip-sync frames [ASSETS] every [SECONDS] seconds for bubble style [STYLE] Set lip-sync overlays and interval
set continue frames [ASSETS] every [SECONDS] seconds for bubble style [STYLE] Set the animation shown during awaiting-continue
set bubble reveal unit [UNIT] every [SECONDS] seconds layout [LAYOUT] for bubble style [STYLE] Configure CHARACTER/WORD/LINE/BLOCK sequential reveal
set bubble word delimiters [DELIMITERS] show [SHOW] for bubble style [STYLE] Configure WORD delimiters and visibility
set bubble reveal sound [ASSET] for bubble style [STYLE] Set the per-unit reveal sound
set bubble voice [ASSET] for bubble style [STYLE] Set full voice played when display starts
finish [UNIT] with condition [CONDITION] or timeout after [TIMEOUT] seconds Reveal remaining units and wait for condition or timeout
set bubble show animation [MOTION] for [SECONDS] seconds for bubble style [STYLE] Configure show animation
set bubble hide animation [MOTION] for [SECONDS] seconds for bubble style [STYLE] Configure hide animation
animate this bubble [MOTION] Play a whole-Bubble animation
shake this bubble direction [DIRECTION] count [COUNT] ease [EASE] Shake the complete Bubble surface
explode this bubble relative scale [SCALE] count [COUNT] ease [EASE] Apply relative scale cycles to the Bubble
animate bubble shape to [VISUAL_STYLE] speed [SPEED] for [SECONDS] seconds Transition the Bubble outline
say [MESSAGE] Show built-in style say: speech body and speech tail
think [MESSAGE] Show built-in style think: thought body and round trail
show [MESSAGE] with bubble style [STYLE] Show the complete body and tail/trail pair owned by a style
set this bubble animation mode [MODE] Select talking, awaiting-continue, or idle for this Bubble
wait with this bubble until condition [CONDITION] or timeout after [TIMEOUT] seconds Await a Runtime Expression condition or optional timeout
wait and close this bubble using close policy [POLICY] Snapshot a policy, wait for it, and close the Bubble
close this bubble Release this target's Bubble and owned resources
Bubble version Report the Bubble implementation version

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.

12. Troubleshooting

Symptom Cause and solution
Asset Cache required error Load Asset Cache 0.10.1 without sandbox before using image/media assets
SVG overlay backend error Use a host with renderer.addOverlay() or explicitly select scratch-render
Async Input required error Load Async Input 0.3.x without sandbox before using the Bubble wait
Runtime Expression required error Load Runtime Expression 0.3.x without sandbox before using the Bubble wait
bubble style is not defined Use the built-in short say/think blocks, or define the named custom style first
bubble close policy is not defined Define the named close policy before applying it
Image asset is not registered Wait for register resource ... as asset ... before showing the Bubble
Asset is not an image Confirm MIME type of asset [NAME] is image/*
Only one continue frame Supply at least two frames, or clear the setting
Frame interval error Use a finite SECONDS value greater than zero
Actor-relative Bubble from the Stage Use HEADER_LIKE, CENTER, or FOOTER_LIKE
Invalid placement Use a 16-way direction, alias, 0–360 degree angle, or stage-relative value
Eyes or mouth are misaligned Match canvas size, center, and transparent area across all portrait layers

13. Automatic cleanup

Bubble automatically releases its owned timers, overlay DOM, and image leases in the following cases. Explicit scratch-render mode also releases its text skins and renderer drawables.

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.

14. Regenerating the manual assets

The diagrams and GIF are generated from scripts in this repository. GIF generation requires the ImageMagick magick command.

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.

pnpm docs:render
pnpm docs:check

docs:check verifies SVG viewBoxes, production-renderer and wrapText markers, every visual style, the GIF dimensions/frame count/loop setting, references to all images and 16 blocks in both language manuals, and that the generated GitHub Pages HTML is current.

Bubble: complete block reference

All 33 blocks are documented below, including compatibility blocks and blocks available through optional features. Select a block to read its behavior, arguments, default values, and menu choices. Each block has a permanent link.

define bubble style [STYLE] using text style [TEXT_STYLE]

Defines or replaces a bubble style. The default text style without further settings uses the Scratch-compatible basic profile.

Block type: COMMAND. Opcode: defineBubbleStyle. Permanent link

Argument Type Default value Menu choices
STYLE STRING dialogue
TEXT_STYLE STRING default

Fixed input editor / 固定入力の編集

define bubble close policy [POLICY] trigger [TRIGGER] condition [CONDITION] timeout [TIMEOUT] seconds

Defines or replaces a named close policy. The trigger explicitly selects a condition, a timeout, or whichever happens first.

Block type: COMMAND. Opcode: defineBubbleClosePolicy. Permanent link

Argument Type Default value Menu choices
POLICY STRING advance-or-timeout
TRIGGER STRING condition-or-timeout
  • condition
  • timeout
  • condition-or-timeout
CONDITION STRING input == "pressed"
TIMEOUT NUMBER 10

set bubble placement [PLACEMENT] for bubble style [STYLE]

Sets an actor-relative direction/angle or a background-relative region. Direction aliases and Scratch-style degrees from 0 through 360 are accepted.

Block type: COMMAND. Opcode: setBubblePlacement. Permanent link

Argument Type Default value Menu choices
PLACEMENT STRING up-right
  • up
  • up-up-right
  • up-right
  • right-up-right
  • right
  • right-down-right
  • down-right
  • down-down-right
  • down
  • down-down-left
  • down-left
  • left-down-left
  • left
  • left-up-left
  • up-left
  • up-up-left
  • HEADER_LIKE
  • CENTER
  • FOOTER_LIKE
STYLE STRING dialogue

set portrait base [ASSET] for bubble style [STYLE]

Sets the registered image asset used as the portrait base. An empty asset removes the complete portrait.

Block type: COMMAND. Opcode: setPortraitBase. Permanent link

Argument Type Default value Menu choices
ASSET STRING HeroFace
STYLE STRING dialogue

Fixed input editor / 固定入力の編集

set portrait [PLACEMENT] offset x [X] y [Y] zoom [ZOOM] % corner radius [RADIUS] px for bubble style [STYLE]

Places the portrait at a bubble edge or corner with a local offset, zoom, and rounded corners. NONE removes the portrait.

Block type: COMMAND. Opcode: setPortraitLayout. Permanent link

Argument Type Default value Menu choices
PLACEMENT STRING left
  • none
  • left
  • right
  • top-left
  • top-right
  • bottom-left
  • bottom-right
X NUMBER 0
Y NUMBER 0
ZOOM NUMBER 100
RADIUS NUMBER 0
STYLE STRING dialogue

Fixed input editor / 固定入力の編集

set bubble distance [DISTANCE] for bubble style [STYLE]

Sets the distance from the actor bounds to the tail tip for actor-relative placement.

Block type: COMMAND. Opcode: setBubbleDistance. Permanent link

Argument Type Default value Menu choices
DISTANCE NUMBER 12
STYLE STRING dialogue

Fixed input editor / 固定入力の編集

set bubble visual style [VISUAL_STYLE] for bubble style [STYLE]

Sets the inseparable SVG body and tail or trail shape pair used by this bubble style.

Block type: COMMAND. Opcode: setBubbleVisualStyle. Permanent link

Argument Type Default value Menu choices
VISUAL_STYLE STRING NORMAL
  • NORMAL
  • THINKING
  • DREAMING
  • YELLING
  • OFF_PANEL
  • WAVY
  • WHISPERING
  • ANNOUNCEMENT
  • NARRATION
  • NO_BUBBLE
STYLE STRING dialogue

Fixed input editor / 固定入力の編集

set bubble tail length [LENGTH] for bubble style [STYLE]

Sets the nominal length from the bubble border to the tail tip for actor-relative placement.

Block type: COMMAND. Opcode: setBubbleTailLength. Permanent link

Argument Type Default value Menu choices
LENGTH NUMBER 18
STYLE STRING dialogue

Fixed input editor / 固定入力の編集

set bubble offset x [X] y [Y] scale [SCALE] % for bubble style [STYLE]

Offsets and scales the bubble body while keeping scale-only actor distance constant.

Block type: COMMAND. Opcode: setBubbleOffset. Permanent link

Argument Type Default value Menu choices
X NUMBER 0
Y NUMBER 0
SCALE NUMBER 100
STYLE STRING dialogue

Fixed input editor / 固定入力の編集

set blink frames [ASSETS] every [SECONDS] seconds for bubble style [STYLE]

Sets comma-separated registered image assets for the portrait blink layer. An empty list removes blink animation.

Block type: COMMAND. Opcode: setBlinkFrames. Permanent link

Argument Type Default value Menu choices
ASSETS STRING EyesOpen,EyesClosed
SECONDS NUMBER 0.4
STYLE STRING dialogue

Fixed input editor / 固定入力の編集

set lip-sync frames [ASSETS] every [SECONDS] seconds for bubble style [STYLE]

Sets comma-separated registered image assets for the portrait lip-sync layer. An empty list removes lip-sync animation.

Block type: COMMAND. Opcode: setLipSyncFrames. Permanent link

Argument Type Default value Menu choices
ASSETS STRING MouthClosed,MouthOpen
SECONDS NUMBER 0.1
STYLE STRING dialogue

Fixed input editor / 固定入力の編集

set continue frames [ASSETS] every [SECONDS] seconds for bubble style [STYLE]

Sets at least two comma-separated registered image assets for the awaiting-continue indicator. An empty list removes the indicator.

Block type: COMMAND. Opcode: setContinueFrames. Permanent link

Argument Type Default value Menu choices
ASSETS STRING Next1,Next2
SECONDS NUMBER 0.2
STYLE STRING dialogue

Fixed input editor / 固定入力の編集

set bubble reveal unit [UNIT] every [SECONDS] seconds layout [LAYOUT] for bubble style [STYLE]

Sets CHARACTER, WORD, LINE, or BLOCK sequential reveal. WORD uses the configured delimiters; DYNAMIC reflows as text grows and RESERVED reserves the final text size.

Block type: COMMAND. Opcode: setBubbleReveal. Permanent link

Argument Type Default value Menu choices
UNIT STRING CHARACTER
  • CHARACTER
  • WORD
  • LINE
  • BLOCK
SECONDS NUMBER 0.05
LAYOUT STRING DYNAMIC
  • DYNAMIC
  • RESERVED
STYLE STRING dialogue

Fixed input editor / 固定入力の編集

set bubble word delimiters [DELIMITERS] show [SHOW] for bubble style [STYLE]

Sets the character set used by WORD reveal and chooses whether delimiters remain visible.

Block type: COMMAND. Opcode: setBubbleWordDelimiters. Permanent link

Argument Type Default value Menu choices
DELIMITERS STRING /
SHOW STRING false
  • false
  • true
STYLE STRING dialogue

set bubble reveal sound [ASSET] for bubble style [STYLE]

Sets a named audio asset played once per CHARACTER, WORD, LINE, or BLOCK reveal.

Block type: COMMAND. Opcode: setBubbleRevealSound. Permanent link

Argument Type Default value Menu choices
ASSET STRING Typewriter
STYLE STRING dialogue

set bubble voice [ASSET] for bubble style [STYLE]

Sets the named full-voice audio asset played when the Bubble starts.

Block type: COMMAND. Opcode: setBubbleVoice. Permanent link

Argument Type Default value Menu choices
ASSET STRING Voice
STYLE STRING dialogue

Fixed input editor / 固定入力の編集

finish [UNIT] with condition [CONDITION] or timeout after [TIMEOUT] seconds

Reveals the remaining units and waits for the Runtime Expression condition or timeout before completing.

Block type: COMMAND. Opcode: finishBubbleReveal. Permanent link

Argument Type Default value Menu choices
UNIT STRING CHARACTER
  • CHARACTER
  • WORD
  • LINE
  • BLOCK
CONDITION STRING input == "pressed"
TIMEOUT NUMBER 10

Fixed input editor / 固定入力の編集

set bubble show animation [MOTION] for [SECONDS] seconds for bubble style [STYLE]

Selects the animation played when a Bubble starts displaying.

Block type: COMMAND. Opcode: setBubbleShowAnimation. Permanent link

Argument Type Default value Menu choices
MOTION STRING fadeIn
  • fadeIn
  • floatIn
  • zoomIn
  • riseUp
SECONDS NUMBER 0.2
STYLE STRING dialogue

Fixed input editor / 固定入力の編集

set bubble hide animation [MOTION] for [SECONDS] seconds for bubble style [STYLE]

Selects the animation played before a Bubble is closed. It works with both DYNAMIC and RESERVED layout.

Block type: COMMAND. Opcode: setBubbleHideAnimation. Permanent link

Argument Type Default value Menu choices
MOTION STRING fadeOut
  • fadeOut
  • floatOut
  • zoomOut
  • sink
SECONDS NUMBER 0.2
STYLE STRING dialogue

Fixed input editor / 固定入力の編集

animate this bubble [MOTION]

Plays an immediate display animation such as shake, explode, or a named show/hide motion.

Block type: COMMAND. Opcode: animateBubble. Permanent link

Argument Type Default value Menu choices
MOTION STRING shake
  • fadeIn
  • floatIn
  • zoomIn
  • riseUp
  • fadeOut
  • floatOut
  • zoomOut
  • sink
  • shake
  • explode
  • animateBubbleShape

Fixed input editor / 固定入力の編集

shake this bubble direction [DIRECTION] count [COUNT] ease [EASE]

Shakes the complete Bubble surface, including portrait and text, with an easing selection.

Block type: COMMAND. Opcode: shakeBubble. Permanent link

Argument Type Default value Menu choices
DIRECTION NUMBER 90
COUNT NUMBER 2
EASE STRING easeInOut
  • linear
  • easeIn
  • easeOut
  • easeInOut

Fixed input editor / 固定入力の編集

explode this bubble relative scale [SCALE] count [COUNT] ease [EASE]

Changes the complete Bubble surface size by a relative amount for the requested number of cycles.

Block type: COMMAND. Opcode: explodeBubble. Permanent link

Argument Type Default value Menu choices
SCALE NUMBER 1.15
COUNT NUMBER 2
EASE STRING easeOut
  • linear
  • easeIn
  • easeOut
  • easeInOut

Fixed input editor / 固定入力の編集

animate bubble shape to [VISUAL_STYLE] speed [SPEED] for [SECONDS] seconds

Transitions the Bubble outline to THINKING, DREAMING, YELLING, WAVY, WHISPERING, or another visual style.

Block type: COMMAND. Opcode: animateBubbleShape. Permanent link

Argument Type Default value Menu choices
VISUAL_STYLE STRING WAVY
  • NORMAL
  • THINKING
  • DREAMING
  • YELLING
  • OFF_PANEL
  • WAVY
  • WHISPERING
  • ANNOUNCEMENT
  • NARRATION
  • NO_BUBBLE
SPEED NUMBER 1
SECONDS NUMBER 0.5

say [MESSAGE]

Shows or replaces this sprite's Scratch-compatible default say bubble. An empty message closes it.

Block type: COMMAND. Opcode: say. Permanent link

Argument Type Default value Menu choices
MESSAGE STRING Hello!

think [MESSAGE]

Shows or replaces this sprite's Scratch-compatible default think bubble. An empty message closes it.

Block type: COMMAND. Opcode: think. Permanent link

Argument Type Default value Menu choices
MESSAGE STRING Hmm...

show [MESSAGE] with bubble style [STYLE]

Shows or replaces this sprite's Bubble. The selected style determines the complete body and tail or trail shape.

Block type: COMMAND. Opcode: showWithBubbleStyle. Permanent link

Argument Type Default value Menu choices
MESSAGE STRING Hello!
STYLE STRING say

say [MESSAGE] with bubble style [STYLE]

Shows or replaces this sprite's say bubble in talking animation mode. An empty message closes the basic profile.

Block type: COMMAND. Opcode: sayWithBubbleStyle. Permanent link

Compatibility block, hidden from the palette.

Argument Type Default value Menu choices
MESSAGE STRING Hello!
STYLE STRING dialogue

think [MESSAGE] with bubble style [STYLE]

Shows or replaces this sprite's think bubble in talking animation mode. An empty message closes the basic profile.

Block type: COMMAND. Opcode: thinkWithBubbleStyle. Permanent link

Compatibility block, hidden from the palette.

Argument Type Default value Menu choices
MESSAGE STRING Hmm...
STYLE STRING dialogue

Fixed input editor / 固定入力の編集

set this bubble animation mode [MODE]

Changes this sprite's bubble animation mode. Awaiting continue stops lip-sync animation and starts the configured continue frames.

Block type: COMMAND. Opcode: setBubbleAnimationMode. Permanent link

Argument Type Default value Menu choices
MODE STRING awaiting-continue
  • talking
  • awaiting-continue
  • idle

Fixed input editor / 固定入力の編集

wait with this bubble until condition [CONDITION] or timeout after [TIMEOUT] seconds

Switches to awaiting-continue mode, evaluates a Runtime Expression condition using variables updated by Async Input, and waits until the condition is true or the timeout expires. Zero disables the timeout.

Block type: COMMAND. Opcode: waitForBubbleContinue. Permanent link

Argument Type Default value Menu choices
CONDITION STRING input == "pressed"
TIMEOUT NUMBER 10

wait and close this bubble using close policy [POLICY]

Snapshots the named close policy, waits for its trigger, then closes this sprite's bubble and releases its resources.

Block type: COMMAND. Opcode: waitAndCloseBubbleWithPolicy. Permanent link

Argument Type Default value Menu choices
POLICY STRING advance-or-timeout

close this bubble

Closes this sprite's bubble and releases its timers and rendering resources.

Block type: COMMAND. Opcode: closeBubble. Permanent link

This block has no arguments.

Bubble version

Returns the Bubble implementation version.

Block type: REPORTER. Opcode: getVersion. Permanent link

This block has no arguments.

Repository guide and examples

固定入力の編集 / Fixed input editing

GUI起動時の blockEditorDialogs=1&blockEditorFixedInputs=1 が必要です(既定OFF)。標準literalだけを編集し、reporter・非対応fieldは評価せず保持します。旧GUIでは通常のブロック動作を維持します。

Static enum values are selected explicitly. New numeric edits must be finite JSON number tokens; unfinished buffers cannot be saved. Unchanged aliases, spaces and existing raw values are retained. Runtime style names, assets and expressions are not evaluated or resolved by this editor.

Block / 固定アンカー Arguments / UI
defineBubbleClosePolicy TRIGGER (enum), TIMEOUT (number)
setPortraitLayout PLACEMENT (enum), X (number), Y (number), ZOOM (number), RADIUS (number)
setBubbleDistance DISTANCE (number)
setBubbleVisualStyle VISUAL_STYLE (enum)
setBubbleTailLength LENGTH (number)
setBubbleOffset X (number), Y (number), SCALE (number)
setBlinkFrames SECONDS (number)
setLipSyncFrames SECONDS (number)
setContinueFrames SECONDS (number)
setBubbleReveal UNIT (enum), SECONDS (number), LAYOUT (enum)
setBubbleWordDelimiters SHOW (enum)
finishBubbleReveal UNIT (enum), TIMEOUT (number)
setBubbleShowAnimation MOTION (enum), SECONDS (number)
setBubbleHideAnimation MOTION (enum), SECONDS (number)
animateBubble MOTION (enum)
shakeBubble DIRECTION (number), COUNT (number), EASE (enum)
explodeBubble SCALE (number), COUNT (number), EASE (enum)
animateBubbleShape VISUAL_STYLE (enum), SPEED (number), SECONDS (number)
setBubbleAnimationMode MODE (enum)
waitForBubbleContinue TIMEOUT (number)

defineBubbleClosePolicy は TRIGGERがconditionならTIMEOUTを非表示にし、timeout系だけ正の有限値を検査します。CONDITIONは読取専用です。selector変更先がcondition系ならCONDITIONの非空literalを確認し、reporterは未評価としてselector変更を拒否します。selector未変更でcondition-or-timeoutならCONDITION reporterを保持しTIMEOUTだけ保存できます。

TIMEOUT draft20/保存値10で非表示→再表示なら20を復元し、無効bufferも保持・再検査します。非表示のまま保存成功ならprojectは10を維持し、dialog終了時に20を破棄します。SHOWはbooleanではなく文字列false/trueです。frame秒>0、reveal/motion/wait秒>=0、countは正整数です。未編集の数値は他項目編集時に新規検査しません。

同じdialog内の保存失敗ではdraftを保持します。保存成功・取消・dispose・project/target/登録失効で未保存draftを破棄し、再openは現在のrawから開始します。変更しないraw・reporter・sb3形式に移行は不要です。数値の新入力はblank・hex・非有限値を拒否し、既存rawの開閉にこの新入力規則を遡及しません。

Schemaの正本は schemas/block-editor-fixed-inputs.schema.json の $defs/<opcode>/properties/<argument> です。各bindingは正本fragmentを直接参照し、生成Schemaを別の正本として扱いません。local実装の検証を公開サイトのdeploy完了と同一視せず、公開後URL到達は配布工程で確認します。