Qt Quick Particles Examples - Image Particles

Image non disponible

This is a collection of small QML examples relating to using Affectors in the particle system. Each example is a small QML file emphasizing a particular type or feature.

All at once shows off several of the features of ImageParticle at the same time.

 
Sélectionnez
sprites: [
    Sprite {
        name: "bear"
        source: "../../images/bear_tiles.png"
        frameCount: 13
        frameDuration: 120
    }
]
colorVariation: 0.5
rotationVelocityVariation: 360
colorTable: "../../images/colortable.png"

Colored shows a simple ImageParticle with some color variation.

 
Sélectionnez
ImageParticle {
    anchors.fill: parent
    source: "qrc:///particleresources/star.png"
    alpha: 0
    alphaVariation: 0.2
    colorVariation: 1.0
}

Color Table sets the color over life on the particles to provide a fixed rainbow effect.

 
Sélectionnez
source: "qrc:///particleresources/glowdot.png"
colorTable: "../../images/colortable.png"
sizeTable: "../../images/colortable.png"

Deformation spins and squishes a starfish particle.

 
Sélectionnez
ImageParticle {
    system: sys
    groups: ["goingLeft", "goingRight"]
    source: "../../images/starfish_4.png"
    rotation: 90
    rotationVelocity: 90
    autoRotation: true
}
ImageParticle {
    system: sys
    groups: ["goingDown"]
    source: "../../images/starfish_0.png"
    rotation: 180
    yVector: PointDirection { y: 0.5; yVariation: 0.25; xVariation: 0.25; }
}

Rotation demonstrates the autoRotate property, so that particles rotate in the direction that they travel.

Sharing demonstrates what happens when multiple ImageParticles try to render the same particle. The following ImageParticle renders the particles inside the ListView:

 
Sélectionnez
ImageParticle {
    anchors.fill: parent
    system: particles
    source: "../../images/flower.png"
    alpha: 0.1
    color: "white"
    rotationVariation: 180
    z: -