21 #include <SDL2/SDL_image.h>
43 uint8_t
color[4] = {0x00, 0x00, 0x00, 0xFF};
69 SlSprite(
const std::string&
name,
SlTexture* texture,
int x = 0,
int y = 0,
int width = 0,
int height = 0);
88 SlSprite*
centerInSprite(
const std::shared_ptr<SlSprite> otherSprite,
unsigned int destinationThis = 0,
unsigned int destinationOther = 0);
109 bool is_inside(
const int& x,
const int& y,
const unsigned int& dest = 0);
118 void render(SDL_Renderer* renderer);
122 void render(SDL_Renderer* renderer,
unsigned int i);
127 void setAngle(
double angle,
unsigned int i = 0);
131 void setColor(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha = 0xFF,
unsigned int i = 0);
141 void setDestination(
int x,
int y,
int w,
int h,
unsigned int i = 0);
176 std::string
name_ =
"unnamedSprite";
SlSprite * addDestination(int x, int y, uint32_t renderOptions=SL_RENDER_DEFAULT)
Definition: SlSprite.cc:83
std::string name_
Definition: SlSprite.h:176
void setDestinationDimension(int width, int height, unsigned int i=0)
Definition: SlSprite.cc:302
SlTexture class for creating SDL_Textures.
unsigned int size()
Definition: SlSprite.h:157
void destinationOrigin(int &x, int &y, unsigned int i=0)
Definition: SlSprite.cc:159
bool hasDestination()
Definition: SlSprite.cc:171
uint8_t color[4]
Definition: SlSprite.h:43
void destinationDimension(int &width, int &height, unsigned int i=0)
Definition: SlSprite.cc:148
SDL_Rect sourceRect_
Definition: SlSprite.h:180
void setDestination(const SDL_Rect &dstRect, unsigned int i=0)
Definition: SlSprite.cc:279
void clearDestinations()
Definition: SlSprite.cc:128
std::string textureName() const
Definition: SlSprite.h:160
SlSprite * centerInSprite(const std::shared_ptr< SlSprite > otherSprite, unsigned int destinationThis=0, unsigned int destinationOther=0)
Definition: SlSprite.cc:112
std::string name() const
Definition: SlTexture.h:84
void setDestinationOrigin(int x, int y, unsigned int i=0)
Definition: SlSprite.cc:313
double angle
Definition: SlSprite.h:49
Definition: SlSprite.h:59
SlSprite & operator=(const SlSprite &)=delete
SlSprite * addDefaultDestination()
Definition: SlSprite.cc:70
SlSprite()
Definition: SlSprite.cc:40
std::vector< SlRenderSettings > destinations_
Definition: SlSprite.h:186
Definition: SlSprite.h:32
void setAngle(double angle, unsigned int i=0)
Definition: SlSprite.cc:254
void render(SDL_Renderer *renderer)
Definition: SlSprite.cc:202
std::string name() const
Definition: SlSprite.h:115
SlSprite * centerAt(unsigned int x, unsigned int y, unsigned int destination=0)
Definition: SlSprite.cc:97
SDL_Rect destination(unsigned int i=0)
Definition: SlSprite.cc:136
void setRenderOptions(uint32_t renderOptions, unsigned int i=0)
Definition: SlSprite.cc:325
void moveDestinationOriginBy(int x, int y, unsigned int i=0)
Definition: SlSprite.cc:192
SDL_Rect destinationRect
Definition: SlSprite.h:36
void setColor(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha=0xFF, unsigned int i=0)
Definition: SlSprite.cc:264
Definition: SlTexture.h:27
bool is_inside(const int &x, const int &y, const unsigned int &dest=0)
Definition: SlSprite.cc:179
SlTexture * texture_
Definition: SlSprite.h:183
uint32_t renderOptions
Definition: SlSprite.h:46