module Scar::Easing

Overview

This module contains basic easing definitions like EaseInOut

Defined in:

scar/tween.cr

Macro Summary

Macro Detail

macro simple_easing_function(name, fn) #

Creates a struct inheriting EasingDefinition with the given name and #calc method

Example usage (defining quadratic ease-in):

simple_easing_function(:EaseInQuad, "lf ** 2")

# This becomes:
struct EaseInQuad < EasingDefinition
  def calc(lf : Float32) : Float32
    lf ** 2
  end
end

[View source]