For macro and module authors.
game.modules.get("dxcufgbs-scene-transitions").api, ready from the ready hook:
| Member | Does |
|---|---|
transitions |
[{id, label, icon, split, hold, group}]: the registered transitions. |
register(id, definition) |
Adds a transition. definition = {label, icon, split, hold?, group?, draw(ctx, frame)}, where frame = {phase: "out" | "in", p, raw, A, B, w, h, state, t} (t: ms since the transition started). A and B are canvases of the old and new scene (B only in "in"), p runs from 0 to 1 eased. split: true plays "out" while the new scene loads, then "in". split: false plays only "in" (A → B). hold: true (split only) keeps drawing the last "out" frame with t running while the new scene loads. group (classic, stairs, cinematic) picks the heading it's listed under; anything else is listed under "From other modules". |
resolve({from, to, explicit?}) |
{binding, source}: the binding a change from → to uses on this client (source is explicit, pair, enter or default). |
activate(scene, binding?) |
GM: activates a scene for everyone with this binding, without the dialog. Without a binding, everyone gets their bound transition. Pass {transition: "none"} for none. |
view(scene, binding?) |
Views a scene on this client with this binding (or the bound one). |
preview(binding, toScene?) |
Plays a binding over the current view on this client, into toScene's thumbnail (a scene or id), or into a recoloured copy of the view. |
sanitize(binding) |
Returns a clean binding. |
openManager(sceneId?) |
GM: opens the Transitions manager. |
A binding is {transition, duration, title, titleText, titleWhen, sound}: transition is a transition id, "none", or "" (inherit). duration is in milliseconds (200–10000). titleWhen is "before", "during" (default) or "after".
Hooks
dxcufgbsPreSceneTransition(context): returnfalseto cancel.context.bindingcan be changed.dxcufgbsSceneTransitionStart(context)anddxcufgbsSceneTransitionEnd(context).context = {binding, kind, from, to, source, stairway?}, wherekindis"scene","local"(a same-scene stairway) or"preview".
Flags (on scenes, written by the GM)
flags.dxcufgbs-scene-transitions.enter: the scene's "entering" binding.flags.dxcufgbs-scene-transitions.from.<sourceSceneId>: coming from that scene.flags.dxcufgbs-scene-transitions.stairways.<stairwayId>: a Stairways stairway end on this scene.
Adventures exported with these flags keep their transitions when imported (scene ids are kept).
This page mirrors the Scene Transitions wiki on GitHub.