Particle Loaders (ssk.pex.*)

This module allows you to load and directly create Corona emitters using any of these particle source formats/tools:

Particle Loaders

Loaders

All three loaders have a similar signature:


-- Roaming Gamer Particle Editor 2
local emitter = ssk.pex.loadRG( group, x, y, fileName [ , params ] )

--Particle Designer 2
local emitter = ssk.pex.loadPD2( group, x, y, fileName [ , params ] )

-- Starling
local emitter = ssk.pex.loadStarling( group, x, y, fileName [ , params ] )

All three loaders will load their respective definition file types and then call newEmitter() to create an emitter vent. These parameters control how the emitter is created.

Example Loader Calls


   -- ==========================================
   -- 1. Particle Designer Format
   -- ==========================================
   local emitter1 = ssk.pex.loadPD2( nil, centerX - 200, centerY, 
                          "emitters/ParticleDesigner2/Comet.json",
                           { texturePath = "emitters/ParticleDesigner2/" } )
   emitter1.rotation = 45

   -- ==========================================
   -- 2. Roaming Gamer Particle Editor (1 & 2)
   -- ==========================================
   local emitter2 = ssk.pex.loadRG( nil, centerX, centerY, 
                          "emitters/RG/emitter16178.rg",
                           { texturePath = "emitters/RG/",
                           altTexture = "particle78348.png" } )

   -- ==========================================
   -- 3. Starling Format
   -- ==========================================
   local emitter3 = ssk.pex.loadStarling( nil, centerX + 200, centerY, 
                          "emitters/Starling/particle3.pex",
                           { altTexture = "images/star.png" } )


RoamingGamer Copyright © Roaming Gamer, LLC. 2008-2016; All Rights Reserved