1.0.1 • Published 5 years ago

nativescript-particle-emitter v1.0.1

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
5 years ago

NativeScript Particle Emitter

Build Status

Particle emitter component for NativeScript.

demo gif

Installation

Describe your plugin installation steps. Ideally it would be something like:

tns plugin add nativescript-particle-emitter

Usage

Add your particle emitter Page from XML:

<Page xmlns="http://schemas.nativescript.org/tns.xsd"
  xmlns:pe="nativescript-particle-emitter">
  <GridLayout>
    <pe:ParticleEmitter isEmitting="true" />
  </GridLayout>
</Page>

or you can choose to pass in some configuration:

<Page xmlns="http://schemas.nativescript.org/tns.xsd"
  xmlns:pe="nativescript-particle-emitter">
  <GridLayout>
    <pe:ParticleEmitter
      isEmitting="true"
      showDebug="true"
      emitOriginX="150"
      emitOriginY="200" 
      emitOriginWidth="100"
      emitOriginHeight="100"
      particleDuration="1000"
      emitCount="4" 
      emitInterval="60"  
      emitDistance="120"  
      emitDistanceVariation="50"  
      emitAngle="90"  
      emitAngleVariation="45" 
      colorPalette="red, green, #0000FF" />
  </GridLayout>
</Page>

Properties

PropertyDefaultDescription
isEmittingfalseControls wether the emitter is emitting
showDebugfalseShows debug helpers
emitInterval50The interval used for emitting in milliseconds
emitCount5The number of particles on each emit
particleDuration800Lifespan of the particles in milliseconds
emitDistance80The base distance the particles will travel
emitDistanceVariation40Distance variation. Each particle will travel a random number in the range [distance - variation, distance + variation]
emitAngle0The angle (in degrees) at which particles are emitted
emitAngleVariation180Angle variation. Each particle will be emitted at a random angle in the range [angle - variation, angle + variation]
emitOriginX0The X coordinate of the center of the emit box
emitOriginY0The X coordinate of the center of the emit box
emitOriginWidth1The width of the emit box
emitOriginHeight1The Height of the emit box
colorPalette"blue"The color palette used for particles. Colors should be comma-separated when defined in XML (ex. "red, green, blue")

License

MIT License

1.0.1

5 years ago

1.0.0

5 years ago