A sprite is an image that knows how to render itself to the screen at a given location, under a particular transformation.
You cannot create a Sprite object directly, but must create one of its derived classes, such as Image_sprite or Rectangle_sprite. You can find out any sprite's dimensions with the Sprite::dimensions() const member function. Specific derived classes of Sprite, such as Rectangle_sprite, may have more specific operations.
Definition at line 38 of file ge211_sprites.hxx.
Public Member Functions | |
virtual Dims< int > | dimensions () const =0 |
Returns the current dimensions of this Sprite. More... | |
|
pure virtual |
Returns the current dimensions of this Sprite.
When deriving from Sprite to implement your own kind of sprite (or when deriving from Multiplexed_sprite), you need to make sure that this returns the maximum dimensions that the sprite could render at. For animated sprites, it's usually best if all the frames have the same dimensions anyway.