Particles Emitter.burst(count, int x, int y) not working(((
-
Hi all,
I have a small problem with Emitter looks like method burst(count, int x, int y) not working properly or I have a problem with understanding doc)
problem - burst generate particale in RANDOM place but NOT in (x, y) point(
Qt 5.13.0
ok, so my code isimport QtQuick 2.12 import QtQuick.Particles 2.13 Item { id: gameField anchors.fill: parent property double lastTouchX: 0 property double lastTouchY: 0 property int touchCount: 0 MultiPointTouchArea { id: mptaMain anchors.fill: parent minimumTouchPoints: 1 maximumTouchPoints: 1 mouseEnabled: true property int pointCount:0 touchPoints: [ TouchPoint { id: point1 } ] onPressed: updatePointCount() onReleased: updatePointCount() onTouchUpdated: updatePointCount() function updatePointCount() { if (point1.pressed) { lastTouchX = point1.x; lastTouchY = point1.y; ++touchCount; } } } ParticleSystem { id: psMain } Emitter { id: eLight anchors.fill: parent system: psMain size: 10 endSize: 50 enabled: false group: "light" ImageParticle { id: ipLight color: "red" system: psMain source: "qrc:///res/particle.png" anchors.fill: parent clip: true groups: ["light"] } lifeSpan: 1000 } Timer { id: tMain; interval: 30; running: false; repeat: true onTriggered: { if (lastTouchX && lastTouchY && touchCount) { eLight.burst(touchCount, lastTouchX, lastTouchY); // there is a problem lastTouchX = 0; lastTouchY = 0; touchCount = 0; } } } function creationFinished() { console.log("GameField.creationFinished", height_koeff, width, height); eLight.size *= height_koeff; eLight.endSize *= height_koeff; tMain.start(); } }thanks for help)
-
ok, I read doc one more time and understand that burst(count, int x, int y) "move" Emitter to point (x, y)
so only one possible way create track for cursor is in Emitter.onEmitParticles signalperhaps is possible emit particle in one emitter and show it on another canvas?
thanks