I don’t call in the FX library at all in my code. I create my own effects and particles inside my playgame LUA file. Here is a sample of what i did that works.
Step 1: Create your Particles (Copy one from one of the samples you like)
--\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Step 1 Define your Particles \*\*\*\*\*
Particles.CreateParticleType ("Sparkle", {
imagePath = "images/effects/colored\_stars.png",
imageWidth = 64,
imageHeight = 64,
velocityStart = 65,
velocityVariation = 65,
velocityChange = -1.0,
directionVariation = 330,
alphaStart = 0,
alphaVariation = .25,
fadeInSpeed = 2.0,
fadeOutSpeed = -0.85,
fadeOutDelay = 500,
scaleStart = 0.01,
scaleVariation = 0.2,
scaleInSpeed = 0.5,
weight = 0,
autoOrientation = true,
rotationVariation = 360,
killOutsideScreen = true,
lifeTime = 4000,
useEmitterRotation = false,
emissionShape = 0,
emissionRadius = 30,
blendMode = "add"
} )
Step 2 - Create the emitter you will eventually use.
--\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Step 2 - Create your Emitters \*\*\*\*\*
-- CREATE EMITTERS (NAME, SCREENW, SCREENH, ROTATION, ISVISIBLE, LOOP)
Particles.CreateEmitter("Explosion3", display.contentWidth, display.contentHeight, 300, false, false) -- Sparkle Explosion
Step 3 - Assign Particles to your emitter
--\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Step 3 - Assign Particles to your Emitter
Particles.AttachParticleType("Explosion3", "Sparkle", 25, 0,0)
This sets up the emitter. you then later call it and display it as needed.
[code]
– Identify the emitter i want to use
if emitterID == 3 then emitterToDisplay = “Explosion3” end
–Put the emitter on the screen where i want it
Particles.StartEmitter(emitterToDisplay, true)
Particles.GetEmitter (emitterToDisplay).x = emitterX – emitterX could be a event.other.x reference if thats how you want to place it
Particles.GetEmitter (emitterToDisplay).y = emitterY – emitterY could be a event.other.y reference if thats how you want to place it
Particles.SetEmitterScale(emitterToDisplay,2.0)
[/code] [import]uid: 67604 topic_id: 17429 reply_id: 66235[/import]