Lantern Depths: Find the Shade Dash, Slay the Thorn Knight
README.md
screenWipes
A full-screen transition overlay for moving between rooms, levels or scenes. One call covers this player's screen, holds it a moment and uncovers it again, and returns the seconds until the screen is fully covered, so you can move the camera while nobody can see it jump. The overlay sizes itself from the screen when it plays (phone screens included), a second play restarts it cleanly, and it removes itself when done: you never tick it.
Every style also comes as a small box for menus and galleries: W.swatch loops the animation inside a box of the size you ask, and W.preview shows it frozen at full cover.
Install
In the engine shell: zero zeromind installAsset f058415f-2175-4f76-b13d-69ec820b5def (or search ZeroMind for screenWipes). It has no dependencies.
Example
local W = require("screenWipes.api")
local t = W.play("iris", { dir = "right" })
task.delay(t, function() moveCameraToNextRoom() end)
The five styles
| style | tags | what it does |
|---|---|---|
fade | classic, soft | the screen fades to a flat colour and back |
iris | cartoon, retro | a round hole closes in on the centre, then opens again (cut by fine horizontal shutters, so it stays crisp at any size) |
wipe | sci-fi, directional | a dark panel with glowing cyan edges slides across toward dir and leaves on the far side |
pixelate | pixel, 8-bit | a grid of blocks pops in and out in a scattered order, in hard steps |
blinds | minimal, stylish | rows (up/down) or columns (left/right) of light slats sweep shut toward dir, then open |
W.LIST lists them in this order and W.TAGS[style] gives the tags.
API
W.play(style, opts?) -> numberplays once on this peer and returns the seconds to full cover.opts = { dir = "left"|"right"|"up"|"down", cover = seconds, hold = seconds, color = "#rrggbb" }, defaultsright,0.22,0.1and a colour per style.W.coverTime(opts?)seconds to full cover;W.duration(opts?)the whole run (cover twice plus hold).W.swatch(style, { width, height, dir?, color?, cover?, hold?, pause?, backdrop? })a looping box node (default 160x90; cover 0.5, hold 0.3, pause 0.7; a painted backdrop so the motion reads,backdrop = falsefor none or a CSS gradient string of your own).W.preview(style, opts?)the same box frozen at full cover.W.tree(style, opts?)the full-screen treeW.playregisters;W.stop()removes a playing overlay at once;W.current()its UI screen name or nil.
Every piece reaches full cover inside the cover time (staggered blinds and pixel blocks too), so the screen really is covered at W.coverTime().
Why the iris is built from shutters: this UI renderer loses the roundness of large corner radii, rasterises gradients coarsely and draws a box-shadow hole square, so a single big ring cannot give a crisp circle on a full screen. Each row instead has a left and a right panel keyframed to the circle's chord at that height.
Why not the published fader
ZeroMind has fader.module in the world Amelia (fa062142-e336-4d34-8ddb-0b1b44747594). It was read before this was written and did not fit: it has two looks (black and a vignette iris) rather than five, it requires Amelia's own game.ui.theme module for its sizes and boxes, it drives one fixed screen from a task loop that re-registers the whole tree every frame, and it fades one way at a time rather than playing a cover, hold and uncover with a known cover time. screenWipes is extracted instead from the room transitions of a side-scroller HUD, which used CSS keyframes and needed no per-frame work.
Changelog
- 1.0.1: an Install section and the one-line install in the description. No code change.
- 1.0.0: first release, extracted from a side-scroller HUD's room transitions. Five styles; wipe and blinds follow all four directions; pieces are timed to be fully closed at the cover time; looping swatches and frozen previews for galleries.