Screen effects and special commands
On this page
Screen effect shaders
Among the kinds of @effect, radial-blur (rotational blur), zoom-blur, mosaic, ripple and shader use WebGL.
- Every frame, the picture of the target (the whole screen or a layer) is copied, run through the shader, and shown on top.
- Only position, size, opacity, CSS filters and sprite flipping are copied; transforms such as rotation aren’t.
- If you apply two to the same target, only the later one is visible.
shader takes a fragment shader from the project (GLSL ES 1.0; a path from the others folder). The shader receives the following (declarations are added if you haven’t written them).
| uniform / varying | Contents |
|---|---|
u_texture | The copied picture |
v_uv | 0 to 1. The bottom left is 0 |
u_resolution | Size (px) |
u_time | Seconds, multiplied by speed |
u_strength | The value of strength= |
u_center | The values of x= y= (0 to 1) |
Values written as values="glow=0.5 tint=0.2" are received with uniform float glow; and so on.
Fading filters and screen effects, and limiting them to an area
@filter and @filter-off fade over the time in time=, and @effect and @effect-off over the time in fade= (@filter moves from the previous filter; @effect raises its strength from 0, or lowers it to 0).
By default the script continues without waiting; write wait=true to wait until it finishes. While skipping, it takes no time. The state (save, rewind, load) is how things look after the fade.
mask="radial x y width height" (with a soft edge, "radial x y width height soft"; all in px) applies it only inside the ellipse. radial-out applies it outside the ellipse.
@filter grayscale=100 mask="radial-out 640 360 520 400 80" time=600ms
@effect mosaic strength=24 mask="radial 900 300 240 240" fade=300ms
@effect-off mosaic fade=300ms
- A
@filterwith a mask applies, inside the area, to the background forbase, the background and sprites forfg0, and everything up to the foreground forfg1,fg2andall(it filters what’s behind it). - The mask of
@effectworks for the overlay kinds (noise,vignette,scanlines) and the WebGL kinds.wave,glitchandchromaticcan’t be limited and apply to everything. - A
@filterwith a mask uses CSS that filters what’s behind it (backdrop-filter). Browsers without it (Firefox up to 102) don’t show it and report it in the developer tools (a@filterwithout a mask still shows). - The syntax check reports a
mask=it can’t read (bad-effect-mask). It also warns aboutmask=onwave,glitchandchromatic(effect-mask-ignored).
HUD buttons and text (@hud-button, @hud-text)
Buttons and text that stay on screen while playing. Both are placed by name; writing the same name again replaces it, and @hud-button-off and @hud-text-off remove them (all of them if the name is omitted).
They’re kept in saves and show up the same after load, rewind and skipping. They’re hidden while the player hides the message window (“Hide”; @window hide doesn’t hide them).
They sit above the message window and below the blackout, so they darken with the @mask and @scene-change blackouts, and they’re hidden (and can’t be pressed) while the screen is fully blacked out, during chapter cards (@chapter-card, @chapter-end) and during full-screen movies.
@set game.day = 1
@hud-text day text="Day {= game.day}" x=40 y=24 size=28
@hud-button memo image=ui/memo.png hover=ui/memo_on.png x=1180 y=20 call=#memo key=m show-if=(game.has_memo)
{= expression}in@hud-textis redrawn whenever a variable changes.- Pressing a
@hud-buttoncalls thecall=scene. The scene returns at@returnor the next label, and the page being read is shown again (the backlog andtemp.variables from before the call carry over as they are). It can be pressed while a page waits for a click and while choices are shown. Pressed during choices, the choices are shown again when the scene returns (a timed choice starts its timer over). - It can also be pressed with a keyboard or a gamepad. While playing, up and down on the arrow keys and the D-pad select a HUD button, and the key that advances the text (Enter and so on) or A on a gamepad presses it. Esc or B on a gamepad stops selecting. Left and right on the D-pad still quick save and quick load while nothing is selected. If the game or the player has assigned the arrow keys to other actions, the arrow keys do those instead.
- With
key=, that key presses it (key=m; upper and lower case letters are treated the same, and key names such asF1work too). It works while playing and while choices are shown, and comes before the default keys of other actions (withkey=m, m presses this button instead of muting). Buttons with a key are also listed on the Controls screen. show-if=(expression)is the condition for showing it. It’s hidden while false and checked again whenever a variable changes.- The text of
@hud-textand of text-only buttons gets larger with the player’s text size setting (not in games whereui.screen.textScaleismessage). text=of@hud-textandlabel=of@hud-buttonwritten as literal text are shown again in the new language when the language changes.- The project’s CSS can restyle
.lim-hud-buttonand.lim-hud-text(the name is indata-hud). - TyranoScript’s
[button fix=true]is imported as@hud-button, and[clearfix]as@hud-button-off. - If no
@hud-textor@hud-buttonshows the name given to@hud-text-offor@hud-button-off, the syntax check warns (hide-name-unknown; the same for@cutin-hide).
Manga symbols and manga-style effects (@emote, @speedlines, @burst, hit stop, a camera that goes and comes back)
@emote character kind attaches a manga symbol to a sprite on screen (sweat, anger, surprise, question, heart, sparkle, music, or image for the project’s own image=).
at= is head (above the head), head-left, head-right (beside the head; left and right as seen on screen) or face; if omitted, the usual place for the kind. The head is found from the sprite’s picture
(the same measurement as aligning head sizes). Offsets are x= and y=, and the size is size=.
@chara Akari surprised
@emote Akari sweat
Akari "Huh..."
@emote-off Akari
- The symbol moves with the sprite (moving, swaying,
@anim), stays when the expression changes, and goes away when the sprite is hidden (it doesn’t come back when the sprite is shown again). It’s part of the sprite’s state, so saves, load, rewind and skipping show the same. - With
time=, it shows for that long and disappears as a one-shot effect (not kept in the state).
One-shot manga-style effects (not kept in the state; a click fast-forwards them, and they don’t show while skipping):
| Written as | What it does |
|---|---|
@speedlines focus x=640 y=300 | Focus lines (converging on the center). flow dir=left streams speed lines one way. Amount is density, color is color, length is time |
@burst text=BAM! | Pops up a jagged impact burst and fades it out, optionally with a sound effect. Position is x and y, size is size |
@flash white hitstop=120ms zoom=1.03 | Once a frame is shown, freezes motion on screen (sprite sway, animations, screen effects) for a moment (hit stop), zooms in, then comes back. Flashing more than 3 times a second can cause seizures, so the syntax check warns (flash-rate) |
@camera zoom=1.2 yoyo=true time=600ms | Moves to the given view in half the time and back to the previous view in the rest. The camera’s state doesn’t change |
Cut-ins that stay (@cutin stay=true)
@cutin is a one-shot effect that slides in a framed image, holds it, and pulls it out. With stay=true it stays after sliding in, and @cutin-hide pulls it out.
It’s kept in saves and shows up in the same place after load, rewind and skipping. With a name (name=), showing another one with the same name replaces it, and @cutin-hide name pulls out only that one.
@cutin props/key.png stay=true name=key max-width=520 max-height=347 padding=18 from=none
……
@cutin-hide key
- The size is
widthandheight. Without them, the image is shrunk to fitmax-widthandmax-height(including the frame and padding), keeping its aspect ratio; without those too, it’s the image’s size. paddingis the space between the image and the frame (filled with the frame color). The project’s CSS can restyle the frame with.lim-cutin-frame--stay(the name is indata-cutin).- With
hide-window=true, the message window is hidden only while it slides in (with@cutin-hide, while it’s pulled out). - Like HUD items, cut-ins that stay go above the message window and below the blackout (
layer=hud). They’re hidden while the screen is fully blacked out and during chapter cards, and come back afterwards. To keep one above the blackout too, writelayer=overlay(one-shot@cutinhas always defaulted tooverlay).
HTML without JS (@html)
For displays that are hard to build by combining commands, such as cards, tables, status screens and buttons that jump when pressed, write HTML between @html and @end.
@html notice x=100 y=80 width=600 time=300ms wait=true
<div class="card">Day {= game.day}</div>
<button data-jump="town#market">To the market</button>
<button data-jump="#home">Go home</button>
@end
@html-hide notice time=300ms
Write parameters on the @html line just as for a command. From the next line up to the line with only @end, the content is kept as is without applying the line rules (same as @script).
Placing and removing
- It’s placed at
xy(px) on a foreground layer (layer=; defaultfg2). Ifwidthheightare omitted, it takes the size of its content. - An
@htmlwith the same name (the unnamed parameter) replaces the earlier one. @html-hide nameremoves it. If the name is omitted, everything placed with@htmlis removed.@free-imagealso removes it.
Embedding values
{= expression}is evaluated when shown and embedded as text that isn’t read as HTML. The expression and its syntax check are the same as{= expression}in text.- The evaluated HTML is kept in the save, so loading rebuilds the same display.
Buttons (data-jump)
- Write a jump target (
#label,file,file#label) indata-jump. The syntax check confirms that the target exists. - Only an
@htmlwithwait=truecan be pressed. It doesn’t move on until a button is pressed, then jumps there (like a choice; a save made while waiting resumes from this@html). data-jumpin an@htmlwithoutwait=trueis display only and can’t be pressed (warninghtml-jump-without-wait).- An
@htmlwithwait=truebut nodata-jumpelement only waits until it has been shown. - When running without a screen (route exploration, the all-routes test,
lim trace),data-jumpelements are offered as choices.
Images
- In
src, write an asset in the project’simagefolder (same as{img …}in text). The syntax check andlim buildcount it as an asset reference.
What you can write
- Tags:
divspanpbrhrstrongembiussmallrubyrtrpimgulollitabletheadtbodytrtdthh1toh4button - Attributes:
classstylesrcaltwidthheighttitledata-jump - Style it with the
styleattribute or with aclassfrom the project’s CSS.
What you can’t write (syntax check errors)
<script>,<style>,<iframe>,on…attributes,javascript:- External URLs (in
srcand inurl()instyle) {= expression}insrcanddata-jump(so that jump targets and assets can be checked in advance)- Badly nested or unclosed tags
JS isn’t allowed because it can’t be checked before running and can change the screen in ways that aren’t kept in the save (loading wouldn’t restore it).
Staff roll (@staff-roll)
Text that scrolls from bottom to top. Write the content between the @staff-roll line and the @end line, or point file= to a JSON file in the data folder (an array of strings written the same way as the content). With file=, @end isn’t needed.
@staff-roll time=90s bg=#000000
# Scenario
Yui
# Music
Ren
{img logo.png 120}
@end
@staff-roll file=credits time=90s
| Content line | Meaning |
|---|---|
# Heading | Heading (a role and so on) |
| Empty line | Adds space |
A line with only {img path} {img path height} | Image (image folder; height in px). The syntax check confirms that the asset exists |
| Anything else | Shown as is, for names and other text (to show # at the start of a line, write \#) |
- It finishes scrolling in
time(default 60s) and doesn’t move on until it finishes. A click skips to the end (not withskip=false). It isn’t shown while skipping. - Change the look with the project’s CSS (
.lim-staffroll.lim-staffroll-heading.lim-staffroll-line.lim-staffroll-gap.lim-staffroll-image). - It isn’t kept in the state. A
@staff-rollwith no content is a warning (staff-roll-empty). TyranoScript has no equivalent, solim backportreports it as something it can’t write back.
The end of a playthrough (@title-screen)
@title-screen ends the playthrough and returns to the title. With the kind of ending in ending=, the screen fades to black and shows the kind’s wording (BAD END for bad) and an end mark
(text=; the Japanese mark for “the end” if omitted, The End when playing in English), and waits for the player to press (click, tap, Enter, Esc, right-click or A on a gamepad) before returning to the title.
With a name for that ending only in title=, the name is shown large with the kind’s wording small above it. The kind and name also appear in the endings list in Extras and in the Studio flowchart.
@title-screen ending=bad
@title-screen ending=bad title="Silence"
@title-screen ending=other title="Passing Shower"
@title-screen ending=true text="Fin"
ending=is a kind, not wording. The wording on screen comes from the kind. Avoiding endings in recordings andlim playtest(--avoid-ending bad), counting inlim coverage,expect endingin script tests, achievements (endingsinextra.achievements) andendings()in expressions all go by the kind too, so changing or translating the wording doesn’t affect them.title=is translated text (the “command text” of translation files). Leave it out if the ending has no name.
| Kind | Default wording (Japanese and English) |
|---|---|
bad | BAD END |
normal | NORMAL END |
good | GOOD END |
true | TRUE END |
other | None (only the name in title= is shown; the catch-all for endings that fit no kind) |
- Add kinds with
endingKindsinliminalia.json("endingKinds": { "secret": "SECRET END" }; names start with a lowercase letter and use lowercase letters, digits,-and_). Listing a built-in kind gives it the project’s own wording ("bad": "Bad Ending"). The wording inendingKindsis translated as project settings text (multilingual, chapter 10). - The wording of built-in kinds can also be changed in the project’s text tables:
ending.kinds.badand so on inuiof a translation file (for languages other than Japanese and English,lim i18nlists them with the English source), andtextsof a plugin (plugins.md; this also changes the source language’s wording). For kinds written inendingKinds, theendingKindswording comes first. - An unknown kind is an error (
unknown-ending-kind; the suggested fix is the closest kind name).ending=trueis the kindtrue, not a boolean. - In projects with script format 2 or earlier, the earlier way of writing wording in
ending=(ending="BAD END",ending="Passing Shower") keeps working until it’s migrated, and the screen shows the wording as written. Wording that tells the kind (BAD END, GOOD END, TRUE END, NORMAL END and their variants) counts as that kind; other wording counts asotherwith the wording as its name. The syntax check warns (legacy-ending) with the current way of writing as the suggested fix, andlim migratemoves the whole project (“Script format versions” in chapter 10). - With
card=false, it returns right away without showing the name (as in earlier versions). To turn it off for the whole project, write"commandDefaults": { "title-screen": { "card": "false" } }. - During auto, it’s shown for 4 seconds and then moves on. It isn’t shown in automated checks (
lim shot,lim playtest). Recordings (lim shot --video) show it and then move on. - The look follows the theme’s colors and font (
titleBg,fgandaccentinui.system, and the text font), and the project’s CSS can override.lm-ending(.lm-ending-kind,.lm-ending-name,.lm-ending-rule,.lm-ending-mark). The kind is indata-kindof.lm-ending(to style a kind, use.lm-ending[data-kind="bad"]). To replace it entirely, use a plugin’sscreens.ending(plugins.md). - For the end of a chapter, use
@chapter-end(it keeps the blackout and moves on). To roll the credits at the end of the game, write@title-screenafter@staff-roll.
JS kept until it’s rewritten (@script)
The content between @script and @end, up to the line with only @end, is kept as is without applying the line rules. It’s a place to keep JS from [iscript] imported from TyranoScript (code that uses jQuery or TYRANO)
until you rewrite it as plugin commands, and its contents don’t run in any environment (test play, the exported game, or running without a screen).
- It can only be written in projects whose liminalia.json has
"allowScript": true. Otherwise it’s a syntax check error (script-not-allowed). Even then, the syntax check warns on each@scriptline that its contents don’t run (script-skipped). The same warning is given when the game passes it while running, and it moves on to the next line. - It doesn’t run because the exported game doesn’t allow
eval(the CSP’sscript-src 'self'), and because imported JS assumes TyranoScript’s internals (jQuery,TYRANO,mp), so it can’t run as is. - Make logic and effects specific to your game as plugin commands (
@liminalia/sdk). To build a display, use@html. Remove@scriptonce it’s rewritten. lim backportturns@scriptback into[iscript]…[endscript].