Difference between revisions of "B2.ParticleSystem"
Line 2: | Line 2: | ||
'''Supported platforms:''' <br/> | '''Supported platforms:''' <br/> | ||
'''Available since:''' Gideros 2015.06.30<br/> | '''Available since:''' Gideros 2015.06.30<br/> | ||
− | === Description === | + | === <translate>Description</translate> === |
<translate>Defines particle system in box2d world using Liquid fun</translate> | <translate>Defines particle system in box2d world using Liquid fun</translate> | ||
− | === Examples === | + | === <translate>Examples</translate> === |
'''Simple particle system example'''<br/> | '''Simple particle system example'''<br/> | ||
<source lang="lua">-- create world | <source lang="lua">-- create world | ||
Line 36: | Line 36: | ||
{|- | {|- | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
− | === Methods === | + | === <translate>Methods</translate> === |
[[Special:MyLanguage/b2.ParticleSystem:containsParticle|b2.ParticleSystem:containsParticle]] <br/> | [[Special:MyLanguage/b2.ParticleSystem:containsParticle|b2.ParticleSystem:containsParticle]] <br/> | ||
[[Special:MyLanguage/b2.ParticleSystem:createParticle|b2.ParticleSystem:createParticle]] ''<translate>create new particle</translate>''<br/> | [[Special:MyLanguage/b2.ParticleSystem:createParticle|b2.ParticleSystem:createParticle]] ''<translate>create new particle</translate>''<br/> | ||
Line 46: | Line 46: | ||
[[Special:MyLanguage/b2.ParticleSystem:setTexture|b2.ParticleSystem:setTexture]] ''<translate>set texture to particles</translate>''<br/> | [[Special:MyLanguage/b2.ParticleSystem:setTexture|b2.ParticleSystem:setTexture]] ''<translate>set texture to particles</translate>''<br/> | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
− | === Events === | + | === <translate>Events</translate> === |
− | === Constants === | + | === <translate>Constants</translate> === |
[[Special:MyLanguage/b2.ParticleSystem.FLAG_COLOR_MIXING|b2.ParticleSystem.FLAG_COLOR_MIXING]]<br/> | [[Special:MyLanguage/b2.ParticleSystem.FLAG_COLOR_MIXING|b2.ParticleSystem.FLAG_COLOR_MIXING]]<br/> | ||
[[Special:MyLanguage/b2.ParticleSystem.FLAG_ELASTIC|b2.ParticleSystem.FLAG_ELASTIC]]<br/> | [[Special:MyLanguage/b2.ParticleSystem.FLAG_ELASTIC|b2.ParticleSystem.FLAG_ELASTIC]]<br/> |
Revision as of 07:30, 24 August 2018
Supported platforms:
Available since: Gideros 2015.06.30
Description
Defines particle system in box2d world using Liquid fun
Examples
Simple particle system example
-- create world
local world = b2.World.new(0, 9.8)
local ps1= world:createParticleSystem({ radius=5})
ps1:setTexture(Texture.new("Bubble.png"))
stage:addChild(ps1)
ps1:createParticleGroup({shape=shape2,
position={x=500,y=250},
color = 0xFF0000,
alpha=1,
flags=0
})
ps1:createParticleGroup({shape=shape1,
position={x=400,y=50},
color = 0x0000FF,
alpha=1,
flags=0
})
-- step the world and then update the position and rotation of sprites
local function onEnterFrame()
world:step(1/60, 8, 3)
end
stage:addEventListener(Event.ENTER_FRAME, onEnterFrame)
Methodsb2.ParticleSystem:containsParticle |
EventsConstantsb2.ParticleSystem.FLAG_COLOR_MIXING |