DFTextSprite class Null safety

文本精灵类

Inheritance

Constructors

DFTextSprite(String text, {double fontSize = 14, Color color = const Color(0xFFFFFFFF), Color background = const Color(0x00FFFFFF), DFSize size = const DFSize(80, 20)})
创建文本精灵

Properties

angle double
角度
read / write, inherited
background Color
背景颜色
read / write
children List<DFSprite>
子精灵
read / write, inherited
color Color
文字大小
read / write
fixed bool
固定到屏幕
read / write, inherited
fontSize double
文字大小
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
key String?
唯一标识
read / write, inherited
onUpdate ↔ (void Function?(double dt)?)
更新监听函数
read / write
parent DFSprite?
相对坐标
read / write, inherited
position DFPosition
坐标 左上角是0点
read / write, inherited
recyclable bool
是否回收
read / write, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
scale double
缩放比例
read / write, inherited
size DFSize
尺寸
read / write, inherited
text String
文本内容
read / write
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
setOnUpdate(dynamic onUpdate(double dt)) → void
设置更新函数
toString() String
A string representation of this object. [...]
inherited
update(double dt) → void
更新文本
override

Operators

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