etui/anim
Types
pub type Easing {
Linear
EaseIn
EaseOut
EaseInOut
}
Constructors
-
Linear -
EaseIn -
EaseOut -
EaseInOut
Values
pub fn blink(frame: Int, period: Int) -> Bool
Returns True during the “on” half of each blink period.
period ≤ 0 means always on.
pub fn cycle(frame: Int, count: Int) -> Int
Cycle through [0, count) returning the current index for the given frame.
pub fn ease_in(
start: Int,
end_: Int,
frame: Int,
duration: Int,
) -> Int
EaseIn (slow start, fast end). Quadratic approximation.
pub fn ease_in_out(
start: Int,
end_: Int,
frame: Int,
duration: Int,
) -> Int
EaseInOut (slow start, fast middle, slow end). Quadratic approximation.
pub fn ease_out(
start: Int,
end_: Int,
frame: Int,
duration: Int,
) -> Int
EaseOut (fast start, slow end). Quadratic approximation with integers.
pub fn interpolate(
start: Int,
end_: Int,
frame: Int,
duration: Int,
easing: Easing,
) -> Int
Unified interpolation with selectable easing curve.
pub fn lerp(
start: Int,
end_: Int,
frame: Int,
duration: Int,
) -> Int
Linear interpolation from start to end_ over duration frames.
pub fn oscillate(
min: Int,
max: Int,
frame: Int,
period: Int,
) -> Int
Oscillate between min and max with a given period (in frames).
Returns current value in the triangle wave.