I’m a little stuck in trying to pass variable into vent group build function.
for example:
in vent group i’ve this function
build=function(size) local size=math.random(size, size)
How can i pass the “size” variable?
what i’ve tried
function fireBall(x,y,size) local group = burn:get("burn") group.x, group.y = x, y group.size = size burn:start("burn") end fireBall(20,220, 15)
burn=CBE.VentGroup{ { preset="burn", color={{255, 111, 0}, {255, 70, 0}}, -- Reddish-orange colors build=function(size) local size=math.random(size, size) return display.newImageRect("media/generic\_particle.png", size, size) end, onCreation=function()end, -- See the note for the ice comet x=20, y=20, perEmit=2, positionType="inRadius", posRadius=20, emitDelay=50, fadeInTime=500, lifeSpan=500, -- Particles are removed sooner than the ice comet lifeStart=500, endAlpha=0, physics={ relativeToSize=false, sizeX=-0.01, sizeY=-0.01, autoAngle=false, angles={135}, relativeToSize=false, velocity=3, xDamping=1, gravityY=-0.01, gravityX=0.01 } }, { preset="burn", -- Not the smoke preset because it's just about the same as the burn effect, just with a few changes title="smoke", -- The smoke vent color={{100}}, build=function() local size=math.random(120, 140) return display.newImageRect("media/smoke.png", size, size) end, propertyTable={blendMode="screen"}, -- Lighten the comet slightly onCreation=function()end, perEmit=1, y=384, x=512, positionType="inRadius", posRadius=20, emitDelay=50, fadeInTime=500, lifeSpan=500, lifeStart=500, alpha=0.5, endAlpha=0, physics={ relativeToSize=false, sizeX=-0.01, sizeY=-0.01, autoAngle=false, angles={90}, relativeToSize=false, velocity=3, xDamping=1, gravityY=-0.01, gravityX=0.01 } } }