Particles in Qt

Description of my application

I am trying to show a nice animation of the time when traffic affects the bicycles in the city (each rack is a point that turns greener when it is filled, more towards red because it becomes more empty, etc.).


What am i still

Something like this

Something like the image above.

This is my code so far that generated this:

import QtQuick 2.0
import QtQuick.Particles 2.0

Rectangle {
    width: 360
    height: 360

    color: "black"

    id: bg

    ParticleSystem {
        id: sys
    }

    Emitter {
        anchors.fill: parent
        system: sys
        ImageParticle {
            anchors.fill: parent
            system: sys
            source: "images/greenBlip.png"
            clip: true
            id:  redblip
        }

        lifeSpan: 6000
    }

}

Actual question

Unfortunately, in the application right now I can not control the following:

  • where and how many particles appear
  • how bright they are
  • life expectancy (I don't want them to disappear)

Any ideas how to manage this?

+4
source share
1 answer

, , 1000 , :

lifeSpan: Emitter.InfiniteLife
maximumEmitted: 1000

onEmitParticles(Array particles) . , . , ++. , Particle , .. ++ .

0

Source: https://habr.com/ru/post/1533824/


All Articles