Sprite constructor

Sprite([SpriteTexture texture ])

Creates a new sprite from the provided texture.

var mySprite = new Sprite(myTexture)

Implementation

Sprite([this.texture]) : super(Size.zero) {
  if (texture != null) {
    size = texture.size;
    pivot = texture.pivot;
  } else {
    pivot = new Offset(0.5, 0.5);
  }
}