crossfade

Function
crossfade(
    s_out: State,
    s_in: State,
    at: float,
    dur: float,
    easing: Optional[Dict[str, Callable[[float], float]]] = None
) -> Tuple[List[KeyState], List[KeyState]]

Crossfade between two elements (one fading out, one fading in).

Returns two keystate lists for two separate VElements.

Parameters

s_out
State of the outgoing element (will fade to opacity 0)
s_in
State of the incoming element (will fade from opacity 0)
at
Start time of the crossfade
dur
Duration of the crossfade
easing
Optional easing dict for opacity transitions

Returns

Tuple of (out_keystates, in_keystates)

Examples

out_ks, in_ks = crossfade(circle1, circle2, at=0.3, dur=0.2)
    elem_out = VElement().segment(out_ks)
    elem_in = VElement().segment(in_ks)