On May 14, 2013, at 9:58 AM, Mark <mark...@gmail.com> wrote:

> On Sun, May 12, 2013 at 2:08 PM, Mark <mark...@gmail.com> wrote:
>> Hi,
>> 
>> I'm browsing through the Emitter API while searching for "some" way to
>> get notified when a particle is expired.
>> 
>> What i'm having is one emitter that emits 1 particle every 25ms then
>> one trailemitter that adds a trail to the particle. Now in the main
>> emitter (with 1 particle every 25 ms) i want to get notified when the
>> particle dies - which is 625 ms later. How can i do that?
>> 
>> I can probably play with the Timer element, but then i'd need a timer
>> for every particle which is quite a pain to do in QML in a dynamic
>> fashion.. I'm actually hoping there is a signal somewhere (or a
>> onSomething...) that i haven't found yet but can also be used to get
>> the same result.
>> 
>> If that doesn't exists then i guess i need to make a dynamic timer
>> element for QML, right?
>> 
>> The ideal thing - for me - to have here is a signal that fires with
>> the X and Y position where the particle expired.
>> 
>> Regards,
>> Mark
> 
> Anyone?

Tracking each individual particle is not really in line with the concept of a 
particle systems as they are typically set up as fire-and-forget to be as cheap 
and fast as possible.

However, there might be way that works for you, granted that you don't have too 
many particles live at the same time.

If you use the ItemParticle, you can specify a delegate for it. This delegate 
can be a normal Image {} item, and will be a lot slower (probably in the range 
100-1000x worse) than plain a ImageParticle, but  you can then track it using 
the onVisibleChanged signal. When the item is visible, it is "alive" and when 
it is hidden its lifespan has ended.

cheers,
Gunnar

> _______________________________________________
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to