Class: Transition

(abstract) rune.transition.Transition(optionsopt)

Subclass render() in game code to draw from and to into the supplied Canvas. Progress ranges from zero to one. Images use internal screen pixels and must not be modified or retained. Transitions owns their lifetime. No pixel readback is required. Effects are initialized once and disposed when finished/cancelled.

Constructor

(abstract) new Transition(optionsopt)

Creates a reusable effect that combines two frozen screen images.
Parameters:
Name Type Attributes Description
options Object <optional>
Effect settings; duration defaults to 600 milliseconds.
Source:

Members

duration :number

Effect duration in milliseconds, excluding scene initialization. Configure before starting an effect; must be finite and greater than zero.
Type:
  • number
Default Value:
  • 600
Source:

Methods

render(canvas, from, to, progress) → {undefined}

Draws an effect frame. The target is cleared before each call.
Parameters:
Name Type Description
canvas rune.display.Canvas Output canvas.
from rune.display.Canvas Frozen previous image.
to rune.display.Canvas Frozen next image.
progress number Normalized progress from zero to one.
Source:
Returns:
Type
undefined