Difference between revisions of "Particles:addParticles"

From GiderosMobile
Line 2: Line 2:
 
'''Available since:''' Gideros 2016.06<br/>
 
'''Available since:''' Gideros 2016.06<br/>
 
=== Description ===
 
=== Description ===
Add particle a single particle (short form)  or several ones (long form) to this particle system.
+
<translate>Add particle a single particle (short form)  or several ones (long form) to this particle system.
 
<br/>
 
<br/>
 
Short form (single particle):
 
Short form (single particle):
`particles:addParticles(x,y,size,angle,ttl)`
+
[[[particles:addParticles(x,y,size,angle,ttl)]]]
 
<br/>
 
<br/>
 
Extended form:
 
Extended form:
`particles:addParticles{particleDesc1,particleDesc2,...,particleDescN}`
+
[[[particles:addParticles{particleDesc1,particleDesc2,...,particleDescN}]]]
 
where particleDescX is a table describing a particle to be added. This table can contain the following parameters:
 
where particleDescX is a table describing a particle to be added. This table can contain the following parameters:
 
<ul>
 
<ul>
Line 20: Line 20:
 
<li>speedX,speedY,speedAngular,speedGrowth: Amount added to x,y,angle and size at the beginning of each frame</li>
 
<li>speedX,speedY,speedAngular,speedGrowth: Amount added to x,y,angle and size at the beginning of each frame</li>
 
<li>decay,decayAngular,decayGrowth,decayAlpha: factor applied to speedX and speedY, speedAngular, speedGrowth and alpha at the beginning of each frame</li>
 
<li>decay,decayAngular,decayGrowth,decayAlpha: factor applied to speedX and speedY, speedAngular, speedGrowth and alpha at the beginning of each frame</li>
</ul>
+
</ul></translate>
 
<source lang="lua">
 
<source lang="lua">
 
(number or table) = Particles:addParticles(particles)
 
(number or table) = Particles:addParticles(particles)
 
</source>
 
</source>
 
=== Parameters ===
 
=== Parameters ===
'''particles''': (table or arguments) table for multiple particles or arguments for single <br/>
+
'''particles''': (table or arguments) <translate>table for multiple particles or arguments for single</translate> <br/>
 
=== Return values ===
 
=== Return values ===
'''Returns''' (number or table) index or table with indexes of added particles<br/>
+
'''Returns''' (number or table) <translate>index or table with indexes of added particles</translate><br/>

Revision as of 14:32, 23 August 2018

Available since: Gideros 2016.06

Description

Add particle a single particle (short form) or several ones (long form) to this particle system.
Short form (single particle): [[[particles:addParticles(x,y,size,angle,ttl)]]]
Extended form: [[[particles:addParticles{particleDesc1,particleDesc2,...,particleDescN}]]] where particleDescX is a table describing a particle to be added. This table can contain the following parameters:

  • x,y: particle position
  • size: particle size
  • angle: particle orientation
  • color: particle color
  • alpha: particle alpha
  • ttl: time to leave, number of frames this particle will stay on screen
  • tag: tag associated with this particle
  • speedX,speedY,speedAngular,speedGrowth: Amount added to x,y,angle and size at the beginning of each frame
  • decay,decayAngular,decayGrowth,decayAlpha: factor applied to speedX and speedY, speedAngular, speedGrowth and alpha at the beginning of each frame
(number or table) = Particles:addParticles(particles)

Parameters

particles: (table or arguments) table for multiple particles or arguments for single

Return values

Returns (number or table) index or table with indexes of added particles