IN THIS ARTICLE
UIParticleEmitterComponent
UIParticleEmitterComponent
Controls the emission of two dimensional particles. The source code location is \dev\Gems\LyShine\Code\Source\UiParticleEmitterComponent.*
.
UiParticleEmitterBus
Services messages for the UiParticleEmitterComponent
.
GetIsEmitting
Returns whether the emitter is currently emitting.
Syntax
bool GetIsEmittingColor()
SetIsEmitting
Sets whether the emitter is currently emitting.
Syntax
void SetIsEmitting(bool isEmitting)
GetIsRandomSeedFixed
Returns whether the emitter uses a fixed random seed.
Syntax
bool GetIsRandomSeedFixed()
SetIsRandomSeedFixed
Sets whether the emitter uses a fixed random seed.
Syntax
void SetRandomSeed(bool randomSeedFixed)
GetRandomSeed
Returns the current random seed.
Syntax
int GetRandomSeed()
SetRandomSeed
Sets the random seed used by the emitter.
Syntax
void SetRandomSeed(int randomSeed)
GetIsParticlePositionRelativeToEmitter
Returns whether the emitted particles move relative to the emitter.
Syntax
bool GetIsParticlePositionRelativeToEmitter()
SetIsParticlePositionRelativeToEmitter
Sets whether the emitted particles move relative to the emitter.
Syntax
void SetIsParticlePositionRelativeToEmitter(bool relativeToEmitter)
GetParticleEmitRate
Returns, in particles per second, the current particle emitter emit rate.
Syntax
float GetParticleEmitRate()
SetParticleEmitRate
Sets, in particles per second, the current particle emitter emit rate.
Syntax
void SetParticleEmitRate(float particleEmitRate)
GetIsEmitOnActivate
Returns whether the particle emitter starts emitting when the component is activated.
Syntax
bool GetIsEmitOnActivate()
SetIsEmitOnActivate
Sets whether the particle emitter starts emitting when the component is activated.
Syntax
void SetIsEmitOnActivate(bool emitOnActivate)
GetIsHitParticleCountOnActivate
Returns whether the average amount of particles are emitted and processed when the emitter starts emitting.
Syntax
bool GetIsHitParticleCountOnActivate()
SetIsHitParticleCountOnActivate
Sets whether the average amount of particles are emitted and processed when the emitter starts emitting.
Syntax
void SetIsHitParticleCountOnActivate(bool hitParticleCountOnActivate)
GetIsEmitterLifetimeInfinite
Returns whether the emitter lifetime is infinite.
Syntax
bool GetIsEmitterLifetimeInfinite()
SetIsEmitterLifetimeInfinite
Sets whether the emitter lifetime is infinite.
Syntax
void SetIsEmitterLifetimeInfinite(bool emitterLifetimeInfinite)
GetEmitterLifetime
Returns the total emitter lifetime in seconds. When the lifetime is reached, the emitter stops emitting.
Syntax
float GetEmitterLifetime()
SetEmitterLifetime
Sets the total emitter lifetime in seconds. When the lifetime is reached, the emitter stops emitting.
Syntax
void SetEmitterLifetime(float emitterLifetime)
GetIsParticleCountLimited
Returns whether there is a limit to the number of active particles.
Syntax
bool GetIsParticleCountLimited()
SetIsParticleCountLimited
Sets whether there is a limit to the number of active particles.
Syntax
void SetIsParticleCountLimited(bool particleCountLimited)
GetMaxParticles
Returns the numerical limit of active particles.
Syntax
AZ::u32 GetMaxParticles()
SetMaxParticles
Sets the numerical limit of active particles.
Syntax
void SetMaxParticles(AZ::u32 maxParticles)
GetEmitterShape
Returns the current emitter shape.
Syntax
eUiEmitShape GetEmitterShape()
Possible emitter shapes are as follows.
enum eUiEmitShape
{
eUiEmitShape_Point,
eUiEmitShape_Circle,
eUiEmitShape_Quad
};
SetEmitterShape
Sets the current emitter shape.
Syntax
void SetVariable(eUiEmitShape emitShape)
For possible emitter shapes, see GetEmitterShape
.
GetIsEmitOnEdge
Returns whether the particles are emitted on the edge of the selected shape.
Syntax
bool GetIsEmitOnEdge()
SetIsEmitOnEdge
Sets whether the particles are emitted on the edge of the selected shape.
Syntax
void SetIsEmitOnEdge(bool emitOnEdge)
GetInsideEmitDistance
Returns the distance that particles are emitted inside the emitter shape edge.
Syntax
float GetInsideEmitDistance()
SetInsideEmitDistance
Sets the distance that particles are emitted inside the emitter shape edge.
Syntax
void SetInsideEmitDistance(float insideEmitDistance)
GetOutsideEmitDistance
Returns the distance that particles are emitted outside the emitter shape edge.
Syntax
float GetOutsideEmitDistance()
SetOutsideEmitDistance
Sets the distance that particles are emitted outside the emitter shape edge.
Syntax
void SetOutsideEmitDistance(float outsideEmitDistance)
GetParticleInitialDirectionType
Returns how the initial direction of the emitted particles are calculated.
Syntax
eUiParticleInitialDirectionType GetParticleInitialDirectionType()
Possible values are as follows.
enum eUiParticleInitialDirectionType
{
eUiParticleInitialDirectionType_RelativeToEmitAngle,
eUiParticleInitialDirectionType_RelativeToEmitterCenter
};
SetParticleInitialDirectionType
Sets how the initial direction of the emitted particles is calculated.
Syntax
void SetVariable(eUiEmitShape emitShape)
For possible direction types, see GetParticleInitialDirectionType
.
GetEmitAngle
Returns, in degrees clockwise from straight up, the angle along which particles are emitted.
Syntax
float GetEmitAngle()
SetEmitAngle
Sets, in degrees clockwise from straight up, the angle along which particles are emitted.
Syntax
void SetEmitAngle(float emitAngle)
GetEmitAngleVariation
Returns, in degrees, the variation in the emit angle. For example, a variation value of 10 designates a range of plus or minus 10 degrees on each side of the current emit angle.
Syntax
float GetEmitAngleVariation()
SetEmitAngleVariation
Sets, in degrees, the variation in the emit angle. For example, a variation value of 10 designates a range of plus or minus 10 degrees on each side of the current emit angle.
Syntax
void SetEmitAngleVariation(float emitAngleVariation)
GetIsParticleLifetimeInfinte
Returns whether the emitted particles have an infinite lifetime.
Syntax
bool GetIsParticleLifetimeInfinite()
SetIsParticleLifetimeInfinite
Sets whether the emitted particles have an infinite lifetime.
Syntax
void SetIsParticleLifetimeInfinite(bool infiniteLifetime)
GetParticleLifetime
Returns, in seconds, the lifetime of the emitted particles.
Syntax
float GetParticleLifetime()
SetParticleLifetime
Sets, in seconds, the initial lifetime of the emitted particles.
Syntax
void SetParticleLifetime(float lifetime)
GetParticleLifetimeVariation
Returns the variation in lifetime of the emitted particles. For example, a variation of 5 seconds designates a range of 5 seconds on either side of the chosen initial lifetime.
Syntax
float GetParticleLifetimeVariation()
SetParticleLifetimeVariation
Sets the variation in lifetime of the emitted particles. For example, a variation of 5 seconds designates a range of 5 seconds on either side of the chosen initial lifetime.
Syntax
void SetPartcleLifetimeVariation(float lifetimeVariation)
GetSpritePathname
Returns the source location of the image to be used by the emitted particles.
Syntax
AZStd::string GetSpritePathname()
SetSpritePathname
Sets the source location of the image to be used by the emitted particles.
Syntax
void SetSpritePathname(AZStd::string spritePath)
GetIsSpriteSheetAnimated
Returns whether the sprite sheet cell index changes over time on each particle.
Syntax
bool GetIsSpriteSheetAnimated()
SetIsSpriteSheetAnimated
Sets whether the sprite sheet cell index changes over time on each particle.
Syntax
void SetIsSpriteSheetAnimated(bool spriteSheetAnimated)
GetIsSpriteSheetAnimationLooped
Returns whether the sprite sheet cell animation is looped.
Syntax
bool GetIsSpriteSheetAnimationLooped()
SetIsSpriteSheetAnimationLooped
Sets whether the sprite sheet cell animation is looped.
Syntax
void SetIsSpriteSheetAnimationLooped(bool spriteSheetAnimationLooped)
GetIsSpriteSheetIndexRandom
Returns whether the initial sprite-sheet index is randomly chosen.
Syntax
bool GetIsSpriteSheetIndexRandom()
SetIsSpriteSheetIndexRandom
Sets whether the initial sprite-sheet index is randomly chosen.
Syntax
void SetIsSpriteSheetIndexRandom(bool spriteSheetIndexRandom)
GetSpriteSheetCellIndex
Returns the sprite-sheet index to be used for emitted particles.
Syntax
int GetSpriteSheetCellIndex()
SetSpriteSheetCellIndex
Sets the sprite-sheet index to be used for emitted particles.
Syntax
void SetSpriteSheetCellIndex(int spriteSheetIndex)
GetSpriteSheetCellEndIndex
Returns the end index of the sprite-sheet cell range that is used for sprite-sheet animation or random index selection.
Syntax
int GetSpriteSheetCellEndIndex()
SetSpriteSheetCellEndIndex
Sets the end index of the sprite-sheet cell range that is used for sprite-sheet animation or random index selection.
Syntax
void SetSpriteSheetCellEndIndex(int spriteSheetEndIndex)
GetSpriteSheetFrameDelay
Returns, in seconds, the delay between each sprite-sheet frame.
Syntax
float GetSpriteSheetFrameDelay()
SetSpriteSheetFrameDelay
Sets, in seconds, the delay between each sprite-sheet frame.
Syntax
void SetSpriteSheetFrameDelay(float spriteSheetFrameDelay)
GetIsParticleAspectRatioLocked
Returns whether the width and height of the emitted particles are locked into the current aspect ratio.
Syntax
bool GetIsParticleAspectRatioLocked()
SetIsParticleAspectRatioLocked
Sets whether the width and height of the emitted particles are locked into the current aspect ratio.
Syntax
void SetIsParticleAspectRatioLocked(bool aspectRatioLocked)
GetParticlePivot
Returns the pivot for the particles in a range from (0,0) at the top left to (1,1) at the bottom right.
Syntax
AZ::Vector2 GetParticlePivot()
SetParticlePivot
Sets the pivot for the particles in a range from (0,0) at the top left to (1,1) at the bottom right.
Syntax
void SetParticlePivot(AZ::Vector2 particlePivot)
GetParticleSize
Returns the size of the emitted particles.
Syntax
AZ::Vector2 GetParticleSize()
SetParticleSize
Sets the size of the emitted particles.
Syntax
void SetParticleSize(AZ::Vector2 particleSize)
GetParticleWidth
Returns the width of the emitted particles.
Syntax
float GetParticleWidth()
SetParticleWidth
Sets the width of the emitted particles.
Syntax
void SetParticleWidth(float particleWidth)
GetParticleWidthVariation
Returns the variation in width of the emitted particles.
Syntax
float GetParticleWidthVariation()
SetParticleWidthVariation
Sets the variation in width of the emitted particles.
Syntax
void SetParticleWidthVariation(float particleWidthVariation)
GetParticleHeight
Returns the height of the emitted particles.
Syntax
float GetParticleHeight()
SetParticleHeight
Sets the height of the emitted particles.
Syntax
void SetParticleHeight(float particleHeight)
GetParticleHeightVariation
Returns the variation in height of the emitted particles.
Syntax
float GetParticleHeightVariation()
SetParticleHeightVariation
Sets the variation in height of the emitted particles.
Syntax
void SetParticleHeightVariation(float particleHeightVariation)
GetParticleMovementCoordinateType
Returns the co-ordinate system used for the movement of the emitted particles.
Syntax
eUiParticleCoordinateType GetParticleMovementCoordinateType()
Possible values for the movement space are as follows.
enum eUiParticleCoordinateType
{
eUiParticleCoordinateType_Cartesian,
eUiParticleCoordinateType_Polar
};
SetParticleMovementCoordinateType
Sets the coordinate system that is used for the movement of the emitted particles.
Syntax
void SetParticleMovementCoordinateType(eUiParticleCoordinateType movementCoordinateType)
For possible values for the coordinate type, see GetParticleMovementCoordinateType
.
GetParticleAccelerationMovementSpace
Returns the coordinate system that is used for the acceleration of particles.
Syntax
eUiParticleCoordinateType GetParticleAccelerationMovementSpace()
For possible values for the movement space, see GetParticleMovementCoordinateType
.
SetParticleAccelerationMovementSpace
Sets the coordinate system that is used for the acceleration of particles.
Syntax
void SetParticleAccelerationMovementSpace(eUiParticleCoordinateType accelerationMovementSpace)
For possible values for the movement space, see GetParticleMovementCoordinateType
.
GetParticleInitialVelocity
Returns the initial velocity of the emitted particles. Applicable only when the emitter doesn’t control the emit direction.
Syntax
AZ::Vector2 GetParticleInitialVelocity()
SetParticleInitialVelocity
Sets the initial velocity of the emitted particles. Applicable only when the emitter doesn’t control the emit direction.
Syntax
void SetParticleInitialVelocity(AZ::Vector2 particleInitialVelocity)
GetParticleInitialVelocityVariation
Returns the variation in the particle initial velocity. Applicable only when the emitter doesn’t control the emit direction.
Syntax
AZ::Vector2 GetParticleInitialVelocityVariation()
SetParticleInitialVelocityVariation
Sets the variation in the particle initial velocity. Applicable only when the emitter doesn’t control the emit direction.
Syntax
void SetParticleInitialVelocityVariation(AZ::Vector2 initialVelocityVariation)
GetParticleSpeed
Returns the initial particle speed. Applicable only when the emitter doesn’t control the emit direction.
Syntax
float GetParticleSpeed()
SetParticleSpeed
Sets the initial particle speed. Applicable only when the emitter doesn’t control the emit direction.
Syntax
void SetParticleSpeed(float particleSpeed)
GetParticleSpeedVariation
Returns the variation in initial particle speed. Applicable only when the emitter doesn’t control the emit direction.
Syntax
float GetParticleSpeedVariation()
SetParticleSpeedVariation
Sets the variation in initial particle speed. Applicable only when the emitter doesn’t control the emit direction.
Syntax
void SetParticleSpeedVariation(float particleSpeedVariation)
GetParticleAcceleration
Returns the acceleration of the emitted particles.
Syntax
AZ::Vector2 GetParticleAcceleration()
SetParticleAcceleration
Sets the acceleration of the emitted particles.
Syntax
void SetParticleAcceleration(AZ::Vector2 particleAcceleration)
GetIsParticleRotationFromVelocity
Returns whether the particle is oriented so that its top points towards the current velocity vector.
Syntax
bool GetIsParticleRotationFromVelocity()
SetIsParticleRotationFromVelocity
Sets whether the particle is oriented so that its top points towards the current velocity vector.
Syntax
void SetIsParticleRotationFromVelocity(bool rotationFromVelocity)
GetIsParticleInitialRotationFromInitialVelocity
Returns whether the particle is initially oriented so that its top points towards the initial velocity vector.
Syntax
bool GetIsParticleInitialRotationFromInitialVelocity()
SetIsParticleInitialRotationFromInitialVelocity
Sets whether the particle is initially oriented so that its top points towards the initial velocity vector.
Syntax
void SetIsParticleInitialRotationFromInitialVelocity(bool initialRotationFromVelocity)
GetParticleInitialRotation
Returns, in degrees clockwise measured from straight up, the initial rotation.
Syntax
float GetParticleInitialRotation()
SetParticleInitialRotation
Sets, in degrees clockwise measured from straight up, the initial rotation.
Syntax
void SetParticleInitialRotation(float particleInitialRotation)
GetParticleInitialRotationVariation
Returns, in degrees clockwise measured from straight up, the variation of the initial rotation.
Syntax
float GetParticleInitialRotationVariation()
SetParticleInitialRotationVariation
Sets, in degrees clockwise measured from straight up, the variation of the initial rotation.
Syntax
void SetParticleInitialRotation(float particleInitialRotationVariation)
GetParticleRotationSpeed
Returns, in degrees clockwise per second, the rotation speed of the emitted particles.
Syntax
float GetParticleRotationSpeed()
SetParticleRotationSpeed
Sets, in degrees clockwise per second, the rotation speed of the emitted particles.
Syntax
void SetParticleRotationSpeed(float rotationSpeed)
GetParticleRotationSpeedVariation
Returns, in degrees clockwise per second, the variation in rotation speed of the emitted particles.
Syntax
float GetParticleRotationSpeedVariation()
SetParticleRotationSpeedVariation
Sets, in degrees clockwise per second, the variation in rotation speed of the emitted particles.
Syntax
void SetParticleRotationSpeedVariation(float rotationSpeedVariation)
GetParticleColor
Returns the color of the emitted particles.
Syntax
AZ::Color GetParticleColor()
SetParticleColor
Sets the color of the emitted particles.
Syntax
void SetParticleColor(AZ::Color particleColor)
GetParticleColorBrightnessVariation
Returns, in the range [0,1], the variation in color brightness of the emitted particles.
Syntax
float GetParticleColorBrightnessVariation()
SetParticleColorBrightnessVariation
Sets, in the range [0,1], the variation in color brightness of the emitted particles.
Syntax
void SetParticleColorBrightnessVariation(float brightnessVariation)
GetParticleColorTintVariation
Returns, in the range [0,1], the variation in color tint of the emitted particles.
Syntax
float GetParticleColorTintVariation()
SetParticleColorTintVariation
Sets, in the range [0,1], the variation in color tint of the emitted particles.
Syntax
void SetParticleColorTintVariation(float tintVariation)
GetParticleAlpha
Returns, in the range [0,1], the alpha of the emitted particles.
Syntax
float GetParticleAlpha()
SetParticleAlpha
Sets, in the range [0,1], the alpha of the emitted particles.
Syntax
void SetParticleAlpha(float particleAlpha)