![]() |
Gamedev Framework (gf) 1.2.0
A C++17 framework for 2D games
|
A class to display a high number of sprites. More...
#include <gf/Particles.h>
Public Member Functions | |
SpriteParticles () | |
Default constructor. More... | |
SpriteParticles (const Texture &texture) | |
Constructor with a texture. More... | |
void | setTexture (const Texture &texture) |
Change the source texture. More... | |
void | addSprite (Vector2f position, const RectF &textureRect, Color4f color=Color::White) |
Add a sprite to the particles. More... | |
virtual void | draw (RenderTarget &target, const RenderStates &states) override |
Draw the object to a render target. More... | |
![]() | |
Transformable () | |
Default constructor. More... | |
void | setOrigin (Vector2f origin) |
Set the local origin of the object. More... | |
Vector2f | getOrigin () const |
Get the local origin of the object. More... | |
void | setPosition (Vector2f position) |
Set the position of the object. More... | |
Vector2f | getPosition () const |
Get the position of the object. More... | |
void | move (Vector2f offset) |
Move the object by a given offset. More... | |
void | setRotation (float angle) |
Set the orientation of the object. More... | |
float | getRotation () const |
Get the orientation of the object. More... | |
void | rotate (float angle) |
Rotate the object. More... | |
void | setScale (Vector2f factors) |
Set the scale factors of the object. More... | |
void | setScale (float factor) |
Set the scale factor of the object. More... | |
Vector2f | getScale () const |
Get the current scale of the object. More... | |
void | scale (Vector2f factors) |
Scale the object. More... | |
void | scale (float factor) |
Scale the object. More... | |
Matrix3f | getTransform () const |
Get the combined transform of the object. More... | |
Matrix3f | getInverseTransform () const |
Get the inverse of the combined transform of the object. More... | |
![]() | |
virtual | ~Drawable () |
Virtual desctructor. More... | |
virtual void | draw (RenderTarget &target, const RenderStates &states)=0 |
Draw the object to a render target. More... | |
Additional Inherited Members | |
![]() | |
void | setOriginFromAnchorAndBounds (Anchor anchor, const RectF &bounds) |
Set the origin from an anchor and bounds. More... | |
A class to display a high number of sprites.
gf::SpriteParticles::SpriteParticles | ( | ) |
Default constructor.
gf::SpriteParticles::SpriteParticles | ( | const Texture & | texture | ) |
Constructor with a texture.
texture | The source texture |
void gf::SpriteParticles::addSprite | ( | Vector2f | position, |
const RectF & | textureRect, | ||
Color4f | color = Color::White |
||
) |
Add a sprite to the particles.
position | The position of the center of the sprite |
textureRect | The sub-rectangle of the texture to assign to the sprite |
color | The color of the sprite |
|
overridevirtual |
Draw the object to a render target.
This is a pure virtual function that has to be implemented by the derived class to define how the drawable should be drawn.
target | Render target to draw to |
states | Current render states |
Implements gf::Drawable.
void gf::SpriteParticles::setTexture | ( | const Texture & | texture | ) |
Change the source texture.
texture | The new texture |