This commit is contained in:
yangxiao 2015-03-04 10:42:08 +08:00
parent e466b5d231
commit ea7dfe1147
2 changed files with 42 additions and 6 deletions

View File

@ -1065,7 +1065,7 @@ static void extendParticleSystem3D(lua_State* tolua_S)
lua_pop(tolua_S, 1);
}
int lua_cocos2dx_extension_ParticlePool_getActiveParticleList(lua_State* tolua_S)
int lua_cocos2dx_extension_ParticlePool_getActiveDataList(lua_State* tolua_S)
{
int argc = 0;
cocos2d::ParticlePool* cobj = nullptr;
@ -1085,7 +1085,7 @@ int lua_cocos2dx_extension_ParticlePool_getActiveParticleList(lua_State* tolua_S
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_ParticlePool_getActiveParticleList'", nullptr);
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_ParticlePool_getActiveDataList'", nullptr);
return 0;
}
#endif
@ -1095,10 +1095,10 @@ int lua_cocos2dx_extension_ParticlePool_getActiveParticleList(lua_State* tolua_S
{
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ParticlePool_getActiveParticleList'", nullptr);
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ParticlePool_getActiveDataList'", nullptr);
return 0;
}
const ParticlePool::PoolList& ret = cobj->getActiveParticleList();
const ParticlePool::PoolList& ret = cobj->getActiveDataList();
lua_newtable(tolua_S);
if (ret.empty())
@ -1135,7 +1135,7 @@ static void extendParticlePool(lua_State* tolua_S)
lua_rawget(tolua_S, LUA_REGISTRYINDEX);
if (lua_istable(tolua_S,-1))
{
tolua_function(tolua_S, "getActiveParticleList", lua_cocos2dx_extension_ParticlePool_getActiveParticleList);
tolua_function(tolua_S, "getActiveDataList", lua_cocos2dx_extension_ParticlePool_getActiveDataList);
}
lua_pop(tolua_S, 1);
}

View File

@ -376,6 +376,41 @@ function Particle3DElectricBeamSystemDemo:onExit()
self:unscheduleUpdate()
end
-- Particle3DFlareShield
local Particle3DFlareShieldDemo = class("Particle3DFlareShield", function ()
local layer = cc.Layer:create()
Helper.initWithLayer(layer)
return layer
end)
function Particle3DFlareShieldDemo:ctor()
-- body
self:init()
end
function Particle3DFlareShieldDemo:init()
baseInit(self)
end
function Particle3DFlareShieldDemo:title()
return "Particle3D Test"
end
function Particle3DFlareShieldDemo:subtitle()
return "FlareShield"
end
function Particle3DFlareShieldDemo:onEnter()
local rootps = cc.PUParticleSystem3D:create("flareShield.pu")
rootps:setCameraMask(cc.CameraFlag.USER1)
rootps:startParticleSystem()
self:addChild(rootps, 0, PARTICLE_SYSTEM_TAG)
end
function Particle3DFlareShieldDemo:onExit()
self:unscheduleUpdate()
end
function Particle3DTest()
local scene = cc.Scene:create()
@ -388,7 +423,8 @@ function Particle3DTest()
Particle3DTimeShiftDemo.create,
Particle3DUVAnimDemo.create,
Particle3DFirePlaceDemo.create,
Particle3DElectricBeamSystemDemo.create
Particle3DElectricBeamSystemDemo.create,
Particle3DFlareShieldDemo.create
}
scene:addChild(Particle3DLineStreakDemo.create())