Hi, recently I test about TNT particle engine.
In general it works if it is created at "stage", but not inside another Sprite.
For example:
I have this inside by Item Sprite class
self.emitter_1 = CEmitter.new(0,0,0, self) |
which means that, each Item Sprite would start its own particle system.
Note that original tutorial is something like:
self.emitter_1 = CEmitter.new(0,0,0, stage) |
And when I add the Item Sprite in my scene (3 of them, side by side), the particle engine seems not working properly.
To explain a little further, if I touch from left to right, it works at the first time. BUT, at the 4th touch (on the first button), the particle/touch event fails to emit from the original button (but it emits from the rightest button)
I am curious I miss out anything?
Comments
https://deluxepixel.com
Gideros particle system is performing better, but this one has a lot of options (and a super cool editor )
Likes: newbie2018
https://deluxepixel.com
https://www.dropbox.com/s/lldszhwcai9r5hq/tntparticlesengine15.zip?dl=0
Can you test it to see if it's faster?
Likes: newbie2018
https://deluxepixel.com
I will do some more tests and keep you updated!
It's a pity to lose the rectangular textures since those were useful to achieve certain effects (ie. rays), but I suppose otherwise Particles may not work so well...
Likes: newbie2018
https://deluxepixel.com
Likes: pie
https://deluxepixel.com
By the way, when you guys say "Gidero's own particle System", do you mean the "Particle Candy"?
Likes: newbie2018
http://docs.giderosmobile.com/reference/gideros/Particles#Particles
Likes: newbie2018
https://deluxepixel.com
https://deluxepixel.com
Really Thanks for your inputs. Sure i would go through the Gidero's Particles now (i didn't know about that...)
By the way, as promised, I have uploaded my mini project.
Basically, after touching the third item (rightest one), the subsequent touch is erroneous...
Let me know if i miss something....
Likes: newbie2018
https://deluxepixel.com
I made some modifications and added some comments on those lines:
Your issue was that you were checking hitTestPoint against self (the Item Sprite) which also hosted the particle effect - item was 100x100 px at the beginning, then, after particles emission it was a lot larger.
You got only the third one "exploding" just because it was on top of the others - being put there last - (but its size was overlapping them)
To fix this I just checked hitTestPoint against the bitmap (not the whole sprite)
Then you had a couple things I changed because I think it may be cleaner this way:
in home:init you added the items on stage instead of self, maybe this was intentional, I don't know your project
you were creating a new emitter and new particles each time the item was pressed, maybe this was intentional too, but if the Items are not supposed to "die" on touch I believe that this may lead to memory leaks (local particles should be removed as soon as they are no longer referenced, but since the emitter is being overwritten each time who knows? I would not do it... )
I don't know how the new release of tntparticleengine will perform yet, but I learned that it's much better to create emitters before, and use them as needed instead of creating them at the last time.
last thing I did was adding
self:getParent():addChild(self)
to bring the Item Sprite on top of the others, thus keeping particles over the other items
Likes: antix, newbie2018
@pie Thanks to you too~ The explanation is very useful as it helps me understand better. Sure I would create the emitters first now.
Likes: SinisterSoft, antix
version 1.14 - without using gideros Particles: 400 particle instances returns 48-51 fps
version 1.15 - using gideros Particles on the same effect and device returns 59-60 fps
For the tests I used png24 textured particles with alpha translucency - I suppose that using native particle shapes it may also be better.
looking forward for the new math operators, let's see if I we can reach 600! I'm sorry that the applause smiley is no longer available because you (and obviously hgy29) totally deserved it thanks!
Likes: hgy29, SinisterSoft, newbie2018
https://www.dropbox.com/s/0cup1t70358cg5g/tntparticlesengine16.zip?dl=0
Likes: pie, MoKaLux
https://deluxepixel.com
@SinisterSoft
On the same test effect we have a slight improvement on RAM usage (13k) and probably the framerate is better since its value looks more stable.
We can reach 600, but at a variable fps count of 57/59
Great job, thank you!
I will soon release an updated tntfx on google: do you like me to publish the last tnt particle engine file on github or do you want to make a pull request on the already existing one?
Likes: newbie2018
There are still loads of improvements to speed that can be made. I'll have a look after Gideros 2018.3 has been released.
Likes: pie, keszegh, Apollo14, newbie2018
https://deluxepixel.com
for those who are interested I've just published TNTFX2 - featuring TNT Particle engine 1.16 support.
Get it here:
https://play.google.com/store/apps/details?id=com.piretro.TNTFX2
Likes: antix, Apollo14, SinisterSoft
It's very hard to operate. You seem to have made the project in landscape mode but are presenting the in app GUI in portrait mode. This has the unwelcome appearance of all system requests being in l;andscape mode, not portrait.
The app has always been portrait because I like one hand operations on phone
I was thinking to do it landscape , but on small devices the collapsable menu goes out of the screen.
It looks fine on s7 but on tabS TextInputDialogs are landscape oriented... I don't have a clue on what could be the reason for that.. on which device did you test it?
Thank you
however the app is (should be) portrait, as it is on my phone.. it may be the letterbox scale mode, I will change it asap
Likes: antix