easing2D

Function
easing2D(
    easing_x: Callable[[float], float],
    easing_y: Callable[[float], float]
) -> Callable[[float], Tuple[float, float]]

Create a 2D easing function with independent easing per dimension.

Returns an easing function that applies different easing functions to x and y, enabling independent control over horizontal and vertical motion timing.

Parameters

easing_x
Easing function for x dimension
easing_y
Easing function for y dimension

Returns

Callable that takes t (0.0-1.0) and returns (eased_tx, eased_ty)

Examples

from svan2d.transition.easing import in_quad, out_bounce, easing2D
    # Fast horizontal, bouncy vertical
    pos_easing = easing2D(in_quad, out_bounce)
    element = VElement(
    ...     keystates=[...],
    ...     attribute_easing={"pos": pos_easing}
    ... )