#include <Sprite.hpp>
Inheritance diagram for sfSprite:
Public Member Functions | |
sfSprite (const sfImage *Img=NULL, const sfColor &Col=sfColor::White, float X=0.f, float Y=0.f, float Rot=0.f, float Sc=1.f) | |
float | GetWidth () const |
float | GetHeight () const |
Public Attributes | |
const sfImage * | Image |
Image used to draw the sprite. | |
sfColor | Color |
Color of the sprite (modulated with image -- contains transparency chanel). | |
float | Left |
Left position of sprite on screen (can be outside it). | |
float | Top |
Top position of sprite on screen (can be outside it). | |
float | Rotation |
Angle of rotation (in degrees). | |
float | Scale |
Scale of sprite (must be strictly positive). | |
sfIntRect | SubRect |
Sub-rectangle of source image to assign to the sprite. | |
Protected Member Functions | |
virtual void | Render (sfRenderWindow &Window) |
Definition at line 42 of file Sprite.hpp.
sfSprite::sfSprite | ( | const sfImage * | Img = NULL , |
|
const sfColor & | Col = sfColor::White , |
|||
float | X = 0.f , |
|||
float | Y = 0.f , |
|||
float | Rot = 0.f , |
|||
float | Sc = 1.f | |||
) |
Construct the sprite from its parameters
Img | : Image of the sprite (NULL by default) | |
Col | : Color of the sprite (white by default) | |
X | : Left coordinate of the sprite (0 by default) | |
Y | : Top coordinate of the sprite (0 by default) | |
Rot | : Orientation of the sprite (in degrees) (0 by default) | |
Sc | : Scale of the sprite (1 by default) |
Definition at line 38 of file Sprite.cpp.
float sfSprite::GetWidth | ( | ) | const |
Get sprite width on screen
Definition at line 97 of file Sprite.cpp.
References sfRect< T >::GetWidth(), Scale, and SubRect.
Referenced by Render().
float sfSprite::GetHeight | ( | ) | const |
Get sprite height on screen
Definition at line 106 of file Sprite.cpp.
References sfRect< T >::GetHeight(), Scale, and SubRect.
Referenced by Render().
void sfSprite::Render | ( | sfRenderWindow & | Window | ) | [protected, virtual] |
/see sfDrawable::Render
Implements sfDrawable.
Reimplemented in sfAnimatedSprite.
Definition at line 54 of file Sprite.cpp.
References sfColor::Alpha, sfImage::Bind(), sfColor::Blue, sfRect< T >::Bottom, Color, GetHeight(), sfImage::GetHeight(), sfRect< T >::GetHeight(), sfImage::GetTexCoords(), GetWidth(), sfImage::GetWidth(), sfRect< T >::GetWidth(), sfColor::Green, Image, sfRect< T >::Left, Left, sfColor::Red, sfRect< T >::Right, Rotation, SubRect, sfRect< T >::Top, and Top.
Referenced by sfAnimatedSprite::Render().