Forum


Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: problem on tnt particles engine demo
omeryavuz
Newbie
Posts: 1
Permalink
Post problem on tnt particles engine demo
on: August 23, 2012, 21:52
Quote

I am using scene manager and multi page on project.
Whenever I tried to use
Page3 = gideros.class(Sprite)

function Page3:init()
self.no = pageNo

self.background = Bitmap.new(TextureRegion.new(Texture.new("gfx/ball.png", true)))

-- load graphics
local particleGFX = (Texture.new("a11.png")) -- load particles sprite

-- create new emitter called emitterTest_1
emitterTest_1 = CEmitter.new(160, 240, 0, Page3)

particleTest_1 = CParticles.new(particleGFX, 40, 3, 3, "add")

-- create particles...
particleTest_1:setColor(255, 0, 0)
particleTest_1:setSpeed(50)
particleTest_1:setDirection(0, 360)
particleTest_1:setSize(0.3)
--particleTest_1:setColorMorphIn(0,180,0, .5)
--particleTest_1:setColorMorphOut(0,0,0, 2.5, 255,255,255,2.5)
particleTest_1:setColorMorphOut(0,255,0, 1)
particleTest_1:setSpeedMorphOut(10,2)
particleTest_1:setEnableColorMorph(false, false)

-- assign particles...
emitterTest_1:assignParticles(particleTest_1) -- assign particle to emitter

-- start emitter
emitterTest_1:start()
end

tntparticlesengine.lua:268: index '__userdata' cannot be found
stack traceback:

Whenever I tried to use stage instead of page 3, we have blank screen no animation.
emitterTest_1 = CEmitter.new(160, 240, 0, stage)

What is problem on this code?

gregbug
Administrator
Posts: 19
Permalink
Post Re: problem on tnt particles engine demo
on: August 23, 2012, 22:26
Quote

mmmm....

can you send me (gregbug at gmail dot com ) a little project file so i can better try to understood the problem ?

thanks.
Gianluca.

gregbug
Administrator
Posts: 19
Permalink
Post Re: problem on tnt particles engine demo
on: August 24, 2012, 19:17
Quote

Ok,

sorry for the delay...

In your demo project the problem is the alphablend setting...

i mean:

emitter should be:
emitterTest_1 = CEmitter.new(160, 240, 0, self)

now if you try to run the demo you can't see nothing!!!
you need to change alphamode (it depends by the sprite used)

so now try to set
particleTest_1 = CParticles.new(particleGFX, 40, 3, 3, "multiply")

run the demo again...
and voila' your particles are here!!!!

hope it help.

if you have problems, just email me!!!
ciao!

Pages: [1]


Mingle Forum by cartpauj
Version: 1.0.34 ; Page loaded in: 0.01 seconds.