Struct AnimationHelper

Helper to handle animation progress

struct AnimationHelper;

Properties

NameTypeDescription
elapsed[get] longreturns time elapsed since start
finished[get] boolReturns true if animation is finished
interval[get] longget current time interval
interval[set] longoverride current time interval, retaining the same progress %
progress[get] intReturns animation progress in interval 0..maxProgress while timeElapsed is between 0 and maxInterval; when interval exceeded, progress is maxProgress

Methods

NameDescription
animate (time) Adds elapsed time; returns animation progress in interval 0..maxProgress while timeElapsed is between 0 and maxInterval; when interval exceeded, progress is maxProgress
getProgress (maxProgress) Returns animation progress in interval 0..maxProgress while timeElapsed is between 0 and maxInterval; when interval exceeded, progress is maxProgress
restart () restart with same max interval and progress
start (maxInterval, maxProgress) start new animation interval