ItemParticle QML Type

For specifying a delegate to paint particles. 更多...

import 语句: import QtQuick.Particles 2.15
继承:

ParticlePainter

特性

方法

详细描述

特性文档编制

delegate : Component

An instance of the delegate will be created for every logical particle, and moved along with it. As an alternative to using delegate, you can create Item instances yourself and hand them to the ItemParticle to move using the take 方法。

Any delegate instances created by ItemParticle will be destroyed when the logical particle expires.

fade : bool

If true, the item will automatically be faded in and out at the ends of its lifetime. If false, you will have to implement any entry effect yourself.

默认为 true。

方法文档编制

freeze ( Item item )

Suspends the flow of time for the logical particle which item represents, allowing you to control its movement.

give ( Item item )

Orders the ItemParticle to give you control of the item . It will cease controlling it and the item will lose its association to the logical particle.

take ( Item item , bool prioritize )

Asks the ItemParticle to take over control of item positioning temporarily. It will follow the movement of a logical particle when one is available.

By default items form a queue when waiting for a logical particle, but if prioritize is true , then it will go immediately to the head of the queue.

ItemParticle does not take ownership of the item, and will relinquish control when the logical particle expires. Commonly at this point you will want to put it back in the queue, you can do this with the below line in the delegate definition:

ItemParticle.onDetached: itemParticleInstance.take(delegateRootItem);
					

or delete it, such as with the below line in the delegate definition:

ItemParticle.onDetached: delegateRootItem.destroy();
					

unfreeze ( Item item )

Restarts the flow of time for the logical particle which item represents, allowing it to be moved by the particle system again.