src/reasings

Source   Edit  

reasings - raylib easings library, based on Robert Penner library

Useful easing functions for values animation

How to use: The four inputs t,b,c,d are defined as follows: t = current time (in any unit measure, but same unit as duration) b = starting value to interpolate c = the total change in value of b that needs to occur d = total time it should take to complete (duration)

Example:

import src/reasings
var currentTime = 0
let duration = 100
let startPositionX: float32 = 0.0
let finalPositionX: float32 = 30.0
var currentPositionX = startPositionX

while currentPositionX < finalPositionX:
  currentPositionX = linearIn(currentTime.float32, startPositionX,
      finalPositionX - startPositionX, duration.float32)
  inc currentTime

Procs

func backIn(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Back In Source   Edit  
func backInOut(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Back In Out Source   Edit  
func backOut(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Back Out Source   Edit  
func bounceIn(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Bounce In Source   Edit  
func bounceInOut(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Bounce In Out Source   Edit  
func bounceOut(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Bounce Out Source   Edit  
func circIn(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Circular In Source   Edit  
func circInOut(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Circular In Out Source   Edit  
func circOut(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Circular Out Source   Edit  
func cubicIn(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Cubic In Source   Edit  
func cubicInOut(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Cubic In Out Source   Edit  
func cubicOut(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Cubic Out Source   Edit  
func elasticIn(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Elastic In Source   Edit  
func elasticInOut(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Elastic In Out Source   Edit  
func elasticOut(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Elastic Out Source   Edit  
func expoIn(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Exponential In Source   Edit  
func expoInOut(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Exponential In Out Source   Edit  
func expoOut(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Exponential Out Source   Edit  
func linearIn(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Linear In Source   Edit  
func linearInOut(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Linear In Out Source   Edit  
func linearNone(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Linear Source   Edit  
func linearOut(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Linear Out Source   Edit  
func quadIn(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Quadratic In Source   Edit  
func quadInOut(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Quadratic In Out Source   Edit  
func quadOut(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Quadratic Out Source   Edit  
func sineIn(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Sine In Source   Edit  
func sineInOut(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Sine In Out Source   Edit  
func sineOut(t, b, c, d: float32): float32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Ease: Sine Out Source   Edit