Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BezierTween ¶
type BezierTween struct {
Start, StartHandle, EndHandle, End float64
}
BezierTween uses cubic Bézier curve equation for interpolation. For more info see https://en.wikipedia.org/wiki/B%C3%A9zier_curve, In case you are looking for visualization see https://www.desmos.com/calculator/d1ofwre0fr We are using only one dimensional curve as i do not consider to dimensions usefull for lib if you need to dimensions just use two Bezier-s
var ZB BezierTween
ZB is Zero Bezier Curve
func Bezier ¶
func Bezier(start, startHandle, endHandle, end float64) BezierTween
Bezier is Bezier constructor
func (BezierTween) Value ¶
func (b BezierTween) Value(t float64) float64
Value returns Value along the curve interpolated by t
type ConstantTween ¶
type ConstantTween float64
ConstantTween does nothing, its a placeholder with no overhead
var ZC ConstantTween
ZC is ConstantTween zero value
func (ConstantTween) Value ¶
func (p ConstantTween) Value(t float64) float64
Value implements Tween interface
type LinearTween ¶
type LinearTween struct {
Start, End float64
}
LinearTween supports linear interpolation
var ZL LinearTween
ZL is LinearTween zero value
func (LinearTween) Value ¶
func (l LinearTween) Value(t float64) float64
Value implements Tween interface
type RandomGenerator ¶
type RandomGenerator struct {
Min, Max float64
}
RandomGenerator generates random value between Min and Max
var ZR RandomGenerator
ZR is RandomGenerator zerovalue
func Random ¶
func Random(value, offset float64) RandomGenerator
Random is RandomGenerator constructor
func (RandomGenerator) Gen ¶
func (r RandomGenerator) Gen() float64
Gen implements Generator interface