getSprite method

Sprite getSprite()

Gets the current Sprite that should be shown.

In case it reaches the end: If loop is true, it will return the last sprite. Otherwise, it will go back to the first.

Implementation

Sprite getSprite() {
  return currentFrame.sprite;
}