MagicAnim

open class MagicAnim

A collection of functions to make smooth animations.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun arbitrarySmooth(x: Float, min: Float, max: Float): Float
Translates a value in a (min,max) range to a value in the same range with smooth ease in and ease out.
Link copied to clipboard
open fun cycle(x: Float, min: Float, max: Float): Float
Cycle within range Restricts a value to a cycling range, produces a seesaw.
Link copied to clipboard
open fun normalizeRange(x: Float, start: Float, end: Float): Float
Translates a value in a (start,end) range into a value in a (0,1) range.
Link copied to clipboard
open fun offsetToRange(x: Float, min: Float, max: Float): Float
Translates a value from a (0,1) range to a value in a (min,max) range.
Link copied to clipboard
open fun smooth(x: Float): Float
Translates a value in a (0,1) range to a value in the same range with smooth ease in and ease out.
Link copied to clipboard
open fun smoothNormalizeRange(x: Float, start: Float, end: Float): Float
Translates a value from a (start,end) range into a value in a (0,1) range with smooth ease in and ease out.
Link copied to clipboard
open fun smoothReturnNormalizeRange(x: Float, start: Float, end: Float): Float
Translates a value in a (start,end) range into a "back-and-forth" value in a (0,1) range with smooth ease in and ease out.
Link copied to clipboard
open fun smoothReturnToRange(x: Float, fromMin: Float, fromMax: Float, toMin: Float, toMax: Float): Float
Translates a value in a (fromMin,fromMax) range into a "back-and-forth" value in a (toMin,toMax) range with smooth ease in and ease out.
Link copied to clipboard
open fun smoothToRange(x: Float, fromMin: Float, fromMax: Float, toMin: Float, toMax: Float): Float
Translates a value from a (fromMin,fromMax) range into a value in a (toMin,toMax) range with smooth ease in and ease out.