Gamedev Framework (gf)  0.11.0
A C++14 framework for 2D games
Public Member Functions | List of all members
gf::ShapeParticles Class Reference

A class to display a high number of small simple shapes. More...

#include <gf/Particles.h>

Inheritance diagram for gf::ShapeParticles:
Inheritance graph
[legend]

Public Member Functions

 ShapeParticles ()
 Default constructor. More...
 
void addCircle (Vector2f center, float radius, Color4f color, std::size_t pointCount=15)
 Add a circle shape to the particles. More...
 
void addCircle (const CircF &circ, Color4f color, std::size_t pointCount=15)
 Add a circle shape to the particles. More...
 
void addRectangle (Vector2f position, Vector2f size, Color4f color)
 Add a rectangle shape to the particles. More...
 
void addRectangle (const RectF &rect, Color4f color)
 Add a rectangle shape to the particles. More...
 
virtual void draw (RenderTarget &target, const RenderStates &states) override
 Draw the object to a render target. More...
 
- Public Member Functions inherited from gf::Transformable
 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...
 
- Public Member Functions inherited from gf::Drawable
virtual ~Drawable ()
 Virtual desctructor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from gf::Transformable
void setOriginFromAnchorAndBounds (Anchor anchor, const RectF &bounds)
 Set the origin from an anchor and bounds. More...
 

Detailed Description

A class to display a high number of small simple shapes.

Constructor & Destructor Documentation

◆ ShapeParticles()

gf::ShapeParticles::ShapeParticles ( )

Default constructor.

Member Function Documentation

◆ addCircle() [1/2]

void gf::ShapeParticles::addCircle ( Vector2f  center,
float  radius,
Color4f  color,
std::size_t  pointCount = 15 
)

Add a circle shape to the particles.

Parameters
centerThe center of the circle
radiusThe radius of the circle
colorThe color of the circle
pointCountThe number of points composing the circle

◆ addCircle() [2/2]

void gf::ShapeParticles::addCircle ( const CircF circ,
Color4f  color,
std::size_t  pointCount = 15 
)

Add a circle shape to the particles.

Parameters
circThe circle
colorThe color of the circle
pointCountThe number of points composing the circle

◆ addRectangle() [1/2]

void gf::ShapeParticles::addRectangle ( Vector2f  position,
Vector2f  size,
Color4f  color 
)

Add a rectangle shape to the particles.

Parameters
positionThe position of the top-left of the rectangle
sizeThe size of the rectangle
colorThe color of the rectangle

◆ addRectangle() [2/2]

void gf::ShapeParticles::addRectangle ( const RectF rect,
Color4f  color 
)

Add a rectangle shape to the particles.

Parameters
rectThe rectangle
colorThe color of the rectangle

◆ draw()

virtual void gf::ShapeParticles::draw ( RenderTarget target,
const RenderStates states 
)
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.

Parameters
targetRender target to draw to
statesCurrent render states

Implements gf::Drawable.