Hello!How do i display the rain effect in a display group (let’s say weatherGroup) in this code??
heavy_rain=CBE.VentGroup{
{
preset=“rain”,
title=“drop”, – The “plink” effect at the end of each raindrop
positionType=“atPoint”,
build=function()
return display.newImageRect(“Textures/generic_particle.png”, 20, 5)
end,
alpha=0.5,
fadeInTime=0,
lifeStart=0,
lifeSpan=100,
endAlpha=0,
perEmit=1,
physics={
maxX=30,
sizeX=1, – Grow X like a ripple
velocity=0 – Don’t move
}
},
{
preset=“rain”,
title=“rain”,
positionType=“inRect”,
rectLeft=0,
rectTop=-100,
rectWidth=display.contentWidth,
rectHeight=100,
build=function()
return display.newImageRect(“Textures/generic_particle.png”, 10, math.random(70,90))
end,
alpha=0.5,
onDeath=function(p, v, c)
--heavy_rain.sampleVGroup:translate(“drop”, p.x, p.y)
--heavy_rain.sampleVGroup:emit(“drop”)
heavy_rain:translate(“drop”, p.x, p.y)
heavy_rain:emit(“drop”)
end,
propertyTable={
rotation=10
},
lifeStart=370,
lifeSpan=50,
endAlpha=0,
perEmit=1,
physics={
autoAngle=false,
angles={265},
velocity=24
}
},
{
preset=“fluid”,
title=“clouds”,
color={
{70}, – Dark grays
{60},
{50}
},
positionType=“inRect”,
rectLeft=0,
rectTop=0,
rectWidth=1024,
rectHeight=60, – Create a blanket of clouds at the top of the screen
fadeInTime=500, – Low fade in time and life span
lifeSpan=500,
lifeStart=1000, – High life start delay
build=function()
local size=math.random(280, 312) – Particles are quite large
return display.newImageRect(“Textures/generic_particle.png”, size, size)
end,
propertyTable={
blendMode=“normal” – Normal fluid preset uses additive blending via the property table
},
physics={
velocity=1.1, – Some minor velocity in left-right direction
autoAngle=false,
angles={180, 0}
}
}
}
–heavy_rain:start(“clouds”,“rain”)