texture property

SpriteTexture texture

The texture that the sprite will render to screen. Cannot be null.

my9Sprite.texture = myTexture;

Implementation

SpriteTexture get texture => _texture;
void texture=(SpriteTexture texture)

Implementation

set texture(SpriteTexture texture) {
  _texture = texture;
  _isDirty = true;
  Matrix4 matrix = Matrix4.identity();
  ImageShader shader = ImageShader(
      texture.image, TileMode.repeated, TileMode.repeated, matrix.storage);

  _cachedPaint = Paint()..shader = shader;
}