Class ParticleEmitter
Definition
- Namespace:
- Tizen.NUI.ParticleSystem
- Assembly:
- Tizen.NUI.dll
Class ParticleEmitter creates a single emitter attached to a specified View. ParticleEmitter is responsible for spawning and updating particles.
Emitter must contain: ParticleSource - responsible for spawning new particles ParticleModifier(s) - responsible for updating particles in the system
ParticleSource and ParticleModifier callback interfaces should not be accessing Event side (NUI) objects. Both callbacks are executed on Update thread.
public class ParticleEmitter : BaseHandle, IDynamicResourceHandler, INameScope, System.IDisposable
- Inheritance
- Implements
-
System.IDisposable
Constructors
View SourceParticleEmitter(View)
Create an initialized ParticleEmitter.
Declaration
public ParticleEmitter(View view)
Parameters
Type | Name | Description |
---|---|---|
View | view | View to attach the particle emitter. |
Properties
View SourceActiveParticleLimit
Limit of active particles in the system
Declaration
public uint ActiveParticleLimit { get; set; }
Property Value
Type | Description |
---|---|
uint |
Remarks
Active particles in the system can be limited without changing ParticleCount.
EmissionRate
Rate of emission per second
Declaration
public uint EmissionRate { get; set; }
Property Value
Type | Description |
---|---|
uint |
Remarks
EmissionRate defines number of particles emitted per second.
InitialParticleCount
Initial particle count
Declaration
public uint InitialParticleCount { get; set; }
Property Value
Type | Description |
---|---|
uint |
Remarks
Initial number of particles to be emitted immediately after emitter starts. It allows initial burst emission. By default it's set to 0.
ParticleCount
Maximum particle count
Declaration
public uint ParticleCount { get; set; }
Property Value
Type | Description |
---|---|
uint |
RendererBlendingMode
Gets/sets blending mode for particle renderer
Declaration
public ParticleBlendingMode RendererBlendingMode { get; set; }
Property Value
Type | Description |
---|---|
ParticleBlendingMode |
Remarks
Currently two blending modes are supported: Additive and Screen (advanced blending mode). ParticleBlendingMode
TextureResourceUrl
Sets texture to be used by the renderer
Declaration
public string TextureResourceUrl { set; }
Property Value
Type | Description |
---|---|
string |
Methods
View SourceAddLocalStreamFloat(float)
Adds local (not used by shader) data stream to the particle emitter
Declaration
public uint AddLocalStreamFloat(float defaultValue)
Parameters
Type | Name | Description |
---|---|---|
float | defaultValue | Default value to fill the stream with |
Returns
Type | Description |
---|---|
uint | Index of newly created data stream |
Remarks
Adds new stream of float type.
AddLocalStreamVector2(Vector2)
Adds local (not used by shader) data stream to the particle emitter
Declaration
public uint AddLocalStreamVector2(Vector2 defaultValue)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | defaultValue | Default value to fill the stream with |
Returns
Type | Description |
---|---|
uint | Index of newly created data stream |
Remarks
Adds new stream of Vector2 type.
AddLocalStreamVector3(Vector3)
Adds local (not used by shader) data stream to the particle emitter
Declaration
public uint AddLocalStreamVector3(Vector3 defaultValue)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | defaultValue | Default value to fill the stream with |
Returns
Type | Description |
---|---|
uint | Index of newly created data stream |
Remarks
Adds new stream of Vector3 type.
AddLocalStreamVector4(Vector4)
Adds local (not used by shader) data stream to the particle emitter
Declaration
public uint AddLocalStreamVector4(Vector4 defaultValue)
Parameters
Type | Name | Description |
---|---|---|
Vector4 | defaultValue | Default value to fill the stream with |
Returns
Type | Description |
---|---|
uint | Index of newly created data stream |
Remarks
Adds new stream of Vector4 type.
AddModifier<T>(ParticleModifier<T>)
Adds ParticleModifier to the stack
Declaration
public void AddModifier<T>(ParticleModifier<T> modifier) where T : ParticleModifierInterface, new()
Parameters
Type | Name | Description |
---|---|---|
ParticleModifier<T> | modifier | Valid modifier object |
Type Parameters
Name | Description |
---|---|
T |
Remarks
ParticleEmitter implements a stack of modifiers which are responsible for updating particles in the system. The stack is processed such as result of previous modifier is an input for next modifier.
Dispose(DisposeTypes)
Dispose.
Declaration
protected override void Dispose(DisposeTypes type)
Parameters
Type | Name | Description |
---|---|---|
DisposeTypes | type |
Overrides
View SourceGetModifierAt(uint)
Returns modifier at specified index
Declaration
public ParticleModifier<ParticleModifierInterface> GetModifierAt(uint index)
Parameters
Type | Name | Description |
---|---|---|
uint | index | Index within modifier stack |
Returns
Type | Description |
---|---|
ParticleModifier<ParticleModifierInterface> | Valid ParticleModifier object or null |
GetSource<T>()
Returns associated ParticleSource object
Declaration
public ParticleSource<T> GetSource<T>() where T : ParticleSourceInterface, new()
Returns
Type | Description |
---|---|
ParticleSource<T> | Valid ParticleSource object or null |
Type Parameters
Name | Description |
---|---|
T |
SetSource<T>(ParticleSource<T>)
Raises the window to the top of the window stack.
Declaration
public void SetSource<T>(ParticleSource<T> source) where T : ParticleSourceInterface, new()
Parameters
Type | Name | Description |
---|---|---|
ParticleSource<T> | source | Source object to copy. |
Type Parameters
Name | Description |
---|---|
T |
Start()
Starts emission of particles.
Declaration
public void Start()
Stop()
Stops emission of particles.
Declaration
public void Stop()