Particles
Supported platforms:
Available since: Gideros 2016.06
Inherits from: Sprite
Description
A particle system which allows to draw several identical dots or bitmaps, with varying colour and orientation.
Example
-- gideros particles
local particleGFX = Texture.new("gfx/yourgfx.png")
local stars = Particles.new()
stars:setTexture(particleGFX)
stage:addChild(stars)
-- GAME LOOP
function onEnterFrame(e)
if (e.time // 1) % 4 == 0 then
stars:addParticles({
{
x=math.random(480),y=math.random(320),
size=32,angle=math.random(360),
color=0xff00ff,alpha=0.8,
ttl=16*2,
speedX=0.01,speedY=0.01,speedAngular=0.15,
speedGrowth=0.9,
},
{
x=math.random(480),y=math.random(320),
size=16,angle=math.random(360),
color=0x00ffff,alpha=0.8,
ttl=16*16,
speedX=0.02,speedY=0.02,speedAngular=0.2,
speedGrowth=-0.1,
},
})
end
end
stage:addEventListener(Event.ENTER_FRAME, onEnterFrame)
MethodsParticles.new creates new particles group |
EventsConstants |