Difference between revisions of "B2.ParticleSystem"
From GiderosMobile
(added missing constants) |
|||
Line 63: | Line 63: | ||
[[b2.ParticleSystem.FLAG_WATER]]<br/><!--GIDEROSCST:b2.ParticleSystem.FLAG_WATER 0--> | [[b2.ParticleSystem.FLAG_WATER]]<br/><!--GIDEROSCST:b2.ParticleSystem.FLAG_WATER 0--> | ||
[[b2.ParticleSystem.FLAG_ZOMBIE]]<br/><!--GIDEROSCST:b2.ParticleSystem.FLAG_ZOMBIE 2--> | [[b2.ParticleSystem.FLAG_ZOMBIE]]<br/><!--GIDEROSCST:b2.ParticleSystem.FLAG_ZOMBIE 2--> | ||
+ | |||
+ | [[b2.ParticleSystem.FLAG_DESTRUCTION_LISTENER]]<br/><!--GIDEROSCST:b2.ParticleSystem.FLAG_DESTRUCTION_LISTENER x--> | ||
+ | [[b2.ParticleSystem.FLAG_BARRIER]]<br/><!--GIDEROSCST:b2.ParticleSystem.FLAG_BARRIER x--> | ||
+ | [[b2.ParticleSystem.FLAG_STATIC_PRESSURE]]<br/><!--GIDEROSCST:b2.ParticleSystem.FLAG_STATIC_PRESSURE x--> | ||
+ | [[b2.ParticleSystem.FLAG_REACTIVE]]<br/><!--GIDEROSCST:b2.ParticleSystem.FLAG_REACTIVE x--> | ||
+ | [[b2.ParticleSystem.FLAG_REPULSIVE]]<br/><!--GIDEROSCST:b2.ParticleSystem.FLAG_REPULSIVE x--> | ||
+ | [[b2.ParticleSystem.FLAG_FIXTURE_CONTACT_LISTENER]]<br/><!--GIDEROSCST:b2.ParticleSystem.FLAG_FIXTURE_CONTACT_LISTENER x--> | ||
+ | [[b2.ParticleSystem.FLAG_PARTICLE_CONTACT_LISTENER]]<br/><!--GIDEROSCST:b2.ParticleSystem.FLAG_PARTICLE_CONTACT_LISTENER x--> | ||
+ | [[b2.ParticleSystem.FLAG_FIXTURE_CONTACT_FILTER]]<br/><!--GIDEROSCST:b2.ParticleSystem.FLAG_FIXTURE_CONTACT_FILTER x--> | ||
+ | [[b2.ParticleSystem.FLAG_PARTICLE_CONTACT_FILTER]]<br/><!--GIDEROSCST:b2.ParticleSystem.FLAG_PARTICLE_CONTACT_FILTER x--> | ||
|} | |} | ||
---- | ---- | ||
*'''[[LiquidFun]]''' | *'''[[LiquidFun]]''' |
Revision as of 18:07, 25 April 2022
Supported platforms:
Available since: Gideros 2015.06.30
Description
Defines a particle system in box2d world using LiquidFun.
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=b2.ParticleSystem.FLAG_COLOR_MIXING | b2.ParticleSystem.FLAG_POWDER,
})
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)