![]() |
nCine 2025.06.r503-ff15d8d
A cross-platform 2D game engine
|
Particle size affector. More...
#include <ParticleAffectors.h>
Classes | |
struct | SizeStep |
Public Member Functions | |
SizeAffector () | |
Constructs a size affector with a default base scale factor. | |
SizeAffector (float baseScale) | |
Constructs a size affector with a base scale factor as a reference. | |
SizeAffector (float baseScaleX, float baseScaleY) | |
Constructs a size affector with a horizontal and a vertical base scale factor as a reference. | |
SizeAffector (const Vector2f &baseScale) | |
Constructs a size affector with a vector base scale factor as a reference. | |
SizeAffector (SizeAffector &&)=default | |
Default move constructor. | |
SizeAffector & | operator= (SizeAffector &&)=default |
Default move assignment operator. | |
SizeAffector | clone () const |
Returns a copy of this object. | |
void | affect (Particle *particle, float normalizedAge) override |
Affects the size of the specified particle. | |
void | addSizeStep (float age, float scale) |
void | addSizeStep (float age, float scaleX, float scaleY) |
void | addSizeStep (float age, const Vector2f &scale) |
void | addSizeStep (const SizeStep &step) |
unsigned int | numSteps () const override |
Returns the number of steps. | |
void | removeStep (unsigned int index) override |
Removes the step at the specified position index. | |
void | clearSteps () override |
Removes all steps. | |
nctl::Array< SizeStep > & | steps () |
const nctl::Array< SizeStep > & | steps () const |
float | baseScaleX () const |
void | setBaseScaleX (float baseScaleX) |
float | baseScaleY () const |
void | setBaseScaleY (float baseScaleY) |
const Vector2f & | baseScale () const |
Returns the base scale factor that will be multiplied by all steps. | |
void | setBaseScale (float baseScale) |
Sets a base scale factor that will be multiplied by all steps. | |
void | setBaseScale (const Vector2f &baseScale) |
Sets a base scale factor with a Vector2f , that will be multiplied by all steps. | |
![]() | |
ParticleAffector (Type type) | |
void | affect (Particle *particle) |
Affects a property of the specified particle. | |
Type | type () const |
Returns the affector type. | |
bool | isEnabled () const |
Returns true if the affector is enabled. | |
void | setEnabled (bool enabled) |
Enables or disables the affector. | |
Protected Member Functions | |
SizeAffector (const SizeAffector &other)=default | |
Protected default copy constructor used to clone objects. | |
![]() | |
ParticleAffector (const ParticleAffector &other)=default | |
Protected default copy constructor used to clone objects. | |
Additional Inherited Members | |
![]() | |
enum class | Type { COLOR , SIZE , ROTATION , POSITION , VELOCITY } |
![]() | |
Type | type_ |
Affector type. | |
bool | enabled_ |
A flag indicating whether the affector is enabled or not. | |
Particle size affector.
|
overridevirtual |
Affects the size of the specified particle.
Implements ncine::ParticleAffector.
|
inlineoverridevirtual |
Removes all steps.
Implements ncine::ParticleAffector.
|
inlineoverridevirtual |
Returns the number of steps.
Implements ncine::ParticleAffector.
|
overridevirtual |
Removes the step at the specified position index.
Implements ncine::ParticleAffector.