DFAnimationSprite class

动画精灵

Inheritance

Constructors

DFAnimationSprite({int stepTime = 200, bool loop = true, Color color = const Color(0xFFFFFFFF), DFSize size = const DFSize(128, 128)})
创建动画精灵

Properties

angle double
角度
getter/setter pairinherited
bindSprites List<DFAnimationSprite>
绑定动画
getter/setter pair
children List<DFSprite>
子精灵
getter/setter pairinherited
color Color
颜色
getter/setter pair
currentAnimation String
当前动画类型
getter/setter pair
currentAnimationFlippedX bool
x轴镜像
getter/setter pair
currentIndex int
当前是的Index
getter/setter pair
fixed bool
固定到屏幕
getter/setter pairinherited
frameClock int
帧绘制时钟
getter/setter pair
frames Map<String, List<DFImageSprite>>
这个动画的全部帧
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isBind bool
被绑定状态
getter/setter pair
key String?
唯一标识
getter/setter pairinherited
loop bool
是否循环动画
getter/setter pair
onComplete ↔ (dynamic Function(DFAnimationSprite)?)
完成事件
getter/setter pair
parent DFSprite?
相对坐标
getter/setter pairinherited
position DFPosition
坐标 左上角是0点
getter/setter pairinherited
recyclable bool
是否回收
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scale double
缩放比例
getter/setter pairinherited
size DFSize
尺寸
getter/setter pairinherited
stepTime int
帧速率
getter/setter pair
visible bool
显示状态
getter/setter pairinherited

Methods

addChild(DFSprite sprite) → void
增加子精灵
inherited
addChildren(List<DFSprite> sprites) → void
增加精灵 增加进来精灵才能被绘制
inherited
bindChild(DFAnimationSprite sprite) → void
绑定动画同步子精灵
getCollisionShape() DFShape
碰撞形状
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
play(String animation, {int stepTime = 200, bool loop = true, dynamic onComplete}) → void
播放动画
removeBindChild(DFAnimationSprite sprite) → void
移除绑定精灵
removeChild(DFSprite sprite) → void
移除子精灵
inherited
render(Canvas canvas) → void
精灵渲染
override
toString() String
A string representation of this object.
inherited
update(double dt) → void
精灵更新
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

load(String json, {dynamic scale = 0.5, dynamic blendMode = BlendMode.srcOver}) Future<DFAnimationSprite>
将plist转换Json后读取精灵 { "frames": { "idle_00000.png": { "frame": "{{929,291},{76,110}}", "offset": "{-19,24}", "rotated": true } } }