아주 최근에 완성(?)된 카렙Caleb Place이라는 친구가 공개한 CBEffects이라는 파티클Particle 시스템을 살펴보았다.
위의 사이트에서는 2013년 2월부터 공개한 CBEffects를 비롯한 여러가지 소스와 샘플 그리고 네온퐁NeonPong이라는 핑퐁게임의 소스도 제공을 하고있다.
다음은 CBEffects의 샘플인 CBResources를 Corona Simulator에서 구동하는 동영상이다.
여느 유료 파티클 시스템 못지않게 30여가지의 이펙트를 선보이고 있다.
좀 더 분석을 통해서 업데이트된 내용을 올려야겠다.
UPDATE – 2013/4/10 15:50
CBEffects를 사용하려면 다음과 같이 시작하면 되겠다.
-- Using CBEffects
local CBE = require( "CBEffects.Library" )
local VentGroup = CBE.VentGroup{
{
preset = "burn",
title = "myFire",
color={{255, 111, 0}, {255, 70, 0}}, -- Reddish-orange colors
}
}
VentGroup:start( "myFire" ) -- 시작하기
VentGroup.stop=function()
VentGroup:destroyMaster()
VentGroup=nil
end
timer.performWithDelay( 3000 , VentGroup.stop ) -- 3초 후에 중지
(참고) Lua의 require문은 다음을 참고바란다.
[ 모듈 사용과 저장 방식 ]
‘모듈화 규칙’에 따라서 모듈은 ’require’ 명령으로 로딩하여 사용할 수 있다.
예를 들어 자신이 만든 모듈파일이 ’mymodule.lua’라면 다음과 같이 사용할 수 있다.local mymodule = require( “mymodule” )
주의할 점은 ’require’ 명령의 인자로 넣어주는 파일명의 확장자(.lua)를 붙이지 않는 것이다.
모듈을 로딩할 때 확장자(.lua)를 붙이지 않는 이유를 살펴보자. LUA에서 ’require’ 명령은 콤마(.)를 특수한 용도로 사용한다.다음의 예제를 보면 콤마(.)가 폴더로 대체되어 사용된다는 것을 알 수 있다.
local MyModule = require( “alterant.module” )
module.lua가 저장된 위치는 다음과 같습니다.
(프로젝트 폴더)/alterant/module.lua
코로나 SDK에서 lua 파일은 반드시 프로젝트의 최상위 폴더에 저장되어 있어야 정상적인 빌드가 가능하다. 따라서 ’require’ 명령의 콤마(.) 사용법을 응용하여 프로젝트의 최상위 폴더가 아닌 특정 하위 폴더에 lua 파일을 저장할 수 있다.
UPDATE – 2013/4/11 11:47
다음과 같은 ‘불타는 무대’를 표현해보았다.
myVGroup={title="fire"}
myVGroup.initiate=function()
myVGroup=CBE.VentGroup{
{
preset = "burn",
color={{255, 111, 0}, {255, 70, 0}}, -- Reddish-orange colors
perEmit=2,
positionType="fromPointList", --"alongLine", --"inRadius",
pointList={
{-120,0+yOffset},
{-60,20+yOffset},
{0,35+yOffset},
{60,20+yOffset},
{120,0+yOffset}
},
emitDelay=50,
fadeInTime=500,
lifeSpan=500, -- Particles are removed sooner than the ice comet
lifeStart=500,
endAlpha=0,
physics={
relativeToSize=false,
sizeX=-0.01,
sizeY=-0.01,
autoAngle=false,
angles={90},--{135},
relativeToSize=false,
velocity=3,
xDamping=1,
gravityY=-0.01,
gravityX=0.01
}
}
}
myVGroup:startMaster()
end
myVGroup.stop=function()
myVGroup:destroyMaster()
myVGroup=nil
end
myVGroup.initiate() --시작하기
[CBEffect 링크]
지원 링크
Support at the CoronaLabs Code Exchange
Support at the CoronaLabs CBEffects Forum Page (not recommended)다른 링크
CBEffects Facebook Page
Gymbyl Coding Website CoronaLabs Website
Recent Comments