anotherme-robot-animation
v0.1.5
Published
AnotherMe robot sprite animation React component.
Readme
anotherme-robot-animation
AnotherMe 机器人精灵动画 React 组件。
已内置 11 组动作的精灵图资源、帧坐标、尺寸与播放逻辑,安装后可直接使用(开箱即用)。
安装
npm i anotherme-robot-animation快速调用
import { AIRobotAnimation } from 'anotherme-robot-animation';
export default function Demo() {
return <AIRobotAnimation spriteKey="breathing" />;
}组件参数
spriteKey?: RobotSpriteKey
动画资源 key,默认breathingframeMs?: number
帧间隔(毫秒),默认200preload?: boolean
是否预加载当前动画图,默认false
各精灵图 key 与用途
breathing(1.静息呼吸):默认循环observe(2.观察模式):用户浏览信号列表时meditation(3.待机冥想):用户超过 30 秒未交互surprised(4.惊喜发现):用户点击 / 切换页面instruction(5.收到指令):刚收到用户文字提示词loading(6.加载中):后台加载过程中running(7.运行中):收到提示词后、结果返回前success(8.运行成功):运行结果返回后(成功)error(9.运行报错):运行结果返回后(报错)addSkill(10.添加技能):用户点击添加技能按钮removeSkill(11.减除技能):用户点击减除技能按钮
导出内容
AIRobotAnimationROBOT_ANIMATIONSgetRobotSpriteUrl(spriteKey)- 类型:
RobotSpriteKey、AIRobotAnimationProps
