regl-transition
a function to render a GL Transition with a regl context.
short example
const createREGLTransition = ;const transition = ;;
full example
(this is a full working example. see regl-transition-example
)
const GLTransitions = ;const createREGL = ;const createREGLTransition = ; const delay = 1;const duration = 15;const imgSrcs = "1.jpg" "2.jpg" "3.jpg" "4.jpg"; const loadImage = { const img = ; img ; imgonerror = reject; imgonabort = reject; imgsrc = src; }; const regl = ;const transitions = GLTransitions; PromiseallimgSrcs;
API
The library exports this createTransition
function:
ReglDrawCommand
where types are:
type Options = resizeMode?: "cover" | "contain" | "stretch";
and ReglDrawCommand is a function you can call with the "props":
type ReglDrawCommand = ({
from: ReglTexture,
to: ReglTexture,
progress: number,
...any transition parameters to override goes here...
}) => *