#include #include "Sprite.h" Sprite::Sprite() { // Set initial clip to the whole image clipNo = 0; isVisible = true; } int Sprite::getX() { return x; } int Sprite::getY() { return y; } void Sprite::setX(int x) { this->x = x; } void Sprite::setY(int y) { this->y = y; } bool Sprite::visible() { return isVisible; } void Sprite::setImage(std::string path) { image = loadImage(path); clip[0].x = 0; clip[0].y = 0; clip[0].w = image->w; clip[0].h = image->h; } SDL_Rect* Sprite::getClip() { return &clip[clipNo]; } void Sprite::setClip(int clipNo, int x, int y, int w, int h) { clip[clipNo].x = x; clip[clipNo].y = y; clip[clipNo].w = w; clip[clipNo].h = h; }