setData method
void
setData({
- required TextureRegion textureRegion,
- double rotation = 0.0,
- double scale = 1.0,
- int? color,
- double opacity = 1.0,
Implementation
void setData(
{required TextureRegion textureRegion,
double rotation = 0.0,
double scale = 1.0,
int? color,
double opacity = 1.0}) {
this.textureRegion = textureRegion;
setTransformData(
rotation: rotation,
scale: scale,
anchorX: textureRegion.anchorX,
anchorY: textureRegion.anchorY);
this.color = color ?? ((opacity == 1.0) ? Colors.white : Colors.whiteWithOpacity(opacity));
}