DFImageSprite class Null safety

图片精灵类

Inheritance

Constructors

DFImageSprite(Image image, {DFSize size = const DFSize(64, 64), required DFRect rect, DFOffset offset = const DFOffset(0, 0), Color color = const Color(0xFFFFFFFF), bool rotated = false, bool flippedX = false, BlendMode blendMode = BlendMode.srcOver})
创建图片精灵

Properties

angle double
角度
read / write, inherited
blendMode BlendMode
混合模式
read / write
children List<DFSprite>
子精灵
read / write, inherited
color Color
颜色
read / write
fixed bool
固定到屏幕
read / write, inherited
flippedX bool
x轴镜像
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
image Image
精灵图片
read / write
key String?
唯一标识
read / write, inherited
offset DFOffset
坐标偏移
read / write
parent DFSprite?
相对坐标
read / write, inherited
position DFPosition
坐标 左上角是0点
read / write, inherited
rect DFRect
截取图片区域
read / write
recyclable bool
是否回收
read / write, inherited
rotated bool
是否旋转
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
scale double
缩放比例
read / write, inherited
size DFSize
尺寸
read / write, inherited
visible bool
显示状态
read / write, inherited

Methods

addChild(DFSprite sprite) → void
增加子精灵
inherited
addChildren(List<DFSprite> sprites) → void
增加精灵 增加进来精灵才能被绘制
inherited
getCollisionShape() DFShape
碰撞形状
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
removeChild(DFSprite sprite) → void
移除子精灵
inherited
render(Canvas canvas) → void
精灵渲染 代码没几行,坐标计算有点复杂
override
toString() String
A string representation of this object. [...]
inherited
update(double dt) → void
精灵更新
inherited

Operators

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

Static Methods

load(String src) Future<DFImageSprite>
加载图片资源