Skip to content

Home > @esengine/ecs-framework-monorepo > Easing

Easing class

缓动函数集合

提供各种常用的缓动函数,用于创建平滑的动画效果 所有函数接受时间参数 t (0-1),返回缓动后的值 (通常0-1)

Signature:

typescript
export declare class Easing

Properties

Property

Modifiers

Type

Description

emphasize

static

readonly

typeof Easing.backOut

强调效果(吸引注意力)

natural

static

readonly

typeof Easing.quartOut

自然运动(模拟物理)

quickIn

static

readonly

typeof Easing.cubicOut

快速进入(常用于出现动画)

quickOut

static

readonly

typeof Easing.cubicIn

快速退出(常用于消失动画)

smoothIn

static

readonly

typeof Easing.quadOut

平滑进入(常用于UI动画)

smoothOut

static

readonly

typeof Easing.quadIn

平滑退出(常用于UI动画)

Methods

Method

Modifiers

Description

backIn(t, s)

static

回弹缓入

backInOut(t, s)

static

回弹缓入缓出

backOut(t, s)

static

回弹缓出

bounceIn(t)

static

跳跃缓入

bounceInOut(t)

static

跳跃缓入缓出

bounceOut(t)

static

跳跃缓出

circIn(t)

static

圆形缓入

circInOut(t)

static

圆形缓入缓出

circOut(t)

static

圆形缓出

combine(easingFunctions, weights)

static

创建自定义缓动函数(组合多个缓动)

cubicIn(t)

static

三次方缓入

cubicInOut(t)

static

三次方缓入缓出

cubicOut(t)

static

三次方缓出

elasticIn(t, amplitude, period)

static

弹性缓入

elasticInOut(t, amplitude, period)

static

弹性缓入缓出

elasticOut(t, amplitude, period)

static

弹性缓出

expoIn(t)

static

指数缓入

expoInOut(t)

static

指数缓入缓出

expoOut(t)

static

指数缓出

linear(t)

static

线性缓动(无缓动)

mirror(easing)

static

创建镜像缓动函数(先正向再反向)

piecewise(segments)

static

创建分段缓动函数

quadIn(t)

static

二次方缓入

quadInOut(t)

static

二次方缓入缓出

quadOut(t)

static

二次方缓出

quartIn(t)

static

四次方缓入

quartInOut(t)

static

四次方缓入缓出

quartOut(t)

static

四次方缓出

quintIn(t)

static

五次方缓入

quintInOut(t)

static

五次方缓入缓出

quintOut(t)

static

五次方缓出

reverse(easing)

static

创建反向缓动函数

sineIn(t)

static

正弦缓入

sineInOut(t)

static

正弦缓入缓出

sineOut(t)

static

正弦缓出

基于 MIT 许可证发布