Particles
Спадковість: Sprite
Підтримувані платформи:
Available since version: Gideros 2016.06
Опис:
Генератор часток. для емуляції диму, дощу, тощо
Particles - sprite (alpha), дозволяє намалювати кілька ідентичних точок або bitmap з різним кольором і орієнтацією
Приклад:
Синтаксис: Lua
w=application:getContentWidth()
h=application:getContentHeight()
application:setBackgroundColor(0)
stars=Particles.new()
stars:setPosition(w/2,h/2)
stage:addChild(stars)
function gameLoop(e)
--ttl час життя частинки в мілісек stars:addParticles({{x=0,y=0,size=5,ttl=200,speedX=math.random()-0.5,speedY=math.random()-0.5,decay=1.04}})
end
stage:addEventListener(Event.ENTER_FRAME,gameLoop)
h=application:getContentHeight()
application:setBackgroundColor(0)
stars=Particles.new()
stars:setPosition(w/2,h/2)
stage:addChild(stars)
function gameLoop(e)
--ttl час життя частинки в мілісек stars:addParticles({{x=0,y=0,size=5,ttl=200,speedX=math.random()-0.5,speedY=math.random()-0.5,decay=1.04}})
end
stage:addEventListener(Event.ENTER_FRAME,gameLoop)
Методи, евенти та властивості:
| Методи |
|---|
| Particles.new |
| Particles:addParticles |
| Particles:clearTexture |
| Particles:getParticleAngle |
| Particles:getParticleColor |
| Particles:getParticleDecay |
| Particles:getParticlePosition |
| Particles:getParticles |
| Particles:getParticleSize |
| Particles:getParticleSpeed |
| Particles:getParticleTag |
| Particles:getParticleTtl |
| Particles:isPaused |
| Particles:removeParticles |
| Particles:setParticleAngle |
| Particles:setParticleColor |
| Particles:setParticleDecay |
| Particles:setParticlePosition |
| Particles:setParticleSize |
| Particles:setParticleSpeed |
| Particles:setParticlesTag |
| Particles:setParticleTag |
| Particles:setParticleTtl |
| Particles:setPaused |
| Particles:setTexture |
Немає коментарів:
Дописати коментар