SpriteParticleComponent

Provides the ability to create a sprite particle effect.

# Properties

[{"index":"boolean ApplySpriteColor (Sync)","0":"Sets whether the Color property is applied to the Sprite to be used by the particle. Even if the property is false, the transparency value of Color is applied."}]

[{"index":"SpriteParticleType ParticleType (Sync)","0":"Set the type of particle to be created."}]

[{"index":"string SpriteRUID (Sync)","0":"Sets the SpriteRUID to be used as the particle."}]

##### inherited from BaseParticleComponent:

[{"index":"boolean AutoRandomSeed (Sync)","0":"Sets whether to create a new random seed whenever particle emission begins."}]

[{"index":"Color Color (Sync)","0":"Corrects the color of the particles to be rendered."}]

[{"index":"boolean IgnoreMapLayerCheck (Sync)","0":"Does not perform automatic substitution when the Map Layer's name is specified in SortingLayer."}]

[{"index":"boolean IsEmitting (Sync) (ReadOnly) (HideFromInspector)","0":"Indicates whether new particles are being emitted."}]

[{"index":"LitMode LitMode (Sync)","0":"Selects the rendering method that will determine whether materials or objects will be affected by light sources."}]

[{"index":"boolean Loop (Sync)","0":"Set whether to play particles repeatedly."}]

[{"index":"int32 OrderInLayer (Sync)","0":"Determines the priority within the same layer. A higher number indicates higher priority."}]

[{"index":"float ParticleCount (Sync)","0":"Set the number of particles."}]

[{"index":"float ParticleLifeTime (Sync)","0":"Set the particle duration."}]

[{"index":"float ParticleSize (Sync)","0":"Set the particle size."}]

[{"index":"float ParticleSpeed (Sync)","0":"Set the particle speed."}]

[{"index":"boolean PlayOnEnable (Sync)","0":"Set whether to play particles when the particle component is set to Enable."}]

[{"index":"float PlaySpeed (Sync)","0":"Set the play speed of particles."}]

[{"index":"boolean Prewarm (Sync)","0":"If set to Enable, the maximum number of particles is loaded, and the particles play naturally."}]

[{"index":"integer RandomSeed (Sync)","0":"Sets the random seed used to determine creation position, emission direction, speed, etc. when particle is played."}]

[{"index":"string SortingLayer (Sync)","0":"When two or more Entities overlap, the priority is determined by the Sorting Layer."}]

##### inherited from Component:

[{"index":"boolean Enable (Sync)","0":"Checks whether Component is activated or not."}]

[{"index":"boolean EnableInHierarchy (ReadOnly) (HideFromInspector)","0":"Displays whether this Component is Enable in the hierarchy. If Entity Enable is false regardless of Component Enable, returns false."}]

[{"index":"Entity Entity (ReadOnly)","0":"The Entity that owns this component."}]

# Methods

##### inherited from BaseParticleComponent:

[{"index":"void Play()","0":"Play stopped particles."}]

[{"index":"void Stop()","0":"Stop playing particles."}]

##### inherited from Component:

[{"index":"boolean IsClient()","0":"Returns whether the current execution environment is a client or not."}]

[{"index":"boolean IsServer()","0":"Returns whether the current execution environment is a server or not."}]

# Events

[{"index":"OrderInLayerChangedEvent","0":"This event occurs when changing the Component's OrderInLayer."}]

[{"index":"ParticleEmitEndEvent","0":"This event is raised by BaseParticleComponent when emission of the particle has been completed."}]

[{"index":"ParticleEmitStartEvent","0":"The event that takes place when particle emission begins."}]

[{"index":"ParticleLoopEvent","0":"If the Loop property is enabled, this event is fired when the particle's emission cycle returns and the emission repeats."}]

[{"index":"SortingLayerChangedEvent","0":"This event occurs when changing the component's SortingLayer."}]

# Examples

Applies the Color property of SpriteParticle to the new spriteRUID and Sprite. In addition, this example demonstrates controlling particle playback by tapping a designated key. To ensure proper functionality, you need to add the SpriteParticleComponent to the Entity.
    
    
    @Component
    script KeyboardSpriteController extends Component
        property any SpriteParticle = nil
    
        @ExecSpace("ClientOnly")
        method void OnBeginPlay()
        self.SpriteParticle = self.Entity.SpriteParticleComponent
    
        self.SpriteParticle.SpriteRUID = "000000"
        self.SpriteParticle.ApplySpriteColor = true
        end
    
        @EventSender("Service", "InputService")
        handler HandleKeyDownEvent(KeyDownEvent event)
        --------------- Native Event Sender Info ----------------
        -- Sender: InputService
        -- Space: Client
        ---------------------------------------------------------
    
        -- Parameters
        local key = event.key
        ---------------------------------------------------------
        if key == KeyboardKey.Q then
        	self.SpriteParticle:Stop()
        elseif key == KeyboardKey.E then
        	self.SpriteParticle:Play()
        end
        end
    end
    

# SeeAlso

  * KeyboardKey
  * KeyDownEvent
  * InputService
  * ParticleService
  * [Using Particles](/docs?postId=1036)
  * [Utilizing Particles](/docs?postId=764)