Thank you for helping me look at this problem.
I am imitating example to make particle masked.
First let me show you some screen shot:
This is desired:
This is problematic, the particles are not filled:
I am using these images as image mask:
TestSprite.png
TestSprite_2.png
Here is all my qml code:
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Particles 2.0
ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
property url targetImageSource: "qrc:/TestSprite_2.png"
menuBar: MenuBar {
Menu {
title: qsTr("File")
MenuItem {
text: qsTr("Exit")
onTriggered: Qt.quit();
}
}
}
Rectangle
{
width: parent.width
height: parent.height
color: Qt.black.toString( )
Image
{
id: targetImage
anchors.centerIn: parent
scale: 0.5
source: targetImageSource
MouseArea
{
anchors.fill: parent
onClicked:
{
console.log( "The button has been clicked." );
//parent.visible = false;
maskParticle.start( );
}
}
ParticleSystem
{
id: maskParticle
anchors.fill: parent
running: false
ImageParticle
{
source: "qrc:///particleresources/glowdot.png"
z: 2
anchors.fill: parent
color: "#336666CC"
colorVariation: 0.0
}
Emitter
{
anchors.fill: parent
emitRate: 6000
lifeSpan: 720
size: 10
shape: MaskShape
{
source: targetImageSource
}
}
}
}
}
Text
{
font.family: "Aerial"
font.pixelSize: 16
text: qsTr( "This is a test particle system." )
color: "#FFFFFF"
}
}
↧