Sprite constructor

Sprite(
  1. Pointer<SdlTexture> texture, {
  2. Rectangle<double>? srcrect,
})

Implementation

Sprite(this.texture, {this.srcrect}) {
  setAnchorPoint(Point(0.5, 0.5));
  if (texture != nullptr) {
    setContentSize(texture.getSize()!);
  }
  if (srcrect != null) {
    setContentSize(srcrect!.size);
  }
}