Merge branch 'qtquick2' of scm.dev.nokia.troll.no:qt/qtdeclarative-staging

Conflicts:
	src/declarative/items/qsgtextnode.cpp
This commit is contained in:
Aaron Kennedy 2011-06-24 16:37:03 +10:00
commit 2a18f33552
291 changed files with 8160 additions and 8030 deletions

View File

@ -40,7 +40,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Flipable { Flipable {
id: container id: container
@ -57,6 +57,8 @@ Flipable {
property int rating: 2 property int rating: 2
property variant prevScale: 1.0 property variant prevScale: 1.0
property int flipDuration: 1600
signal closed signal closed
transform: Rotation { transform: Rotation {
@ -137,94 +139,172 @@ Flipable {
slider.value = prevScale; slider.value = prevScale;
} }
if (inBackState && bigImage.status == Image.Ready) if (inBackState && bigImage.status == Image.Ready)
particleBox.imageInAnim(); effectBox.imageInAnim();
} }
property bool inBackState: false property bool inBackState: false
onInBackStateChanged:{ onInBackStateChanged:{
if(inBackState && bigImage.status == Image.Ready) if(inBackState && bigImage.status == Image.Ready)
particleBox.imageInAnim(); effectBox.imageInAnim();
else if (!inBackState && bigImage.status == Image.Ready) else if (!inBackState && bigImage.status == Image.Ready)
particleBox.imageOutAnim(); effectBox.imageOutAnim();
} }
} }
ShaderEffectSource{
id: pictureSource
sourceItem: bigImage
smooth: true
//Workaround: Doesn't work below lines
width: bigImage.width
height: bigImage.width
visible: false
}
Turbulence{//only fill visible rect
id: turbulence
system: imageSystem
anchors.fill: parent
frequency: 100
strength: 250
active: false
}
Item{ Item{
id: particleBox id: effectBox
width: bigImage.width * bigImage.scale width: bigImage.width * bigImage.scale
height: bigImage.height * bigImage.scale height: bigImage.height * bigImage.scale
anchors.centerIn: parent anchors.centerIn: parent
function imageInAnim(){ function imageInAnim(){
cp.visible = true;
pixAffect.onceOff = false;
bigImage.visible = false; bigImage.visible = false;
noiseIn.visible = true;
endEffectTimer.start(); endEffectTimer.start();
pixelEmitter.pulse(1);
} }
function imageOutAnim(){ function imageOutAnim(){
cp.visible = true;
pixAffect.onceOff = true;
bigImage.visible = false; bigImage.visible = false;
noiseIn.visible = false;
turbulence.active = true; turbulence.active = true;
endEffectTimer.start(); endEffectTimer.start();
pixelEmitter.burst(2048); pixelEmitter.burst(2048);
} }
Timer{ Timer{
id: endEffectTimer id: endEffectTimer
interval: 1000 interval: flipDuration
repeat: false repeat: false
running: false running: false
onTriggered:{ onTriggered:{
bigImage.visible = true;
turbulence.active = false; turbulence.active = false;
cp.visible = false; noiseIn.visible = false;
bigImage.visible = true;
} }
} }
ShaderEffectItem{
id: noiseIn
anchors.fill: parent
property real t: 0
visible: false
onVisibleChanged: tAnim.start()
NumberAnimation{
id: tAnim
target: noiseIn
property: "t"
from: 0.0
to: 1.0
duration: flipDuration
}
property variant source: pictureSource
property variant noise: ShaderEffectSource{
sourceItem:Image{
source: "images/noise.png"
}
hideSource: true
smooth: false
}
fragmentShader:"
uniform sampler2D noise;
uniform sampler2D source;
uniform highp float t;
uniform lowp float qt_Opacity;
varying highp vec2 qt_TexCoord0;
void main(){
//Want to use noise2, but it always returns (0,0)?
if(texture2D(noise, qt_TexCoord0).w <= t)
gl_FragColor = texture2D(source, qt_TexCoord0) * qt_Opacity;
else
gl_FragColor = vec4(0.,0.,0.,0.);
}
"
}
ParticleSystem{ ParticleSystem{
id: imageSystem id: imageSystem
} }
ColoredParticle{ Emitter{
id: cp
system: imageSystem
color: "gray"
alpha: 1
image: "images/squareParticle.png"
colorVariation: 0
}
Picture{
id: pixAffect
system: imageSystem
anchors.fill: parent
image: container.photoUrl;
onceOff: true
}
Turbulence{
id: turbulence
system: imageSystem
anchors.fill: parent
frequency: 100
strength: 250
active: false
}
TrailEmitter{
id: pixelEmitter0
system: imageSystem
height: parent.height
particleSize: 4
particleDuration: 1000
particlesPerSecond: 4096
speed: PointVector{x: 360; xVariation: 8; yVariation: 4}
emitting: false
}
TrailEmitter{
id: pixelEmitter id: pixelEmitter
system: imageSystem system: imageSystem
anchors.fill: parent //anchors.fill: parent
particleSize: 4 width: Math.min(bigImage.width * bigImage.scale, flickable.width);
particleDuration: 1000 height: Math.min(bigImage.height * bigImage.scale, flickable.height);
particlesPerSecond: 2048 anchors.centerIn: parent
size: 4
lifeSpan: flipDuration
emitRate: 2048
emitting: false emitting: false
} }
CustomParticle{
id: blowOut
system: imageSystem
property real maxWidth: effectBox.width
property real maxHeight: effectBox.height
vertexShader:"
attribute highp vec2 vPos;
attribute highp vec2 vTex;
attribute highp vec4 vData; // x = time, y = lifeSpan, z = size, w = endSize
attribute highp vec4 vVec; // x,y = constant speed, z,w = acceleration
attribute highp float r;
uniform highp float maxWidth;
uniform highp float maxHeight;
uniform highp mat4 qt_ModelViewProjectionMatrix;
uniform highp float timestamp;
uniform lowp float qt_Opacity;
varying highp vec2 fTex2;
varying lowp float fFade;
void main() {
fTex2 = vec2(vPos.x / maxWidth, vPos.y / maxHeight);
highp float size = vData.z;
highp float endSize = vData.w;
highp float t = (timestamp - vData.x) / vData.y;
highp float currentSize = mix(size, endSize, t * t);
if (t < 0. || t > 1.)
currentSize = 0.;
highp vec2 pos = vPos
- currentSize / 2. + currentSize * vTex // adjust size
+ vVec.xy * t * vData.y // apply speed vector..
+ 0.5 * vVec.zw * pow(t * vData.y, 2.);
gl_Position = qt_ModelViewProjectionMatrix * vec4(pos.x, pos.y, 0, 1);
highp float fadeIn = min(t * 10., 1.);
highp float fadeOut = 1. - max(0., min((t - 0.75) * 4., 1.));
fFade = 1.0;//fadeIn * fadeOut * qt_Opacity;
}
"
property variant pictureTexture: pictureSource
fragmentShader: "
uniform sampler2D pictureTexture;
varying highp vec2 fTex2;
varying highp float fFade;
void main() {
gl_FragColor = texture2D(pictureTexture, fTex2) * fFade;
}"
}
} }
} }
@ -268,7 +348,7 @@ Flipable {
transitions: Transition { transitions: Transition {
SequentialAnimation { SequentialAnimation {
PropertyAction { target: bigImage; property: "smooth"; value: false } PropertyAction { target: bigImage; property: "smooth"; value: false }
NumberAnimation { easing.type: Easing.InOutQuad; properties: "angle"; duration: 1000 } NumberAnimation { easing.type: Easing.InOutQuad; properties: "angle"; duration: flipDuration }
PropertyAction { target: bigImage; property: "smooth"; value: !flickable.movingVertically } PropertyAction { target: bigImage; property: "smooth"; value: !flickable.movingVertically }
} }
} }

View File

@ -40,7 +40,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Item{ Item{
id: container id: container
@ -59,24 +59,24 @@ Item{
running: container.visible running: container.visible
id: barSys id: barSys
} }
ColoredParticle{ ImageParticle{
color: "lightsteelblue" color: "lightsteelblue"
alpha: 0.1 alpha: 0.1
colorVariation: 0.05 colorVariation: 0.05
image: "images/particle.png" source: "images/particle.png"
system: barSys system: barSys
} }
TrailEmitter{ Emitter{
y: 2; height: parent.height-4; y: 2; height: parent.height-4;
x: 2; width: Math.max(parent.width * progress - 4, 0); x: 2; width: Math.max(parent.width * progress - 4, 0);
speed: AngleVector{ angleVariation: 180; magnitudeVariation: 12 } speed: AngledDirection{ angleVariation: 180; magnitudeVariation: 12 }
system: barSys system: barSys
particlesPerSecond: width; emitRate: width;
particleDuration: 1000 lifeSpan: 1000
particleSize: 20 size: 20
particleSizeVariation: 4 sizeVariation: 4
particleEndSize: 12 endSize: 12
maxParticles: parent.width; emitCap: parent.width;
} }
Text { Text {

View File

@ -40,7 +40,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Item{ Item{
id: container id: container
@ -52,7 +52,7 @@ Item{
anchors.fill:parent anchors.fill:parent
overwrite: false overwrite: false
} }
DataParticle{ ModelParticle{
id: mp id: mp
fade: false fade: false
system: sys system: sys
@ -66,38 +66,38 @@ Item{
} }
} }
property real emitterSpacing: parent.width/3 property real emitterSpacing: parent.width/3
TrailEmitter{ Emitter{
system: sys system: sys
width: emitterSpacing - 64 width: emitterSpacing - 64
x: emitterSpacing*0 + 32 x: emitterSpacing*0 + 32
y: -128 y: -128
height: 32 height: 32
speed: PointVector{ y: (container.height + 128)/12 } speed: PointDirection{ y: (container.height + 128)/12 }
particlesPerSecond: 0.4 emitRate: 0.4
particleDuration: 1000000//eventually -1 should mean a million seconds for neatness lifeSpan: 1000000//eventually -1 should mean a million seconds for neatness
maxParticles: 15 emitCap: 15
} }
TrailEmitter{ Emitter{
system: sys system: sys
width: emitterSpacing - 64 width: emitterSpacing - 64
x: emitterSpacing*1 + 32 x: emitterSpacing*1 + 32
y: -128 y: -128
height: 32 height: 32
speed: PointVector{ y: (container.height + 128)/12 } speed: PointDirection{ y: (container.height + 128)/12 }
particlesPerSecond: 0.4 emitRate: 0.4
particleDuration: 1000000//eventually -1 should mean a million seconds for neatness lifeSpan: 1000000//eventually -1 should mean a million seconds for neatness
maxParticles: 15 emitCap: 15
} }
TrailEmitter{ Emitter{
system: sys system: sys
width: emitterSpacing - 64 width: emitterSpacing - 64
x: emitterSpacing*2 + 32 x: emitterSpacing*2 + 32
y: -128 y: -128
height: 32 height: 32
speed: PointVector{ y: (container.height + 128)/12 } speed: PointDirection{ y: (container.height + 128)/12 }
particlesPerSecond: 0.4 emitRate: 0.4
particleDuration: 1000000//eventually -1 should mean a million seconds for neatness lifeSpan: 1000000//eventually -1 should mean a million seconds for neatness
maxParticles: 15 emitCap: 15
} }
Kill{ Kill{
system: sys system: sys

View File

@ -40,7 +40,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Package { Package {
function photoClicked() { function photoClicked() {

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -40,7 +40,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
import "content" import "content"
Item { Item {
@ -56,21 +56,21 @@ Item {
id: bgParticles id: bgParticles
startTime: 16000 startTime: 16000
} }
ColoredParticle { ImageParticle {
particles: ["trail"] particles: ["trail"]
image: "content/images/particle.png" source: "content/images/particle.png"
color: "#1A1A6F" color: "#1A1A6F"
alpha: 0.1 alpha: 0.1
colorVariation: 0.01 colorVariation: 0.01
blueVariation: 0.8 blueVariation: 0.8
system: bgParticles system: bgParticles
} }
TrailEmitter { Emitter {
particle: "drops" particle: "drops"
width: parent.width width: parent.width
particlesPerSecond: 0.5 emitRate: 0.5
particleDuration: 20000 lifeSpan: 20000
speed: PointVector{ speed: PointDirection{
y: {screen.height/18} y: {screen.height/18}
} }
system: bgParticles system: bgParticles
@ -78,16 +78,16 @@ Item {
FollowEmitter { FollowEmitter {
follow: "drops" follow: "drops"
particle: "trail" particle: "trail"
particlesPerParticlePerSecond: 18 emitRatePerParticle: 18
particleSize: 32 size: 32
particleEndSize: 0 endSize: 0
particleSizeVariation: 4 sizeVariation: 4
particleDuration: 1200 lifeSpan: 1200
system: bgParticles system: bgParticles
anchors.fill: parent anchors.fill: parent
emissionWidth: 16 emitWidth: 16
emissionHeight: 16 emitHeight: 16
emissionShape: Ellipse{} emitShape: EllipseShape{}
} }
VisualDataModel{ VisualDataModel{

View File

@ -39,7 +39,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Item { Item {
id: container id: container
@ -53,20 +53,20 @@ Item {
width: 24 width: 24
height: 24 height: 24
TrailEmitter{ Emitter{
id: visualization id: visualization
particle: "blaster" particle: "blaster"
system: container.system system: container.system
emitting: show emitting: show
anchors.fill: parent anchors.fill: parent
shape: Ellipse{} shape: EllipseShape{}
speed: DirectedVector{ targetX: width/2; targetY: width/2; magnitude: -1; proportionalMagnitude: true} speed: TargetedDirection{ targetX: width/2; targetY: width/2; magnitude: -1; proportionalMagnitude: true}
particleDuration: 1000 lifeSpan: 1000
particlesPerSecond: 64 emitRate: 64
particleSize: 24 size: 24
particleSizeVariation: 24 sizeVariation: 24
particleEndSize: 0 endSize: 0
} }
property int blastsLeft: 0 property int blastsLeft: 0
@ -112,20 +112,20 @@ Item {
rofTimer.repeat = false; rofTimer.repeat = false;
} }
} }
TrailEmitter{ Emitter{
id: emitter id: emitter
particle: "blaster" particle: "blaster"
emitting: false emitting: false
system: container.system system: container.system
anchors.centerIn: parent anchors.centerIn: parent
particleDuration: 1000 lifeSpan: 1000
particlesPerSecond: 16 emitRate: 16
maxParticles: blasts emitCap: blasts
particleSize: 24 size: 24
particleEndSize:16 endSize:16
particleSizeVariation: 8 sizeVariation: 8
speed: DirectedVector{ speed: TargetedDirection{
id: blastVector id: blastVector
targetX: target.x; targetY: target.y; magnitude: 1.1; proportionalMagnitude: true targetX: target.x; targetY: target.y; magnitude: 1.1; proportionalMagnitude: true
} }

View File

@ -39,7 +39,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Item { Item {
id: container id: container
@ -49,17 +49,17 @@ Item {
width: 24 width: 24
height: 24 height: 24
TrailEmitter{ Emitter{
id: visualization id: visualization
particle: "cannon" particle: "cannon"
emitting: container.show emitting: container.show
system: container.system system: container.system
anchors.centerIn: parent anchors.centerIn: parent
particleDuration: 2000 lifeSpan: 2000
particlesPerSecond: 1 emitRate: 1
particleSize: 4 size: 4
particleEndSize: 0 endSize: 0
} }
function fireAt(targetArg, hardpoint){ function fireAt(targetArg, hardpoint){
@ -78,18 +78,18 @@ Item {
} }
emitter.burst(1); emitter.burst(1);
} }
TrailEmitter{ Emitter{
id: emitter id: emitter
particle: "cannon" particle: "cannon"
emitting: false emitting: false
system: container.system system: container.system
anchors.centerIn: parent anchors.centerIn: parent
particleDuration: 1000 lifeSpan: 1000
particlesPerSecond: 1 emitRate: 1
particleSize: 8 size: 8
particleEndSize: 4 endSize: 4
speed: DirectedVector{ speed: TargetedDirection{
id: blastVector id: blastVector
targetX: target.x; targetY: target.y; magnitude: 1.1; proportionalMagnitude: true targetX: target.x; targetY: target.y; magnitude: 1.1; proportionalMagnitude: true
} }

View File

@ -39,7 +39,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Item{ Item{
id: container id: container

View File

@ -39,7 +39,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Item { Item {
id: container id: container
@ -54,7 +54,7 @@ Item {
property int gunType: 0 property int gunType: 0
width: 128 width: 128
height: 128 height: 128
TrailEmitter{ Emitter{
//TODO: Cooler would be an 'orbiting' affector //TODO: Cooler would be an 'orbiting' affector
//TODO: On the subject, opacity and size should be grouped type 'overLife' if we can cram that in the particles //TODO: On the subject, opacity and size should be grouped type 'overLife' if we can cram that in the particles
system: container.system system: container.system
@ -62,30 +62,30 @@ Item {
anchors.centerIn: parent anchors.centerIn: parent
width: 64 width: 64
height: 64 height: 64
shape: Ellipse{} shape: EllipseShape{}
particlesPerSecond: hp > 0 ? hp * 1 + 20 : 0 emitRate: hp > 0 ? hp * 1 + 20 : 0
particleDuration: 2400 lifeSpan: 2400
maxParticles: (maxHP * 1 + 20)*2.4 emitCap: (maxHP * 1 + 20)*2.4
particleSize: 48 size: 48
particleSizeVariation: 16 sizeVariation: 16
particleEndSize: 16 endSize: 16
speed: AngleVector{angleVariation:360; magnitudeVariation: 32} speed: AngledDirection{angleVariation:360; magnitudeVariation: 32}
} }
TrailEmitter{ Emitter{
system: container.system system: container.system
particle: "cruiserArmor" particle: "cruiserArmor"
anchors.fill: parent anchors.fill: parent
shape: Ellipse{ fill: false } shape: EllipseShape{ fill: false }
emitting: hp>0 emitting: hp>0
particlesPerSecond: 16 emitRate: 16
particleDuration: 2000 lifeSpan: 2000
particleSize: 48 size: 48
particleSizeVariation: 24 sizeVariation: 24
SpriteGoal{ SpriteGoal{
id: destructor id: destructor

View File

@ -39,7 +39,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Item { Item {
id: container id: container
@ -54,29 +54,29 @@ Item {
property int gunType: 0 property int gunType: 0
width: 128 width: 128
height: 128 height: 128
TrailEmitter{ Emitter{
system: container.system system: container.system
particle: "frigateShield" particle: "frigateShield"
anchors.centerIn: parent anchors.centerIn: parent
particleSize: 92 size: 92
particlesPerSecond: 1 emitRate: 1
particleDuration: 4800 lifeSpan: 4800
emitting: hp > 0 emitting: hp > 0
} }
TrailEmitter{ Emitter{
system: container.system system: container.system
particle: container.shipParticle particle: container.shipParticle
anchors.centerIn: parent anchors.centerIn: parent
width: 64 width: 64
height: 16 height: 16
shape: Ellipse{} shape: EllipseShape{}
particleSize: 16 size: 16
particleSizeVariation: 8 sizeVariation: 8
particleEndSize: 8 endSize: 8
particlesPerSecond: hp > 0 ? hp * 1 + 20 : 0 emitRate: hp > 0 ? hp * 1 + 20 : 0
particleDuration: 1200 lifeSpan: 1200
maxParticles: (maxHP * 1 + 20)*2 emitCap: (maxHP * 1 + 20)*2
} }
Timer{ Timer{
id: fireControl id: fireControl

View File

@ -39,7 +39,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Item { Item {
id: container id: container

View File

@ -39,7 +39,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
SequentialLoader { SequentialLoader {
id: hLdr id: hLdr

View File

@ -39,7 +39,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Item { Item {
id: container id: container
@ -49,20 +49,20 @@ Item {
width: 24 width: 24
height: 24 height: 24
TrailEmitter{ Emitter{
id: visualization id: visualization
particle: "laser" particle: "laser"
system: container.system system: container.system
anchors.fill: parent anchors.fill: parent
emitting: container.show emitting: container.show
shape: Ellipse{} shape: EllipseShape{}
speed: DirectedVector{ targetX: width/2; targetY: width/2; magnitude: -1; proportionalMagnitude: true } speed: TargetedDirection{ targetX: width/2; targetY: width/2; magnitude: -1; proportionalMagnitude: true }
particleDuration: 1000 lifeSpan: 1000
particlesPerSecond: 64 emitRate: 64
particleSize: 24 size: 24
particleSizeVariation: 8 sizeVariation: 8
particleEndSize: 8 endSize: 8
} }
function fireAt(targetArg, hardpoint){ function fireAt(targetArg, hardpoint){
@ -84,7 +84,7 @@ Item {
emitter.pulse(0.10); emitter.pulse(0.10);
// console.log("Fire box: " + Math.min(container.width/2, target.x) + "," + Math.min(container.height/2, target.y) + " " + (Math.max(container.width/2, target.x) - Math.min(container.width/2, target.x)) + "," + (Math.max(container.height/2, target.y) - Math.min(container.height/2, target.y))); // console.log("Fire box: " + Math.min(container.width/2, target.x) + "," + Math.min(container.height/2, target.y) + " " + (Math.max(container.width/2, target.x) - Math.min(container.width/2, target.x)) + "," + (Math.max(container.height/2, target.y) - Math.min(container.height/2, target.y)));
} }
TrailEmitter{ Emitter{
id: emitter id: emitter
particle: "laser" particle: "laser"
emitting: false emitting: false
@ -93,16 +93,16 @@ Item {
width: Math.max(container.width/2, target.x) - x; width: Math.max(container.width/2, target.x) - x;
y: Math.min(container.height/2, target.y); y: Math.min(container.height/2, target.y);
height: Math.max(container.height/2, target.y) - y; height: Math.max(container.height/2, target.y) - y;
shape: Line{ shape: LineShape{
mirrored: (emitter.y < 0 || emitter.x < 0) && !(emitter.y < 0 && emitter.x < 0 )//I just want XOR mirrored: (emitter.y < 0 || emitter.x < 0) && !(emitter.y < 0 && emitter.x < 0 )//I just want XOR
} }
particleDuration: 1000 lifeSpan: 1000
particlesPerSecond: 8000 emitRate: 8000
maxParticles: 800 emitCap: 800
particleSize: 16 size: 16
particleEndSize: 0 endSize: 0
speed: PointVector{xVariation: 4; yVariation: 4} speed: PointDirection{xVariation: 4; yVariation: 4}
} }
} }

View File

@ -39,87 +39,87 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Item{ Item{
property ParticleSystem sys property ParticleSystem sys
ColoredParticle{ ImageParticle{
system: sys system: sys
particles: ["default"] particles: ["default"]
image: "pics/blur-circle3.png" source: "pics/blur-circle3.png"
color: "#003A3A3A" color: "#003A3A3A"
colorVariation: 0.1 colorVariation: 0.1
z: 0 z: 0
} }
ColoredParticle{ ImageParticle{
system: sys system: sys
particles: ["redTeam"] particles: ["redTeam"]
image: "pics/blur-circle3.png" source: "pics/blur-circle3.png"
color: "#0028060A" color: "#0028060A"
colorVariation: 0.1 colorVariation: 0.1
z: 0 z: 0
} }
ColoredParticle{ ImageParticle{
system: sys system: sys
particles: ["greenTeam"] particles: ["greenTeam"]
image: "pics/blur-circle3.png" source: "pics/blur-circle3.png"
color: "#0006280A" color: "#0006280A"
colorVariation: 0.1 colorVariation: 0.1
z: 0 z: 0
} }
ColoredParticle{ ImageParticle{
system: sys system: sys
particles: ["blaster"] particles: ["blaster"]
image: "pics/star2.png" source: "pics/star2.png"
//color: "#0F282406" //color: "#0F282406"
color: "#0F484416" color: "#0F484416"
colorVariation: 0.2 colorVariation: 0.2
z: 2 z: 2
} }
ColoredParticle{ ImageParticle{
system: sys system: sys
particles: ["laser"] particles: ["laser"]
image: "pics/star3.png" source: "pics/star3.png"
//color: "#00123F68" //color: "#00123F68"
color: "#00428FF8" color: "#00428FF8"
colorVariation: 0.2 colorVariation: 0.2
z: 2 z: 2
} }
ColoredParticle{ ImageParticle{
system: sys system: sys
particles: ["cannon"] particles: ["cannon"]
image: "pics/particle.png" source: "pics/particle.png"
color: "#80FFAAFF" color: "#80FFAAFF"
colorVariation: 0.1 colorVariation: 0.1
z: 2 z: 2
} }
ColoredParticle{ ImageParticle{
system: sys system: sys
particles: ["cannonCore"] particles: ["cannonCore"]
image: "pics/particle.png" source: "pics/particle.png"
color: "#00666666" color: "#00666666"
colorVariation: 0.8 colorVariation: 0.8
z: 1 z: 1
} }
ColoredParticle{ ImageParticle{
system: sys system: sys
particles: ["cannonWake"] particles: ["cannonWake"]
image: "pics/star.png" source: "pics/star.png"
color: "#00CCCCCC" color: "#00CCCCCC"
colorVariation: 0.2 colorVariation: 0.2
z: 1 z: 1
} }
ColoredParticle{ ImageParticle{
system: sys system: sys
particles: ["frigateShield"] particles: ["frigateShield"]
image: "pics/blur-circle2.png" source: "pics/blur-circle2.png"
color: "#00000000" color: "#00000000"
colorVariation: 0.05 colorVariation: 0.05
blueVariation: 0.5 blueVariation: 0.5
greenVariation: 0.1 greenVariation: 0.1
z: 3 z: 3
} }
SpriteParticle{ ImageParticle{
system: sys system: sys
particles: ["cruiserArmor"] particles: ["cruiserArmor"]
z: 1 z: 1
@ -148,12 +148,12 @@ Item{
system: sys system: sys
particle: "cannonWake" particle: "cannonWake"
follow: "cannon" follow: "cannon"
particlesPerParticlePerSecond: 64 emitRatePerParticle: 64
particleDuration: 600 lifeSpan: 600
speed: AngleVector{ angleVariation: 360; magnitude: 48} speed: AngledDirection{ angleVariation: 360; magnitude: 48}
particleSize: 16 size: 16
particleEndSize: 8 endSize: 8
particleSizeVariation: 2 sizeVariation: 2
emitting: true emitting: true
width: 1000//XXX: Terrible hack width: 1000//XXX: Terrible hack
height: 1000 height: 1000
@ -162,10 +162,10 @@ Item{
system: sys system: sys
particle: "cannonCore" particle: "cannonCore"
follow: "cannon" follow: "cannon"
particlesPerParticlePerSecond: 256 emitRatePerParticle: 256
particleDuration: 128 lifeSpan: 128
particleSize: 24 size: 24
particleEndSize: 8 endSize: 8
emitting: true emitting: true
width: 1000//XXX: Terrible hack width: 1000//XXX: Terrible hack
height: 1000 height: 1000

View File

@ -39,7 +39,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Item { Item {
id: me id: me

View File

@ -39,7 +39,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Item { Item {
id: container id: container
@ -55,23 +55,23 @@ Item {
property int gunType: 0 property int gunType: 0
width: 128 width: 128
height: 128 height: 128
TrailEmitter{ Emitter{
id: emitter id: emitter
//TODO: Cooler would be an 'orbiting' affector //TODO: Cooler would be an 'orbiting' affector
//TODO: On the subject, opacity and size should be grouped type 'overLife' if we can cram that in the particles //TODO: On the subject, opacity and size should be grouped type 'overLife' if we can cram that in the particles
system: container.system system: container.system
particle: container.shipParticle particle: container.shipParticle
shape: Ellipse{} shape: EllipseShape{}
particlesPerSecond: hp > 0 ? hp + 20 : 0 emitRate: hp > 0 ? hp + 20 : 0
particleDuration: blinkInterval lifeSpan: blinkInterval
maxParticles: (maxHP + 20) emitCap: (maxHP + 20)
acceleration: AngleVector{angleVariation: 360; magnitude: 8} acceleration: AngledDirection{angleVariation: 360; magnitude: 8}
particleSize: 24 size: 24
particleEndSize: 4 endSize: 4
particleSizeVariation: 8 sizeVariation: 8
width: 16 width: 16
height: 16 height: 16
x: 64 x: 64

View File

@ -39,7 +39,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
import "content" import "content"
Rectangle { Rectangle {
@ -93,18 +93,18 @@ Rectangle {
id: title id: title
width: root.width width: root.width
height: 240 height: 240
TrailEmitter{ Emitter{
anchors.fill: parent anchors.fill: parent
system: particles system: particles
emitting: true emitting: true
particle: "default" particle: "default"
particlesPerSecond: 1200 emitRate: 1200
particleDuration: 1200 lifeSpan: 1200
shape: Mask{source:"content/pics/TitleText.png"} shape: MaskShape{source:"content/pics/TitleText.png"}
particleSize: 16 size: 16
particleEndSize: 0 endSize: 0
particleSizeVariation: 8 sizeVariation: 8
speed: AngleVector{angleVariation:360; magnitudeVariation: 6} speed: AngledDirection{angleVariation:360; magnitudeVariation: 6}
} }
} }
Button{ Button{

View File

@ -40,7 +40,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Item { Item {
id: block id: block
@ -71,7 +71,7 @@ Item {
Behavior on opacity { NumberAnimation { duration: 200 } } Behavior on opacity { NumberAnimation { duration: 200 } }
anchors.fill: parent anchors.fill: parent
} }
TrailEmitter { Emitter {
id: particles id: particles
system: particleSystem system: particleSystem
particle: { particle: {
@ -85,14 +85,14 @@ Item {
} }
anchors.fill: parent anchors.fill: parent
speed: DirectedVector{targetX: block.width/2; targetY: block.height/2; magnitude: -60; magnitudeVariation: 60} speed: TargetedDirection{targetX: block.width/2; targetY: block.height/2; magnitude: -60; magnitudeVariation: 60}
shape: Ellipse{fill:true} shape: EllipseShape{fill:true}
emitting: false; emitting: false;
particleDuration: 700; particleDurationVariation: 100 lifeSpan: 700; lifeSpanVariation: 100
particlesPerSecond: 1000 emitRate: 1000
maxParticles: 100 //only fires 0.1s bursts (still 2x old number, ColoredParticle wants less than 16000 max though) emitCap: 100 //only fires 0.1s bursts (still 2x old number, ImageParticle wants less than 16000 max though)
particleSize: 28 size: 28
particleEndSize: 14 endSize: 14
} }
states: [ states: [

View File

@ -40,7 +40,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
import "SamegameCore" import "SamegameCore"
import "SamegameCore/samegame.js" as Logic import "SamegameCore/samegame.js" as Logic
@ -77,27 +77,27 @@ Rectangle {
} }
Item{ Item{
ParticleSystem{ id: particleSystem; } ParticleSystem{ id: particleSystem; }
ColoredParticle { ImageParticle {
system: particleSystem system: particleSystem
particles: ["red"] particles: ["red"]
color: Qt.darker("red");//Actually want desaturated... color: Qt.darker("red");//Actually want desaturated...
image: "SamegameCore/pics/particle.png" source: "SamegameCore/pics/particle.png"
colorVariation: 0.4 colorVariation: 0.4
alpha: 0.1 alpha: 0.1
} }
ColoredParticle { ImageParticle {
system: particleSystem system: particleSystem
particles: ["green"] particles: ["green"]
color: Qt.darker("green");//Actually want desaturated... color: Qt.darker("green");//Actually want desaturated...
image: "SamegameCore/pics/particle.png" source: "SamegameCore/pics/particle.png"
colorVariation: 0.4 colorVariation: 0.4
alpha: 0.1 alpha: 0.1
} }
ColoredParticle { ImageParticle {
system: particleSystem system: particleSystem
particles: ["blue"] particles: ["blue"]
color: Qt.darker("blue");//Actually want desaturated... color: Qt.darker("blue");//Actually want desaturated...
image: "SamegameCore/pics/particle.png" source: "SamegameCore/pics/particle.png"
colorVariation: 0.4 colorVariation: 0.4
alpha: 0.1 alpha: 0.1
} }

View File

@ -42,8 +42,8 @@ import "ImageProviderCore" // import the plugin that registers the color image p
//![0] //![0]
Column { Column {
Image { source: "image://colors/yellow" } Image { source: "source://colors/yellow" }
Image { source: "image://colors/red" } Image { source: "source://colors/red" }
} }
//![0] //![0]

View File

@ -0,0 +1,16 @@
import QmlProject 1.0
Project {
/* Include .qml, .js, and image files from current directory and subdirectories */
QmlFiles {
directory: "."
}
JavaScriptFiles {
directory: "."
}
ImageFiles {
directory: "."
}
/* List of plugin directories passed to QML runtime */
// importPaths: [ " ../exampleplugin " ]
}

View File

@ -0,0 +1,256 @@
import QtQuick 2.0
Rectangle {
id: root
color: "grey"
width: 720
height: 380
Component {
id: draggedText
Text {
x: rootTarget.dragX - 10
y: rootTarget.dragY - 10
width: 20
height: 20
text: rootTarget.dragData.display
font.pixelSize: 18
}
}
DragTarget {
id: rootTarget
anchors.fill: parent
}
Loader {
anchors.fill: parent
sourceComponent: rootTarget.containsDrag ? draggedText : undefined
}
GridView {
id: gridView
width: 240
height: 360
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
anchors.margins: 10
cellWidth: 60
cellHeight: 60
model: ListModel {
id: gridModel
ListElement { display: "1" }
ListElement { display: "2" }
ListElement { display: "3" }
ListElement { display: "4" }
ListElement { display: "5" }
ListElement { display: "6" }
ListElement { display: "7" }
ListElement { display: "8" }
ListElement { display: "9" }
ListElement { display: "10" }
ListElement { display: "11" }
ListElement { display: "12" }
ListElement { display: "13" }
ListElement { display: "14" }
ListElement { display: "15" }
ListElement { display: "16" }
ListElement { display: "17" }
ListElement { display: "18" }
ListElement { display: "19" }
ListElement { display: "20" }
ListElement { display: "21" }
ListElement { display: "22" }
ListElement { display: "23" }
ListElement { display: "24" }
}
delegate: Rectangle {
id: root
width: 60
height: 60
color: "black"
Text {
anchors.fill: parent
color: draggable.drag.active ? "gold" : "white"
text: display
font.pixelSize: 16
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
}
MouseArea {
id: draggable
property int initialIndex
width: 60
height: 60
drag.data: model
drag.keys: ["grid"]
drag.target: draggable
states: State {
when: !draggable.drag.active
PropertyChanges { target: draggable; x: 0; y: 0 }
}
}
}
DragTarget {
anchors.fill: parent
keys: [ "grid" ]
onPositionChanged: {
var index = gridView.indexAt(drag.x, drag.y)
if (index != -1)
gridModel.move(drag.data.index, index, 1)
}
}
DragTarget {
property int dragIndex
anchors.fill: parent
keys: [ "list" ]
onEntered: {
dragIndex = gridView.indexAt(drag.x, drag.y)
if (dragIndex != -1) {
gridModel.insert(dragIndex, { "display": drag.data.display })
} else {
event.accepted = false
}
}
onPositionChanged: {
var index = gridView.indexAt(drag.x, drag.y);
if (index != -1) {
gridModel.move(dragIndex, index, 1)
dragIndex = index
}
}
onExited: gridModel.remove(dragIndex, 1)
}
}
ListView {
id: listView
width: 240
height: 360
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.margins: 10
model: ListModel {
id: listModel
ListElement { display: "a" }
ListElement { display: "b" }
ListElement { display: "c" }
ListElement { display: "d"}
ListElement { display: "e" }
ListElement { display: "f" }
ListElement { display: "g" }
ListElement { display: "h" }
ListElement { display: "i" }
ListElement { display: "j" }
ListElement { display: "k" }
ListElement { display: "l" }
ListElement { display: "m" }
ListElement { display: "n" }
ListElement { display: "o" }
ListElement { display: "p" }
ListElement { display: "q" }
ListElement { display: "r" }
ListElement { display: "s" }
ListElement { display: "t" }
ListElement { display: "u" }
ListElement { display: "v" }
ListElement { display: "w" }
ListElement { display: "x" }
}
delegate: Rectangle {
id: root
width: 240
height: 15
color: "black"
Text {
anchors.fill: parent
color: draggable.drag.active ? "gold" : "white"
text: display
font.pixelSize: 12
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
}
MouseArea {
id: draggable
width: 240
height: 15
drag.data: model
drag.keys: ["list"]
drag.target: draggable
states: State {
when: !draggable.drag.active
PropertyChanges { target: draggable; x: 0; y: 0 }
}
}
}
DragTarget {
anchors.fill: parent
keys: [ "list" ]
onPositionChanged: {
var index = listView.indexAt(drag.x, drag.y)
if (index != -1)
listModel.move(drag.data.index, index, 1)
}
}
DragTarget {
property int dragIndex
anchors.fill: parent
keys: [ "grid" ]
onEntered: {
dragIndex = listView.indexAt(drag.x, drag.y)
if (dragIndex != -1) {
listModel.insert(dragIndex, { "display": drag.data.display })
} else {
event.accepted = false
}
}
onPositionChanged: {
var index = listView.indexAt(drag.x, drag.y);
if (index != -1) {
listModel.move(dragIndex, index, 1)
dragIndex = index
}
}
onExited: listModel.remove(dragIndex, 1)
}
}
}

View File

@ -0,0 +1,16 @@
import QmlProject 1.0
Project {
/* Include .qml, .js, and image files from current directory and subdirectories */
QmlFiles {
directory: "."
}
JavaScriptFiles {
directory: "."
}
ImageFiles {
directory: "."
}
/* List of plugin directories passed to QML runtime */
// importPaths: [ " ../exampleplugin " ]
}

View File

@ -0,0 +1,142 @@
import QtQuick 2.0
Item {
id: root
width: 320; height: 480
Rectangle {
id: inputRect
anchors.left: parent.left; anchors.right: parent.right; anchors.top: parent.top
anchors.margins: 2
height: input.implicitHeight + 4
border.width: 1
TextInput {
id: input
anchors.fill: parent; anchors.margins: 2
text: "the quick brown fox jumped over the lazy dog"
DragTarget {
id: inputTarget
anchors.fill: parent
Component {
id: draggedInputText
Text {
x: inputTarget.dragX
y: inputTarget.dragY
text: inputTarget.dragData
color: "blue"
font: input.font
}
}
Loader {
sourceComponent: parent.containsDrag ? draggedInputText : undefined
}
}
MouseArea {
id: inputDraggable
anchors.fill: parent
enabled: input.selectionStart != input.selectionEnd
drag.data: input.selectedText
drag.target: inputDraggable
drag.onDragged: {
var position = input.positionAt(mouse.x);
mouse.accepted = position >= input.selectionStart && position < input.selectionEnd
}
MouseArea {
anchors.fill: parent
onPressed: {
var position = input.positionAt(mouse.x);
if (position < input.selectionStart || position >= input.selectionEnd) {
input.cursorPosition = position
} else {
mouse.accepted = false
}
}
onPositionChanged: input.moveCursorSelection(input.positionAt(mouse.x))
}
}
}
}
Rectangle {
id: editRect
anchors.left: parent.left; anchors.right: parent.right;
anchors.top: inputRect.bottom; anchors.bottom: parent.bottom
anchors.margins: 2
border.width: 1
TextEdit {
id: edit
anchors.fill: parent; anchors.margins: 2
text: "the quick brown fox jumped over the lazy dog"
font.pixelSize: 18
wrapMode: TextEdit.WordWrap
DragTarget {
id: editTarget
anchors.fill: parent
Component {
id: draggedEditText
Text {
x: editTarget.dragX
y: editTarget.dragY
text: editTarget.dragData
color: "red"
font: edit.font
}
}
Loader {
sourceComponent: parent.containsDrag ? draggedEditText : undefined
}
}
MouseArea {
id: editDraggable
anchors.fill: parent
enabled: edit.selectionStart != edit.selectionEnd
drag.data: edit.selectedText
drag.target: editDraggable
drag.onDragged: {
var position = edit.positionAt(mouse.x, mouse.y);
mouse.accepted = position >= edit.selectionStart && position < edit.selectionEnd
}
MouseArea {
anchors.fill: parent
onPressed: {
var position = edit.positionAt(mouse.x, mouse.y);
if (position < edit.selectionStart || position >= edit.selectionEnd) {
edit.cursorPosition = position
} else {
mouse.accepted = false
}
}
onPositionChanged: edit.moveCursorSelection(edit.positionAt(mouse.x, mouse.y))
}
}
}
}
}

View File

@ -0,0 +1,16 @@
import QmlProject 1.0
Project {
/* Include .qml, .js, and image files from current directory and subdirectories */
QmlFiles {
directory: "."
}
JavaScriptFiles {
directory: "."
}
ImageFiles {
directory: "."
}
/* List of plugin directories passed to QML runtime */
// importPaths: [ " ../exampleplugin " ]
}

View File

@ -0,0 +1,59 @@
import QtQuick 2.0
Rectangle {
id: dragRectangle
property Item dropTarget
property string colorKey
color: colorKey
width: 100; height: 100
Text {
anchors.fill: parent
color: "white"
font.pixelSize: 90
text: modelData + 1
horizontalAlignment:Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
MouseArea {
id: draggable
anchors.fill: parent
drag.target: parent
drag.keys: [ colorKey ]
drag.onDropped: dropTarget = dropItem
states: [
State {
when: dragRectangle.dropTarget != undefined && !draggable.drag.active
ParentChange {
target: dragRectangle
parent: dropTarget
x: 0
y: 0
}
},
State {
when: dragRectangle.dropTarget != undefined && draggable.drag.active
ParentChange {
target: dragRectangle
parent: dropTarget
}
},
State {
when: !draggable.drag.active
AnchorChanges {
target: dragRectangle
anchors.horizontalCenter: parent.horizontalCenter
}
}
]
}
}

View File

@ -0,0 +1,30 @@
import QtQuick 2.0
Rectangle {
id: dropRectangle
property string colorKey
color: colorKey
width: 100; height: 100
DragTarget {
id: dragTarget
anchors.fill: parent
keys: [ colorKey ]
dropItem: dropRectangle
}
states: [
State {
when: dragTarget.containsDrag
PropertyChanges {
target: dropRectangle
color: "grey"
}
}
]
}

View File

@ -0,0 +1,85 @@
import QtQuick 2.0
Rectangle {
id: root
width: 620
height: 410
color: "black"
DragTarget {
id: resetTarget
anchors.fill: parent
}
Grid {
id: redDestination
anchors.left: redSource.right; anchors.top: parent.top;
anchors.margins: 5
width: 300
height: 300
opacity: 0.5
columns: 3
Repeater {
model: 9
delegate: DropTile {
colorKey: "red"
}
}
}
Grid {
id: blueDestination
anchors.right: blueSource.left; anchors.bottom: parent.bottom;
anchors.margins: 5
width: 300
height: 300
opacity: 0.5
columns: 3
Repeater {
model: 9
delegate: DropTile {
colorKey: "blue"
}
}
}
Column {
id: redSource
anchors.left: parent.left; anchors.top: parent.top; anchors.bottom: parent.bottom
anchors.margins: 5
width: 100
Repeater {
model: 9
delegate: DragTile {
colorKey: "red"
}
}
}
Column {
id: blueSource
anchors.right: parent.right; anchors.top: parent.top; anchors.bottom: parent.bottom
anchors.margins: 5
width: 100
Repeater {
model: 9
delegate: DragTile {
colorKey: "blue"
}
}
}
}

View File

@ -0,0 +1,26 @@
import QtQuick 2.0
import QtQuick.Particles 2.0
Rectangle{
color: "goldenrod"
width: 2000
height: 2000
ParticleSystem{id: sys}
ImageParticle{
id: up
system: sys
source: "content/singlesmile.png"
}
Emitter{
anchors.centerIn: parent
system: sys
emitRate: 1000
size: 20
lifeSpan: 10000
speed: AngledDirection{angleVariation: 360; magnitudeVariation: 100;}
}
MouseArea{
anchors.fill: parent
onClicked: up.autoRotation = !up.autoRotation
}
}

View File

@ -39,35 +39,101 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Rectangle{ Rectangle{
id: root
color: "white" color: "white"
width: 310 width: 310
height: 300 height: 300
ParticleSystem{ id: sys } ParticleSystem{ id: sys }
Picture{ CustomParticle{
system: sys system: sys
anchors.fill: parent property real maxWidth: root.width
image: "content/singlesmile.png" property real maxHeight: root.height
onceOff: true ShaderEffectSource{
id: pictureSource
sourceItem: picture
hideSource: true
}
Image{
id: picture
source: "content/singlesmile.png"
}
ShaderEffectSource{
id: particleSource
sourceItem: particle
hideSource: true
}
Image{
id: particle
source: "content/particle.png"
}
vertexShader:"
attribute highp vec2 vPos;
attribute highp vec2 vTex;
attribute highp vec4 vData; // x = time, y = lifeSpan, z = size, w = endSize
attribute highp vec4 vVec; // x,y = constant speed, z,w = acceleration
attribute highp float r;
uniform highp float maxWidth;
uniform highp float maxHeight;
uniform highp mat4 qt_ModelViewProjectionMatrix;
uniform highp float timestamp;
uniform lowp float qt_Opacity;
varying highp vec2 fTex;
varying highp vec2 fTex2;
varying lowp float fFade;
void main() {
fTex = vTex;
fTex2 = vec2(vPos.x / maxWidth, vPos.y / maxHeight);
highp float size = vData.z;
highp float endSize = vData.w;
highp float t = (timestamp - vData.x) / vData.y;
highp float currentSize = mix(size, endSize, t * t);
if (t < 0. || t > 1.)
currentSize = 0.;
highp vec2 pos = vPos
- currentSize / 2. + currentSize * vTex // adjust size
+ vVec.xy * t * vData.y // apply speed vector..
+ 0.5 * vVec.zw * pow(t * vData.y, 2.);
gl_Position = qt_ModelViewProjectionMatrix * vec4(pos.x, pos.y, 0, 1);
highp float fadeIn = min(t * 10., 1.);
highp float fadeOut = 1. - max(0., min((t - 0.75) * 4., 1.));
fFade = fadeIn * fadeOut * qt_Opacity;
}
"
property variant particleTexture: particleSource
property variant pictureTexture: pictureSource
fragmentShader: "
uniform sampler2D particleTexture;
uniform sampler2D pictureTexture;
varying highp vec2 fTex;
varying highp vec2 fTex2;
varying highp float fFade;
void main() {
gl_FragColor = texture2D(pictureTexture, fTex2) * texture2D(particleTexture, fTex).w * fFade;
}"
} }
ColoredParticle{ Emitter{
system: sys
image: "content/particle.png"
color: "black"
alpha: 0.4
sizeTable: "content/sizeInOut.png"
}
TrailEmitter{
id: emitter id: emitter
system: sys system: sys
emitting: false emitting: false
particleDuration: 4000 lifeSpan: 4000
maxParticles: 1200 emitCap: 1200
anchors.fill: parent anchors.fill: parent
particleSize: 32 size: 32
speed: PointVector{ xVariation: 12; yVariation: 12 } speed: PointDirection{ xVariation: 12; yVariation: 12 }
} }
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent

View File

@ -39,27 +39,27 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Rectangle{ Rectangle{
color: "goldenrod" color: "goldenrod"
width: 400 width: 400
height: 400 height: 400
ParticleSystem{id:sys} ParticleSystem{id:sys}
DeformableParticle{ ImageParticle{
system: sys system: sys
particles: ["goingLeft", "goingRight"] particles: ["goingLeft", "goingRight"]
image: "content/singlesmile.png" source: "content/singlesmile.png"
rotation: 90 rotation: 90
rotationSpeed: 90 rotationSpeed: 90
autoRotation: true autoRotation: true
} }
DeformableParticle{ ImageParticle{
system: sys system: sys
particles: ["goingDown"] particles: ["goingDown"]
image: "content/squarefacespriteXX.png" source: "content/squarefacespriteXX.png"
rotation: 180 rotation: 180
yVector: PointVector{ y: 0.5; yVariation: 0.25; xVariation: 0.25; } yVector: PointDirection{ y: 0.5; yVariation: 0.25; xVariation: 0.25; }
} }
Timer{ Timer{
running: true running: true
@ -79,40 +79,40 @@ Rectangle{
interval: 8400 interval: 8400
onTriggered: emitC.emitting = true; onTriggered: emitC.emitting = true;
} }
TrailEmitter{ Emitter{
id: emitA id: emitA
x: 0 x: 0
y: 120 y: 120
system: sys system: sys
emitting: false emitting: false
particle: "goingRight" particle: "goingRight"
speed: PointVector{ x: 100 } speed: PointDirection{ x: 100 }
particleDuration: 4000 lifeSpan: 4000
particlesPerSecond: 2 emitRate: 2
particleSize: 32 size: 32
} }
TrailEmitter{ Emitter{
id: emitB id: emitB
x: 400 x: 400
y: 240 y: 240
system: sys system: sys
emitting: false emitting: false
particle: "goingLeft" particle: "goingLeft"
speed: PointVector{ x: -100 } speed: PointDirection{ x: -100 }
particleDuration: 4000 lifeSpan: 4000
particlesPerSecond: 2 emitRate: 2
particleSize: 32 size: 32
} }
TrailEmitter{ Emitter{
id: emitC id: emitC
x: 0 x: 0
y: 360 y: 360
system: sys system: sys
emitting: false emitting: false
particle: "goingDown" particle: "goingDown"
speed: PointVector{ x: 100 } speed: PointDirection{ x: 100 }
particleDuration: 4000 lifeSpan: 4000
particlesPerSecond: 2 emitRate: 2
particleSize: 32 size: 32
} }
} }

View File

@ -39,60 +39,60 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Rectangle{ Rectangle{
color: "goldenrod" color: "goldenrod"
width: 400 width: 400
height: 400 height: 400
ColoredParticle{ ImageParticle{
id: test id: test
particles: ["Test"] particles: ["Test"]
image: "content/particle.png" source: "content/particle.png"
system: sys system: sys
z: 2 z: 2
anchors.fill: parent anchors.fill: parent
color: "#336666CC" color: "#336666CC"
colorVariation: 0.0 colorVariation: 0.0
} }
SpriteParticle{ ImageParticle{
id: single id: single
particles: ["Face"] particles: ["Face"]
system: sys system: sys
z: 2 z: 2
anchors.fill: parent anchors.fill: parent
Sprite{ sprites: Sprite{
source: "content/squarefacesprite.png" source: "content/squarefacesprite.png"
frames: 6 frames: 6
duration: 120 duration: 120
} }
} }
Mask{ MaskShape{
id: mask id: mask
source: "content/smileMask.png" source: "content/smileMask.png"
} }
TrailEmitter{ Emitter{
system: sys system: sys
particle: "Test" particle: "Test"
anchors.fill: parent anchors.fill: parent
id: particles2 id: particles2
particlesPerSecond: 6000 emitRate: 6000
particleDuration: 720 lifeSpan: 720
emitting: true emitting: true
particleSize: 10 size: 10
shape: mask shape: mask
} }
TrailEmitter{ Emitter{
system: sys system: sys
particle: "Face" particle: "Face"
anchors.fill: parent anchors.fill: parent
id: particles id: particles
particlesPerSecond: 60 emitRate: 60
particleDuration: 1440 lifeSpan: 1440
emitting: true emitting: true
speed: PointVector{xVariation: 10; yVariation: 10;} speed: PointDirection{xVariation: 10; yVariation: 10;}
particleSize: 30 size: 30
particleSizeVariation: 10 sizeVariation: 10
shape: mask shape: mask
} }
ParticleSystem{ ParticleSystem{

View File

@ -39,7 +39,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Rectangle{ Rectangle{
color: "goldenrod" color: "goldenrod"
@ -109,7 +109,7 @@ Rectangle{
z:4 z:4
} }
ParticleSystem{ id: sys } ParticleSystem{ id: sys }
SpriteParticle{ ImageParticle{
anchors.fill: parent anchors.fill: parent
id: particles id: particles
system: sys system: sys
@ -168,15 +168,15 @@ Rectangle{
duration: 10000 duration: 10000
}] }]
} }
TrailEmitter{ Emitter{
system: sys system: sys
particlesPerSecond: 16 emitRate: 16
particleDuration: 10000 lifeSpan: 10000
emitting: true emitting: true
speed: AngleVector{angle: 90; magnitude: 60; angleVariation: 5} speed: AngledDirection{angle: 90; magnitude: 60; angleVariation: 5}
acceleration: PointVector{ y: 10 } acceleration: PointDirection{ y: 10 }
particleSize: 30 size: 30
particleSizeVariation: 10 sizeVariation: 10
width: parent.width width: parent.width
height: 100 height: 100
} }

View File

@ -39,14 +39,14 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Rectangle{ Rectangle{
color: "goldenrod" color: "goldenrod"
width: 800 width: 800
height: 800 height: 800
ParticleSystem{ id: sys } ParticleSystem{ id: sys }
SpriteParticle{ ImageParticle{
system: sys system: sys
anchors.fill: parent anchors.fill: parent
sprites: [Sprite{ sprites: [Sprite{
@ -92,17 +92,17 @@ Rectangle{
duration: 120 duration: 120
}] }]
} }
TrailEmitter{ Emitter{
id: particleEmitter id: particleEmitter
system: sys system: sys
width: parent.width width: parent.width
particlesPerSecond: 16 emitRate: 16
particleDuration: 8000 lifeSpan: 8000
emitting: true emitting: true
speed: AngleVector{angle: 90; magnitude: 300; magnitudeVariation: 100; angleVariation: 5} speed: AngledDirection{angle: 90; magnitude: 300; magnitudeVariation: 100; angleVariation: 5}
acceleration: PointVector{ y: 10 } acceleration: PointDirection{ y: 10 }
particleSize: 30 size: 30
particleSizeVariation: 10 sizeVariation: 10
} }
Binding{ Binding{
target: particleEmitter target: particleEmitter

View File

@ -39,7 +39,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Rectangle{ Rectangle{
color: "white" color: "white"
@ -48,7 +48,7 @@ Rectangle{
ParticleSystem{ ParticleSystem{
id: sys id: sys
} }
UltraParticle{ ImageParticle{
sprites: [ sprites: [
Sprite{ Sprite{
name: "licking" name: "licking"
@ -80,16 +80,16 @@ Rectangle{
factor: 0.1 factor: 0.1
system: sys system: sys
} }
TrailEmitter{ Emitter{
system: sys system: sys
anchors.centerIn: parent anchors.centerIn: parent
id: particles id: particles
particlesPerSecond: 200 emitRate: 200
particleDuration: 6000 lifeSpan: 6000
emitting: true emitting: true
speed: AngleVector{angleVariation: 360; magnitude: 80; magnitudeVariation: 40} speed: AngledDirection{angleVariation: 360; magnitude: 80; magnitudeVariation: 40}
particleSize: 40 size: 40
particleEndSize: 80 endSize: 80
} }
Text{ Text{
x: 16 x: 16

View File

@ -38,8 +38,8 @@
** **
****************************************************************************/ ****************************************************************************/
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
import Qt.labs.particles 2.0 as Qlp import QtQuick.Particles 2.0 as Qlp
import QtQuick 2.0 import QtQuick 2.0
Item { Item {
@ -65,42 +65,42 @@ Item {
} }
} }
ColoredParticle { ImageParticle {
system: sys system: sys
particles: ["starfield"] particles: ["starfield"]
image: "content/star.png" source: "content/star.png"
colorVariation: 0.3 colorVariation: 0.3
color: "white" color: "white"
} }
TrailEmitter { Emitter {
id: starField id: starField
system: sys system: sys
particle: "starfield" particle: "starfield"
particlesPerSecond: 80 emitRate: 80
particleDuration: 2500 lifeSpan: 2500
anchors.centerIn: parent anchors.centerIn: parent
//acceleration: AngleVector{angleVariation: 360; magnitude: 200}//Is this a better effect, more consistent speed? //acceleration: AngledDirection{angleVariation: 360; magnitude: 200}//Is this a better effect, more consistent speed?
acceleration: PointVector{ xVariation: 200; yVariation: 200; } acceleration: PointDirection{ xVariation: 200; yVariation: 200; }
particleSize: 0 size: 0
particleEndSize: 80 endSize: 80
particleSizeVariation: 10 sizeVariation: 10
} }
TrailEmitter{ Emitter{
system: sys system: sys
particle: "meteor" particle: "meteor"
particlesPerSecond: 12 emitRate: 12
particleDuration: 5000 lifeSpan: 5000
emitting: true emitting: true
acceleration: PointVector{ xVariation: 80; yVariation: 80; } acceleration: PointDirection{ xVariation: 80; yVariation: 80; }
particleSize: 15 size: 15
particleEndSize: 300 endSize: 300
anchors.centerIn: parent anchors.centerIn: parent
} }
SpriteParticle{ ImageParticle{
system: sys system: sys
particles: ["meteor"] particles: ["meteor"]
sprites:[Sprite{ sprites:[Sprite{
@ -168,11 +168,11 @@ Item {
} }
} }
ColoredParticle{ ImageParticle{
z:0 z:0
system: sys system: sys
particles: ["exhaust"] particles: ["exhaust"]
image: "content/particle4.png" source: "content/particle4.png"
color: "orange" color: "orange"
SequentialAnimation on color { SequentialAnimation on color {
@ -191,23 +191,23 @@ Item {
colorVariation: 0.2 colorVariation: 0.2
} }
TrailEmitter{ Emitter{
id: trailsNormal2 id: trailsNormal2
system: sys system: sys
particle: "exhaust" particle: "exhaust"
particlesPerSecond: 300 emitRate: 300
particleDuration: 500 lifeSpan: 500
y: holder.y y: holder.y
x: holder.x x: holder.x
speed: PointVector{ xVariation: 40; yVariation: 40; } speed: PointDirection{ xVariation: 40; yVariation: 40; }
speedFromMovement: 16 speedFromMovement: 16
acceleration: PointVector{ xVariation: 10; yVariation: 10; } acceleration: PointDirection{ xVariation: 10; yVariation: 10; }
particleSize: 4 size: 4
particleSizeVariation: 4 sizeVariation: 4
} }
} }

View File

@ -39,7 +39,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Rectangle{ Rectangle{
id: root id: root
@ -65,41 +65,42 @@ Rectangle{
} }
} }
TrailEmitter{ Emitter{
particle: "stars" particle: "stars"
system: particles system: particles
particlesPerSecond: 40 emitRate: 40
particleDuration: 4000 lifeSpan: 4000
emitting: true emitting: true
particleSize: 30 size: 30
particleSizeVariation: 10 sizeVariation: 10
speed: PointVector{ x: 220; xVariation: 40 } speed: PointDirection{ x: 220; xVariation: 40 }
height: parent.height height: parent.height
} }
TrailEmitter{ Emitter{
particle: "roids" particle: "roids"
system: particles system: particles
particlesPerSecond: 10 emitRate: 10
particleDuration: 4000 lifeSpan: 4000
emitting: true emitting: true
particleSize: 30 size: 30
particleSizeVariation: 10 sizeVariation: 10
speed: PointVector{ x: 220; xVariation: 40 } speed: PointDirection{ x: 220; xVariation: 40 }
height: parent.height height: parent.height
} }
ParticleSystem{ ParticleSystem{
id: particles id: particles
anchors.fill: parent anchors.fill: parent
} }
ColoredParticle{ ImageParticle{
id: stars id: stars
particles: ["stars"] particles: ["stars"]
system: particles system: particles
image: "content/star.png" source: "content/star.png"
color: "white" color: "white"
colorVariation: 0.1 colorVariation: 0.1
alpha: 0
} }
SpriteParticle{ ImageParticle{
id: roids id: roids
particles: ["roids"] particles: ["roids"]
system: particles system: particles
@ -112,20 +113,20 @@ Rectangle{
speedModifiesDuration: -0.1 speedModifiesDuration: -0.1
} }
} }
ColoredParticle{ ImageParticle{
id: shot id: shot
particles: ["shot"] particles: ["shot"]
system: particles system: particles
image: "content/star.png" source: "content/star.png"
color: "#0FF06600" color: "#0FF06600"
colorVariation: 0.3 colorVariation: 0.3
} }
ColoredParticle{ ImageParticle{
id: engine id: engine
particles: ["engine"] particles: ["engine"]
system: particles system: particles
image: "content/particle4.png" source: "content/particle4.png"
color: "orange" color: "orange"
SequentialAnimation on color { SequentialAnimation on color {
@ -144,9 +145,11 @@ Rectangle{
colorVariation: 0.2 colorVariation: 0.2
} }
GravitationalSingularity{ PointAttractor{
id: gs; x: root.width/2; y: root.height/2; strength: 4000000; id: gs; x: root.width/2; y: root.height/2; strength: 4000000;
system: particles system: particles
physics: PointAttractor.Acceleration
proportionalToDistance: PointAttractor.Quadratic
} }
Kill{ Kill{
system: particles system: particles
@ -166,27 +169,27 @@ Rectangle{
drag.axis: Drag.XandYAxis drag.axis: Drag.XandYAxis
drag.target: ship drag.target: ship
} }
TrailEmitter{ Emitter{
particle: "engine" particle: "engine"
system: particles system: particles
particlesPerSecond: 200 emitRate: 200
particleDuration: 1000 lifeSpan: 1000
emitting: true emitting: true
particleSize: 10 size: 10
particleEndSize: 4 endSize: 4
particleSizeVariation: 4 sizeVariation: 4
speed: PointVector{ x: -128; xVariation: 32 } speed: PointDirection{ x: -128; xVariation: 32 }
height: parent.height height: parent.height
width: 20 width: 20
} }
TrailEmitter{ Emitter{
particle: "shot" particle: "shot"
system: particles system: particles
particlesPerSecond: 32 emitRate: 32
particleDuration: 2000 lifeSpan: 2000
emitting: spacePressed emitting: spacePressed
particleSize: 40 size: 40
speed: PointVector{ x: 256; } speed: PointDirection{ x: 256; }
x: parent.width x: parent.width
y: parent.height/2 y: parent.height/2
} }

View File

@ -0,0 +1,165 @@
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
** the names of its contributors may be used to endorse or promote
** products derived from this software without specific prior written
** permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
import QtQuick.Particles 2.0
Rectangle{
color: "white"
width: 240
height: 360
ParticleSystem{
id: sys
}
Emitter{
system:sys
height: parent.height
emitRate: 1
lifeSpan: 12000
speed: PointDirection{x:20;}
size: 64
}
ShaderEffectSource{
id: theSource
sourceItem: theItem
hideSource: true
}
Image{
id: theItem
source: "content/smile.png"
}
CustomParticle{
system: sys
//TODO: Someway that you don't have to rewrite the basics for a simple addition
vertexShader:"
attribute highp vec2 vPos;
attribute highp vec2 vTex;
attribute highp vec4 vData; // x = time, y = lifeSpan, z = size, w = endSize
attribute highp vec4 vVec; // x,y = constant speed, z,w = acceleration
attribute highp float r;
uniform highp mat4 qt_ModelViewProjectionMatrix;
uniform highp float timestamp;
uniform lowp float qt_Opacity;
varying highp vec2 fTex;
varying lowp float fFade;
varying lowp float fBlur;
void main() {
fTex = vTex;
highp float size = vData.z;
highp float endSize = vData.w;
highp float t = (timestamp - vData.x) / vData.y;
highp float currentSize = mix(size, endSize, t * t);
if (t < 0. || t > 1.)
currentSize = 0.;
highp vec2 pos = vPos
- currentSize / 2. + currentSize * vTex // adjust size
+ vVec.xy * t * vData.y // apply speed vector..
+ 0.5 * vVec.zw * pow(t * vData.y, 2.);
gl_Position = qt_ModelViewProjectionMatrix * vec4(pos.x, pos.y, 0, 1);
highp float fadeIn = min(t * 10., 1.);
highp float fadeOut = 1. - max(0., min((t - 0.75) * 4., 1.));
fFade = fadeIn * fadeOut * qt_Opacity;
fBlur = max(0.2 * t, t * r);
}
"
property variant source: theSource
property variant blurred: ShaderEffectSource {
smooth: true
sourceItem: ShaderEffectItem {
width: theItem.width
height: theItem.height
property variant delta: Qt.size(0.0, 1.0 / height)
property variant source: ShaderEffectSource {
smooth: true
sourceItem: ShaderEffectItem {
width: theItem.width
height: theItem.height
property variant delta: Qt.size(1.0 / width, 0.0)
property variant source: theSource
fragmentShader: "
uniform sampler2D source;
uniform highp vec2 delta;
varying highp vec2 qt_TexCoord0;
void main() {
gl_FragColor = 0.0538 * texture2D(source, qt_TexCoord0 - 3.182 * delta)
+ 0.3229 * texture2D(source, qt_TexCoord0 - 1.364 * delta)
+ 0.2466 * texture2D(source, qt_TexCoord0)
+ 0.3229 * texture2D(source, qt_TexCoord0 + 1.364 * delta)
+ 0.0538 * texture2D(source, qt_TexCoord0 + 3.182 * delta);
}"
}
}
fragmentShader: "
uniform sampler2D source;
uniform highp vec2 delta;
varying highp vec2 qt_TexCoord0;
void main() {
gl_FragColor = 0.0538 * texture2D(source, qt_TexCoord0 - 3.182 * delta)
+ 0.3229 * texture2D(source, qt_TexCoord0 - 1.364 * delta)
+ 0.2466 * texture2D(source, qt_TexCoord0)
+ 0.3229 * texture2D(source, qt_TexCoord0 + 1.364 * delta)
+ 0.0538 * texture2D(source, qt_TexCoord0 + 3.182 * delta);
}"
}
}
fragmentShader: "
uniform sampler2D source;
uniform sampler2D blurred;
varying highp vec2 fTex;
varying highp float fBlur;
varying highp float fFade;
void main() {
gl_FragColor = mix(texture2D(source, fTex), texture2D(blurred, fTex), min(1.0,fBlur*3.0)) * fFade;
}"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 861 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -39,42 +39,66 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Rectangle{ Rectangle{
width: 360 width: 360
height: 540 height: 600
id: root color: "black"
ParticleSystem{ id: particles } Component{
SpriteParticle{ id: firework
system: particles Item{
sprites: Sprite{ id: container
name: "snow" width: 48
source: "content/flake-01.png" height: 48
frames: 51 Image{
duration: 40 width: 48
height: 48
id: img
source: "content/particle.png"
}
Timer{
interval: 1000 + 4000*Math.random()
running: true
repeat: false
onTriggered: {
img.visible = false;
emitter.burst(100);
}
}
Emitter{
anchors.centerIn: parent
id: emitter
system: syssy
particle: "works"
emitting: false
emitRate: 100
lifeSpan: 1000
//speed: AngledDirection{angle: 270; angleVariation:60; magnitudeVariation: 60; magnitude: 20}
speed: PointDirection{y:-60; yVariation: 80; xVariation: 80}
acceleration: PointDirection{y:100; yVariation: 20}
}
} }
} }
Drift{ ParticleSystem{
system: particles
anchors.fill: parent anchors.fill: parent
xDrift: 200 id: syssy
} Emitter{
SpeedLimit{ particle: "fire"
system: particles width: parent.width
anchors.fill: parent y: parent.height
speedLimit: 100 emitRate: 2
} lifeSpan: 6000
TrailEmitter{ speed: PointDirection{y:-100}
system: particles }
particlesPerSecond: 20 ItemParticle{
particleDuration: 7000 particles: ["fire"]
emitting: true delegate: firework
speed: PointVector{ y:80; yVariation: 40; } }
acceleration: PointVector{ y: 4 } ImageParticle{
particleSize: 20 particles: ["works"]
particleSizeVariation: 10 source: "content/particle.png"
width: parent.width }
height: 40
} }
} }

View File

@ -0,0 +1,84 @@
import QtQuick 2.0
import QtQuick.Particles 2.0
ParticleSystem{
id: root
width: 1024
height: 768
Rectangle{
z: -1
anchors.fill: parent
color: "black"
Text{
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
font.pixelSize: 36
color: "white"
text: "It's all in the fragment shader."
}
}
Emitter{
emitRate: 400
lifeSpan: 8000
size: 24
sizeVariation: 16
speed: PointDirection{x: root.width/10; y: root.height/10;}
//acceleration: AngledDirection{angle:225; magnitude: root.width/36; angleVariation: 45; magnitudeVariation: 80}
acceleration: PointDirection{x: -root.width/40; y: -root.height/40; xVariation: -root.width/20; yVariation: -root.width/20}
}
CustomParticle{
//TODO: Someway that you don't have to rewrite the basics for a simple addition
vertexShader:"
attribute highp vec2 vPos;
attribute highp vec2 vTex;
attribute highp vec4 vData; // x = time, y = lifeSpan, z = size, w = endSize
attribute highp vec4 vVec; // x,y = constant speed, z,w = acceleration
attribute highp float r;
uniform highp mat4 qt_ModelViewProjectionMatrix;
uniform highp float timestamp;
uniform lowp float qt_Opacity;
varying highp vec2 fTex;
varying lowp float fFade;
varying highp vec2 fPos;
void main() {
fTex = vTex;
highp float size = vData.z;
highp float endSize = vData.w;
highp float t = (timestamp - vData.x) / vData.y;
highp float currentSize = mix(size, endSize, t * t);
if (t < 0. || t > 1.)
currentSize = 0.;
highp vec2 pos = vPos
- currentSize / 2. + currentSize * vTex // adjust size
+ vVec.xy * t * vData.y // apply speed vector..
+ 0.5 * vVec.zw * pow(t * vData.y, 2.);
gl_Position = qt_ModelViewProjectionMatrix * vec4(pos.x, pos.y, 0, 1);
highp float fadeIn = min(t * 20., 1.);
highp float fadeOut = 1. - max(0., min((t - 0.75) * 4., 1.));
fFade = fadeIn * fadeOut * qt_Opacity;
fPos = vec2(pos.x/1024., pos.y/768.);
}
"
fragmentShader: "
varying highp vec2 fPos;
varying lowp float fFade;
varying highp vec2 fTex;
void main() {//*2 because this generates dark colors mostly
highp vec2 circlePos = fTex*2.0 - vec2(1.0,1.0);
highp float dist = length(circlePos);
highp float circleFactor = max(min(1.0 - dist, 1.0), 0.0);
gl_FragColor = vec4(fPos.x*2.0 - fPos.y, fPos.y*2.0 - fPos.x, fPos.x*fPos.y*2.0, 0.0) * circleFactor * fFade;
}"
}
}

View File

@ -0,0 +1,116 @@
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
** the names of its contributors may be used to endorse or promote
** products derived from this software without specific prior written
** permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
import QtQuick.Particles 2.0
import "launcherContent/launcher.js" as Util
import "launcherContent"
Rectangle{
color: "black"
width: 360
height: 600
Shell{
z: 1
id: shell
anchors.fill: parent
}
VisualDataModel{//TODO: Transitions between modes
id: vdm
model: [
"../spaceexplorer/spaceexplorer.qml",
"../snow/snow.qml",
"../asteroid/asteroid.qml",
"../asteroid/blackhole.qml",
"../custom/blurparticles.qml",
"../modelparticles/bubbles.qml",
"../modelparticles/gridsplosion.qml",
"../modelparticles/package.qml",
"../modelparticles/stream.qml",
"../allsmiles/plain.qml",
"../allsmiles/smile.qml",
"../allsmiles/smilefactory.qml",
"../allsmiles/ultraparticles.qml",
"../allsmiles/spriteparticles.qml",
"../allsmiles/spritestateparticles.qml",
"../allsmiles/spritevariedparticles.qml",
"../trails/velocityfrommotion.qml",
"../trails/fireballs.qml",
"../trails/list.qml",
"../trails/portal.qml",
"../trails/rainbow.qml",
"../trails/dynamicemitters.qml",
"../trails/overburst.qml",
"../trails/layered.qml",
"../trails/shimmer.qml",
"../trails/turbulence.qml",
"../../../../demos/declarative/samegame/samegame.qml",
"../../../../demos/declarative/plasmapatrol/plasmapatrol.qml",
"../../../../demos/declarative/flickr/flickr.qml"
]
delegate: Rectangle{
color: "white"
width: 96
height: 96
Image{
width: 72
height: 72
anchors.centerIn: parent
source: Util.iconFromPath(modelData)
}
Text{
text: Util.nameFromPath(modelData)
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
font.pixelSize: 8
}
MouseArea{
anchors.fill: parent
onClicked: shell.setDemo(modelData)
}
}
}
GridView{
anchors.fill: parent
cellWidth: 120
cellHeight: 120
model: vdm
}
}

View File

@ -39,40 +39,35 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 as QLP
Rectangle{ Rectangle {
width: 200 id: container
height: 200
color: "black" property string text: "Button"
QLP.ParticleSystem{ id: ps } signal clicked
QLP.ColoredParticle{
system: ps width: buttonLabel.width + 20; height: buttonLabel.height + 20
particles: ["star1","star2"] smooth: true
anchors.fill: parent property color myCol: "#999999"
clip: true border { width: 1; color: Qt.darker(myCol) }
image: "content/star.png" radius: 8
gradient: Gradient {
GradientStop {
position: 0.0
color: {
if (mouseArea.pressed)
return Qt.darker(myCol)
else
return Qt.lighter(myCol)
}
}
GradientStop { position: 1.0; color: myCol }
} }
QLP.Swarm{
system: ps MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() }
leaders: ["star2"];
anchors.fill: parent Text {
strength: 128 id: buttonLabel; text: container.text; anchors.centerIn: container; color: "black"; font.pixelSize: 24
}
QLP.TrailEmitter{
anchors.fill: parent
system: ps
particle: "star1"
particlesPerSecond: 100
particleDuration: 2000
}
QLP.TrailEmitter{
anchors.fill: parent
system: ps
particle: "star2"
particlesPerSecond: 0.4
particleDuration: 10000
particleSize: 64
particleEndSize: 32
} }
} }

View File

@ -39,36 +39,40 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0
Rectangle{ Loader{
width: 360 id: ldr
height: 540 visible: false
ParticleSystem{ id: particles } focus: visible
SpriteParticle{ onVisibleChanged: source = ""
system: particles opacity: visible?1:0
Sprite{ Behavior on opacity{NumberAnimation{}}
name: "snow"
source: "content/flake-01.png" function setDemo(str){
frames: 51 visible = true;
duration: 40 source = str;
}
Image{//TODO: Augment with PARTICLES
z: 1
source: "icons/close.png"
MouseArea{
anchors.fill: parent
onClicked: ldr.visible = false;
} }
} }
Drift{ Rectangle{
system: particles z: -1
anchors.fill: parent anchors.fill: parent
xDrift: 400; color:"black"
} Text{
TrailEmitter{ color: "white"
system: particles anchors.centerIn: parent
particlesPerSecond: 20 text: ldr.Status == Loader.Error ? "Error :(" : "Loading..."
particleDuration: 7000 }
emitting: true MouseArea{
speed: PointVector{ y:80; yVariation: 40; } id: graball
acceleration: PointVector{ y: 4 } anchors.fill: parent
particleSize: 20 onClicked:;
particleSizeVariation: 10 }
width: parent.width
height: 100
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1019 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -0,0 +1,8 @@
function nameFromPath(path){
var ret = path.split('/');
return ret[ret.length-1].split('.')[0];
}
function iconFromPath(path){
var ret = path.split('/');
return "launcherContent/icons/" + ret[ret.length-1].split('.')[0] + ".png";
}

View File

@ -39,7 +39,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
import "../../modelviews/listview/content" as OtherDemo import "../../modelviews/listview/content" as OtherDemo
import "content/script.js" as Script import "content/script.js" as Script
import "content" import "content"
@ -56,21 +56,22 @@ Item{
ParticleSystem{ ParticleSystem{
id: sys; id: sys;
} }
TrailEmitter{ Emitter{
system: sys system: sys
particle: "A" particle: "A"
width: parent.width/2 width: parent.width/2
x: parent.width/4 x: parent.width/4
y:parent.height y:parent.height
speed: PointVector{ y: -64; yVariation: 16 } speed: PointDirection{ y: -64; yVariation: 16 }
particlesPerSecond: 1 emitRate: 1
particleDuration: 8000 lifeSpan: 8000
} }
Drift{ Wander{
system: sys system: sys
xDrift: 200 xVariance: 400
pace: 200
} }
DataParticle{ ModelParticle{
id: mp id: mp
z: 0 z: 0
system: sys system: sys

View File

@ -39,7 +39,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
import "content" import "content"
Item{ Item{
@ -48,13 +48,14 @@ Item{
height: 240 height: 240
property bool inGrid: false property bool inGrid: false
ParticleSystem{ id: sys } ParticleSystem{ id: sys }
TrailEmitter{ Emitter{
system: sys system: sys
id: burster; id: burster;
emitting: false emitting: false
particlesPerSecond: 1000 emitRate: 1000
particleDuration: 500 lifeSpan: 50000
speed: PointVector{xVariation: 400; yVariation: 400} emitCap: 100;
speed: PointDirection{xVariation: 400; yVariation: 400}
anchors.centerIn: parent anchors.centerIn: parent
Timer{ Timer{
interval: 1000 interval: 1000
@ -69,9 +70,9 @@ Item{
onTriggered: {inGrid = true;}// sys.running = false;} onTriggered: {inGrid = true;}// sys.running = false;}
} }
} }
ColoredParticle{ ImageParticle{
system: sys system: sys
image: "../trails/content/particle.png" source: "../trails/content/particle.png"
color: "black" color: "black"
colorVariation: 0.0 colorVariation: 0.0
} }
@ -80,17 +81,14 @@ Item{
width: 120 width: 120
height: 120 height: 120
} }
DataParticle{ ModelParticle{
system: sys system: sys
model: theModel.parts.particles model: theModel.parts.particles
fade: false
} }
Friction{ Friction{
system: sys system: sys
factor: 1 factor: 5
}
Stasis{
system: sys
targetLife: 400
} }
VisualDataModel{ VisualDataModel{
id: theModel id: theModel

View File

@ -39,7 +39,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
import "content" import "content"
Rectangle { Rectangle {
@ -69,7 +69,7 @@ Rectangle {
width: 200; height:200 width: 200; height:200
model: visualModel.parts.list model: visualModel.parts.list
} }
DataParticle{ ModelParticle{
x: 200; width: 200; height:200 x: 200; width: 200; height:200
model: visualModel.parts.grid model: visualModel.parts.grid
system: sys system: sys
@ -80,12 +80,12 @@ Rectangle {
id: sys id: sys
anchors.fill: parent anchors.fill: parent
} }
TrailEmitter{ Emitter{
system: sys system: sys
width: 100 width: 100
x: 50 x: 50
speed: PointVector{ y: 40 } speed: PointDirection{ y: 40 }
particleDuration: 5000 lifeSpan: 5000
particlesPerSecond: 1.6 emitRate: 1.6
} }
} }

View File

@ -39,7 +39,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
import "content/script.js" as Script import "content/script.js" as Script
import "content" import "content"
@ -68,15 +68,15 @@ Item{
overwrite: false overwrite: false
startTime: 12000//Doesn't actually work with the loading time though... startTime: 12000//Doesn't actually work with the loading time though...
} }
TrailEmitter{ Emitter{
id: emitter id: emitter
system: sys system: sys
height: parent.height - 132/2 height: parent.height - 132/2
x: -132/2 x: -132/2
y: 132/2 y: 132/2
speed: PointVector{ x: 32; xVariation: 8 } speed: PointDirection{ x: 32; xVariation: 8 }
particlesPerSecond: 0.5 emitRate: 0.5
particleDuration: 120000 //TODO: A -1 or something which does 'infinite'? (but need disable fade first) lifeSpan: 120000 //TODO: A -1 or something which does 'infinite'? (but need disable fade first)
particle: "photos" particle: "photos"
} }
Kill{ Kill{
@ -85,10 +85,10 @@ Item{
height: parent.height height: parent.height
width: 1000 width: 1000
} }
ColoredParticle{ ImageParticle{
system: sys system: sys
particles: ["fireworks"] particles: ["fireworks"]
image: "../trails/content/star.png" source: "../trails/content/star.png"
color: "lightsteelblue" color: "lightsteelblue"
alpha: 0 alpha: 0
colorVariation: 0 colorVariation: 0
@ -125,7 +125,7 @@ Item{
} }
property Item alertItem; property Item alertItem;
function alert(){ function alert(){
resetter.active = false //resetter.active = false
force.active = true; force.active = true;
alertItem = alertDelegate.createObject(root); alertItem = alertDelegate.createObject(root);
alertItem.x = root.width/2 - alertItem.width/2 alertItem.x = root.width/2 - alertItem.width/2
@ -142,34 +142,30 @@ Item{
interval: 800 interval: 800
onTriggered: { onTriggered: {
force.active = false force.active = false
resetter.active = true; //resetter.active = true;
mp.take(alertItem, true); mp.take(alertItem, true);
centerEmitter.burst(1); centerEmitter.burst(1);
} }
} }
Attractor{ PointAttractor{
id: force id: force
system: sys system: sys
x: root.width/2 x: root.width/2
y: root.height/2 y: root.height/2
strength: -30000 strength: -10000
active: false active: false
anchors.centerIn: parent anchors.centerIn: parent
width: parent.width/2 width: parent.width/2
height: parent.height/2 height: parent.height/2
particles:["photos"] particles:["photos"]
physics: PointAttractor.Position
} }
Reset{ Emitter{
id: resetter
system: sys
particles:["photos"]
}
TrailEmitter{
id: centerEmitter id: centerEmitter
speed: PointVector{ x: 32; xVariation: 8;} speed: PointDirection{ x: 32; xVariation: 8;}
particlesPerSecond: 0.5 emitRate: 0.5
particleDuration: 12000 //TODO: A -1 or something which does 'infinite'? (but need disable fade first) lifeSpan: 12000 //TODO: A -1 or something which does 'infinite'? (but need disable fade first)
maxParticles: 20 emitCap: 20
particle: "photos" particle: "photos"
system: sys system: sys
anchors.centerIn: parent anchors.centerIn: parent
@ -177,22 +173,22 @@ Item{
//TODO: Zoom in effect //TODO: Zoom in effect
} }
TrailEmitter{ Emitter{
id: spawnFireworks id: spawnFireworks
particle: "fireworks" particle: "fireworks"
system: sys system: sys
maxParticles: 400 emitCap: 400
particlesPerSecond: 400 emitRate: 400
particleDuration: 2800 lifeSpan: 2800
x: parent.width/2 x: parent.width/2
y: parent.height/2 - 64 y: parent.height/2 - 64
width: 8 width: 8
height: 8 height: 8
emitting: false emitting: false
particleSize: 32 size: 32
particleEndSize: 8 endSize: 8
speed: AngleVector{ magnitude: 160; magnitudeVariation: 120; angleVariation: 90; angle: 270 } speed: AngledDirection{ magnitude: 160; magnitudeVariation: 120; angleVariation: 90; angle: 270 }
acceleration: PointVector{ y: 160 } acceleration: PointDirection{ y: 160 }
} }
Item{ x: -1000; y: -1000 //offscreen Item{ x: -1000; y: -1000 //offscreen
Repeater{//Load them here, add to system on completed Repeater{//Load them here, add to system on completed

View File

@ -39,15 +39,17 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
import "content"
import "../launcherContent" as UI
Rectangle{ Rectangle{
width: 360 width: 360
height: 540 height: 540
ParticleSystem { id: particles } ParticleSystem { id: particles }
SpriteParticle { ImageParticle {
system: particles system: particles
Sprite{ sprites: Sprite{
name: "snow" name: "snow"
source: "content/flake-01.png" source: "content/flake-01.png"
frames: 51 frames: 51
@ -55,21 +57,38 @@ Rectangle{
} }
} }
Wander { Wander {
id: wanderer
system: particles system: particles
anchors.fill: parent anchors.fill: parent
xVariance: 40; xVariance: 360/(wanderer.physics+1);
pace: 40; pace: 100*(wanderer.physics+1);
} }
TrailEmitter { Emitter {
system: particles system: particles
particlesPerSecond: 20 emitRate: 20
particleDuration: 7000 lifeSpan: 7000
emitting: true emitting: true
speed: PointVector{ y:80; yVariation: 40; } speed: PointDirection{ y:80; yVariation: 40; }
acceleration: PointVector{ y: 4 } acceleration: PointDirection{ y: 4 }
particleSize: 20 size: 20
particleSizeVariation: 10 sizeVariation: 10
width: parent.width width: parent.width
height: 100 height: 100
} }
Row{
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
UI.Button{
text:"dx/dt"
onClicked: wanderer.physics = Wander.Position;
}
UI.Button{
text:"dv/dt"
onClicked: wanderer.physics = Wander.Velocity;
}
UI.Button{
text:"da/dt"
onClicked: wanderer.physics = Wander.Acceleration;
}
}
} }

View File

@ -39,7 +39,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
import "content/helpers.js" as Helpers import "content/helpers.js" as Helpers
Rectangle{ Rectangle{
@ -75,22 +75,22 @@ Rectangle{
property bool fakeMoving: false property bool fakeMoving: false
property real fakeMovementDir: 0 property real fakeMovementDir: 0
TrailEmitter{ Emitter{
particle: "stars2" particle: "stars2"
system: background system: background
particlesPerSecond: 60 emitRate: 60
particleDuration: 4000 lifeSpan: 4000
emitting: true emitting: true
particleSize: 10 size: 10
particleSizeVariation: 10 sizeVariation: 10
anchors.fill: parent anchors.fill: parent
} }
ParticleSystem{ id: background } ParticleSystem{ id: background }
ColoredParticle{ ImageParticle{
particles: ["stars2"] particles: ["stars2"]
system: background system: background
anchors.fill: parent anchors.fill: parent
image: "content/star.png" source: "content/star.png"
color: "white" color: "white"
colorVariation: 0.1 colorVariation: 0.1
} }
@ -197,29 +197,29 @@ Rectangle{
ParticleSystem{ id: foreground } ParticleSystem{ id: foreground }
ColoredParticle{ ImageParticle{
particles: ["stars"] particles: ["stars"]
anchors.fill: parent anchors.fill: parent
system: foreground system: foreground
image: "content/star.png" source: "content/star.png"
color: "white" color: "white"
colorVariation: 0.1 colorVariation: 0.1
} }
ColoredParticle{ ImageParticle{
particles: ["shot"] particles: ["shot"]
anchors.fill: parent anchors.fill: parent
system: foreground system: foreground
image: "content/star.png" source: "content/star.png"
color: "orange" color: "orange"
colorVariation: 0.3 colorVariation: 0.3
} }
ColoredParticle{ ImageParticle{
id: engine id: engine
particles: ["engine"] particles: ["engine"]
anchors.fill: parent anchors.fill: parent
system: foreground system: foreground
image: "content/particle4.png" source: "content/particle4.png"
color: "orange" color: "orange"
SequentialAnimation on color { SequentialAnimation on color {
@ -238,30 +238,31 @@ Rectangle{
colorVariation: 0.2 colorVariation: 0.2
} }
SpriteParticle{ ImageParticle{
particles: ["powerups"] particles: ["powerups"]
anchors.fill: parent anchors.fill: parent
system: foreground system: foreground
Sprite{ sprites:[Sprite{
name: "norm" name: "norm"
source: "content/powerupScore.png" source: "content/powerupScore.png"
frames: 35 frames: 35
duration: 40 duration: 40
to: {"norm":1, "got":0} to: {"norm":1, "got":0}
} },
Sprite{ Sprite{
name: "got" name: "got"
source: "content/powerupScore_got.png" source: "content/powerupScore_got.png"
frames: 22 frames: 22
duration: 40 duration: 40
to: {"null":1} to: {"null":1}
} },
Sprite{ Sprite{
name: "null" name: "null"
source: "content/powerupScore_gone.png" source: "content/powerupScore_gone.png"
frames: 1 frames: 1
duration: 1000 duration: 1000
} }
]
} }
SpriteGoal{ SpriteGoal{
x: rocket.x - 30 x: rocket.x - 30
@ -273,8 +274,9 @@ Rectangle{
onAffected: if(!gameOver) score += 1000 onAffected: if(!gameOver) score += 1000
system: foreground system: foreground
} }
GravitationalSingularity{ PointAttractor{
id: gs1; x: vorteX; y: vorteY; strength: 800000; id: gs1; x: vorteX; y: vorteY; strength: 800000;
proportionalToDistance: PointAttractor.Quadratic;
system: foreground system: foreground
} }
Kill{ Kill{
@ -285,8 +287,9 @@ Rectangle{
system: foreground system: foreground
} }
GravitationalSingularity{ PointAttractor{
id: gs2; x: vorteX2; y: vorteY2; strength: 800000; id: gs2; x: vorteX2; y: vorteY2; strength: 800000;
proportionalToDistance: PointAttractor.Quadratic;
system: foreground system: foreground
} }
Kill{ Kill{
@ -297,8 +300,9 @@ Rectangle{
system: foreground system: foreground
} }
GravitationalSingularity{ PointAttractor{
id: gs3; x: vorteX3; y: vorteY3; strength: 800000; id: gs3; x: vorteX3; y: vorteY3; strength: 800000;
proportionalToDistance: PointAttractor.Quadratic;
system: foreground system: foreground
} }
Kill{ Kill{
@ -308,8 +312,9 @@ Rectangle{
height: holeSize * 2 height: holeSize * 2
system: foreground system: foreground
} }
GravitationalSingularity{ PointAttractor{
id: gs4; x: vorteX4; y: vorteY4; strength: 800000; id: gs4; x: vorteX4; y: vorteY4; strength: 800000;
proportionalToDistance: PointAttractor.Quadratic;
system: foreground system: foreground
} }
Kill{ Kill{
@ -319,24 +324,24 @@ Rectangle{
height: holeSize * 2 height: holeSize * 2
system: foreground system: foreground
} }
TrailEmitter{ Emitter{
particle: "powerups" particle: "powerups"
system: foreground system: foreground
particlesPerSecond: 1 emitRate: 1
particleDuration: 6000 lifeSpan: 6000
emitting: !gameOver emitting: !gameOver
particleSize: 60 size: 60
particleSizeVariation: 10 sizeVariation: 10
anchors.fill: parent anchors.fill: parent
} }
TrailEmitter{ Emitter{
particle: "stars" particle: "stars"
system: foreground system: foreground
particlesPerSecond: 40 emitRate: 40
particleDuration: 4000 lifeSpan: 4000
emitting: !gameOver emitting: !gameOver
particleSize: 30 size: 30
particleSizeVariation: 10 sizeVariation: 10
anchors.fill: parent anchors.fill: parent
} }
SpriteImage{ SpriteImage{
@ -374,16 +379,16 @@ Rectangle{
drag.axis: Drag.XandYAxis drag.axis: Drag.XandYAxis
drag.target: rocket drag.target: rocket
}, },
TrailEmitter{ Emitter{
system: foreground system: foreground
particle: "engine" particle: "engine"
particlesPerSecond: 100 emitRate: 100
particleDuration: 1000 lifeSpan: 1000
emitting: !gameOver emitting: !gameOver
particleSize: 10 size: 10
particleEndSize: 4 endSize: 4
particleSizeVariation: 4 sizeVariation: 4
speed: PointVector{ speed: PointDirection{
x: -128 * Math.cos(rocket.rotation * (Math.PI / 180)) x: -128 * Math.cos(rocket.rotation * (Math.PI / 180))
y: -128 * Math.sin(rocket.rotation * (Math.PI / 180)) y: -128 * Math.sin(rocket.rotation * (Math.PI / 180))
} }
@ -392,14 +397,14 @@ Rectangle{
width: 4 width: 4
}, },
TrailEmitter{ Emitter{
system: foreground system: foreground
particle: "shot" particle: "shot"
particlesPerSecond: 16 emitRate: 16
particleDuration: 1600 lifeSpan: 1600
emitting: !gameOver && shoot emitting: !gameOver && shoot
particleSize: 40 size: 40
speed: PointVector{ speed: PointDirection{
x: 256 * Math.cos(rocket.rotation * (Math.PI / 180)) x: 256 * Math.cos(rocket.rotation * (Math.PI / 180))
y: 256 * Math.sin(rocket.rotation * (Math.PI / 180)) y: 256 * Math.sin(rocket.rotation * (Math.PI / 180))
} }

View File

@ -39,7 +39,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Rectangle{ Rectangle{
id: root id: root
@ -49,26 +49,26 @@ Rectangle{
ParticleSystem{ ParticleSystem{
id: sys id: sys
} }
ColoredParticle{ ImageParticle{
system: sys system: sys
image: "content/particle.png" source: "content/particle.png"
color: "white" color: "white"
colorVariation: 1.0 colorVariation: 1.0
alpha: 0.1 alpha: 0.1
} }
Component{ Component{
id: emitterComp id: emitterComp
TrailEmitter{ Emitter{
id: container id: container
TrailEmitter{ Emitter{
id: emitMore id: emitMore
system: sys system: sys
emitting: true emitting: true
particlesPerSecond: 128 emitRate: 128
particleDuration: 600 lifeSpan: 600
particleSize: 16 size: 16
particleEndSize: 8 endSize: 8
speed: AngleVector{angleVariation:360; magnitude: 60} speed: AngledDirection{angleVariation:360; magnitude: 60}
} }
property int life: 2600 property int life: 2600
@ -81,10 +81,10 @@ Rectangle{
} }
system: sys system: sys
emitting: true emitting: true
particlesPerSecond: 64 emitRate: 32
particleDuration: 600 lifeSpan: 600
particleSize: 24 size: 24
particleEndSize: 8 endSize: 8
NumberAnimation on x{ NumberAnimation on x{
id: xAnim; id: xAnim;
to: targetX to: targetX
@ -107,12 +107,12 @@ Rectangle{
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
onClicked:{ onClicked:{
for(var i=0; i<16; i++){ for(var i=0; i<8; i++){
var obj = emitterComp.createObject(root); var obj = emitterComp.createObject(root);
obj.x = mouse.x obj.x = mouse.x
obj.y = mouse.y obj.y = mouse.y
obj.targetX = Math.random() * 640 obj.targetX = Math.random() * 240 - 120 + obj.x
obj.targetY = Math.random() * 480 obj.targetY = Math.random() * 240 - 120 + obj.y
obj.life = Math.round(Math.random() * 2400) + 200 obj.life = Math.round(Math.random() * 2400) + 200
obj.go(); obj.go();
} }

View File

@ -39,7 +39,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Rectangle { Rectangle {
id: root id: root
@ -52,35 +52,35 @@ Rectangle {
} }
/* /*
ColoredParticle{ ImageParticle{
id: fireball id: fireball
anchors.fill: parent anchors.fill: parent
particles: ["E"] particles: ["E"]
system: particles system: particles
image: "content/particleA.png" source: "content/particleA.png"
colorVariation: 0.2 colorVariation: 0.2
color: "#00ff400f" color: "#00ff400f"
} }
*/ */
ColoredParticle{ ImageParticle{
id: smoke id: smoke
system: particles system: particles
anchors.fill: parent anchors.fill: parent
particles: ["A", "B"] particles: ["A", "B"]
image: "content/particle.png" source: "content/particle.png"
colorVariation: 0 colorVariation: 0
color: "#00111111" color: "#00111111"
} }
ColoredParticle{ ImageParticle{
id: flame id: flame
anchors.fill: parent anchors.fill: parent
system: particles system: particles
particles: ["C", "D"] particles: ["C", "D"]
image: "content/particle.png" source: "content/particle.png"
colorVariation: 0.1 colorVariation: 0.1
color: "#00ff400f" color: "#00ff400f"
} }
TrailEmitter{ Emitter{
id: fire id: fire
system: particles system: particles
particle: "C" particle: "C"
@ -88,15 +88,15 @@ Rectangle {
y: parent.height y: parent.height
width: parent.width width: parent.width
particlesPerSecond: 350 emitRate: 350
particleDuration: 3500 lifeSpan: 3500
acceleration: PointVector{ y: -17; xVariation: 3 } acceleration: PointDirection{ y: -17; xVariation: 3 }
speed: PointVector{xVariation: 3} speed: PointDirection{xVariation: 3}
particleSize: 24 size: 24
particleSizeVariation: 8 sizeVariation: 8
particleEndSize: 4 endSize: 4
} }
FollowEmitter{ FollowEmitter{
id: fireSmoke id: fireSmoke
@ -106,15 +106,15 @@ Rectangle {
width: root.width width: root.width
height: root.height - 68 height: root.height - 68
particlesPerParticlePerSecond: 1 emitRatePerParticle: 1
particleDuration: 2000 lifeSpan: 2000
speed: PointVector{y:-17*6; yVariation: -17; xVariation: 3} speed: PointDirection{y:-17*6; yVariation: -17; xVariation: 3}
acceleration: PointVector{xVariation: 3} acceleration: PointDirection{xVariation: 3}
particleSize: 36 size: 36
particleSizeVariation: 8 sizeVariation: 8
particleEndSize: 16 endSize: 16
} }
FollowEmitter{ FollowEmitter{
id: fireballFlame id: fireballFlame
@ -123,14 +123,14 @@ Rectangle {
particle: "D" particle: "D"
follow: "E" follow: "E"
particlesPerParticlePerSecond: 120 emitRatePerParticle: 120
particleDuration: 180 lifeSpan: 180
emissionWidth: 8 emitWidth: 8
emissionHeight: 8 emitHeight: 8
particleSize: 16 size: 16
particleSizeVariation: 4 sizeVariation: 4
particleEndSize: 4 endSize: 4
} }
FollowEmitter{ FollowEmitter{
@ -140,19 +140,19 @@ Rectangle {
particle: "A" particle: "A"
follow: "E" follow: "E"
particlesPerParticlePerSecond: 128 emitRatePerParticle: 128
particleDuration: 2400 lifeSpan: 2400
emissionWidth: 16 emitWidth: 16
emissionHeight: 16 emitHeight: 16
speed: PointVector{yVariation: 16; xVariation: 16} speed: PointDirection{yVariation: 16; xVariation: 16}
acceleration: PointVector{y: -16} acceleration: PointDirection{y: -16}
particleSize: 24 size: 24
particleSizeVariation: 8 sizeVariation: 8
particleEndSize: 8 endSize: 8
} }
TrailEmitter{ Emitter{
id: balls id: balls
system: particles system: particles
particle: "E" particle: "E"
@ -160,14 +160,14 @@ Rectangle {
y: parent.height y: parent.height
width: parent.width width: parent.width
particlesPerSecond: 2 emitRate: 2
particleDuration: 7000 lifeSpan: 7000
speed: PointVector{y:-17*4*2; xVariation: 6*6} speed: PointDirection{y:-17*4*2; xVariation: 6*6}
acceleration: PointVector{y: 17*2; xVariation: 6*6} acceleration: PointDirection{y: 17*2; xVariation: 6*6}
particleSize: 12 size: 12
particleSizeVariation: 4 sizeVariation: 4
} }
} }

View File

@ -39,7 +39,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Rectangle{ Rectangle{
id: root id: root
@ -55,30 +55,26 @@ Rectangle{
id: sys id: sys
startTime: 4000 startTime: 4000
} }
TrailEmitter{ Emitter{
system: sys system: sys
y:root.height + 20 y:root.height + 20
width: root.width width: root.width
particlesPerSecond: 200 emitRate: 200
particleDuration: 4000 lifeSpan: 4000
speed: PointVector{ y: -120; } speed: PointDirection{ y: -120; }
} }
SpriteParticle{ ImageParticle{
system: sys system: sys
visible: !cloneMode visible: !cloneMode
Sprite{ source: "content/particle2.png"
source: "content/particle2.png"
}
} }
SpriteParticle{ ImageParticle{
system: sys system: sys
visible: cloneMode visible: cloneMode
z: 0 z: 0
Sprite{ source: "content/particle3.png"
source: "content/particle3.png"
}
} }
SpriteParticle{ ImageParticle{
system: sys system: sys
clip: true clip: true
visible: cloneMode visible: cloneMode
@ -86,8 +82,6 @@ Rectangle{
height: 240 height: 240
width: root.width width: root.width
z: 1 z: 1
Sprite{ source: "content/particle.png"
source: "content/particle.png"
}
} }
} }

View File

@ -43,18 +43,18 @@
// highlight bar is moved between items. + Particles. // highlight bar is moved between items. + Particles.
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
import "content" import "content"
Rectangle { Rectangle {
width: 200; height: 300 width: 200; height: 300
color: "black" color: "black"
ParticleSystem{ id: particles } ParticleSystem{ id: particles }
ColoredParticle{ ImageParticle{
anchors.fill: parent anchors.fill: parent
system: particles system: particles
z: 10 z: 10
image: "content/star.png" source: "content/star.png"
color: "white" color: "white"
colorVariation: 0.0 colorVariation: 0.0
} }
@ -92,14 +92,14 @@ Rectangle {
y: listView.currentItem.y; y: listView.currentItem.y;
//Behavior on y { SpringAnimation { spring: 2; damping: 0.1 } } //Behavior on y { SpringAnimation { spring: 2; damping: 0.1 } }
Behavior on y { NumberAnimation {id: anim} } Behavior on y { NumberAnimation {id: anim} }
TrailEmitter{ Emitter{
anchors.fill: parent anchors.fill: parent
system: particles; system: particles;
emitting: anim.running emitting: anim.running
particlesPerSecond: 600 emitRate: 600
particleDuration: 600 lifeSpan: 600
particleSize: 16 size: 16
particleEndSize: 8 endSize: 8
} }
} }
} }

View File

@ -39,34 +39,34 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Rectangle{ Rectangle{
color: "black" color: "black"
width: 360 width: 360
height: 540 height: 540
ParticleSystem{ id: sys } ParticleSystem{ id: sys }
ColoredParticle{ ImageParticle{
system: sys system: sys
id: cp id: cp
image: "content/particle.png" source: "content/particle.png"
colorVariation: 0.4 colorVariation: 0.4
color: "#000000FF" color: "#000000FF"
} }
TrailEmitter{ Emitter{
//burst on click //burst on click
id: bursty id: bursty
system: sys system: sys
emitting: ma.pressed emitting: ma.pressed
x: ma.mouseX x: ma.mouseX
y: ma.mouseY y: ma.mouseY
particlesPerSecond: 16000 emitRate: 16000
particleDuration: 1000 lifeSpan: 1000
maxParticles: 4000 emitCap: 4000
acceleration: AngleVector{angleVariation: 360; magnitude: 360; } acceleration: AngledDirection{angleVariation: 360; magnitude: 360; }
particleSize: 8 size: 8
particleEndSize: 16 endSize: 16
particleSizeVariation: 4 sizeVariation: 4
} }
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent

View File

@ -39,7 +39,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Rectangle{ Rectangle{
id: root id: root
@ -54,51 +54,51 @@ Rectangle{
id: particles id: particles
startTime: 2000 startTime: 2000
} }
ColoredParticle{ ImageParticle{
particles: ["center","edge"] particles: ["center","edge"]
anchors.fill: parent anchors.fill: parent
system: particles system: particles
image: "content/particle.png" source: "content/particle.png"
colorVariation: 0.1 colorVariation: 0.1
color: "#009999FF" color: "#009999FF"
} }
TrailEmitter{ Emitter{
anchors.fill: parent anchors.fill: parent
particle: "center" particle: "center"
system: particles system: particles
particlesPerSecond: 200 emitRate: 200
particleDuration: 2000 lifeSpan: 2000
emitting: true emitting: true
particleSize: 20 size: 20
particleSizeVariation: 2 sizeVariation: 2
particleEndSize: 0 endSize: 0
shape: Ellipse{fill: false} shape: EllipseShape{fill: false}
speed: DirectedVector{ speed: TargetedDirection{
targetX: root.width/2 targetX: root.width/2
targetY: root.height/2 targetY: root.height/2
proportionalMagnitude: true proportionalMagnitude: true
magnitude: 0.5 magnitude: 0.5
} }
} }
TrailEmitter{ Emitter{
anchors.fill: parent anchors.fill: parent
particle: "edge" particle: "edge"
system: particles system: particles
particlesPerSecond: 4000 emitRate: 4000
particleDuration: 2000 lifeSpan: 2000
emitting: true emitting: true
particleSize: 20 size: 20
particleSizeVariation: 2 sizeVariation: 2
particleEndSize: 0 endSize: 0
shape: Ellipse{fill: false} shape: EllipseShape{fill: false}
speed: DirectedVector{ speed: TargetedDirection{
targetX: root.width/2 targetX: root.width/2
targetY: root.height/2 targetY: root.height/2
proportionalMagnitude: true proportionalMagnitude: true
magnitude: 0.1 magnitude: 0.1
magnitudeVariation: 0.1 magnitudeVariation: 0.1
} }
acceleration: DirectedVector{ acceleration: TargetedDirection{
targetX: root.width/2 targetX: root.width/2
targetY: root.height/2 targetY: root.height/2
targetVariation: 200 targetVariation: 200

View File

@ -38,7 +38,7 @@
** **
****************************************************************************/ ****************************************************************************/
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
import QtQuick 2.0 import QtQuick 2.0
Rectangle { Rectangle {
@ -48,19 +48,19 @@ Rectangle {
color: "black" color: "black"
ParticleSystem{ id: particles } ParticleSystem{ id: particles }
ColoredParticle{ ImageParticle{
system: particles system: particles
colorVariation: 0.5 colorVariation: 0.5
alpha: 0 alpha: 0
image: "content/particle.png" source: "content/particle.png"
colorTable: "content/colortable.png" colorTable: "content/colortable.png"
sizeTable: "content/colortable.png" sizeTable: "content/colortable.png"
} }
TrailEmitter{ Emitter{
system: particles system: particles
particlesPerSecond: 500 emitRate: 500
particleDuration: 2000 lifeSpan: 2000
y: root.height / 2 + Math.sin(t * 2) * root.height * 0.3 y: root.height / 2 + Math.sin(t * 2) * root.height * 0.3
x: root.width / 2 + Math.cos(t) * root.width * 0.3 x: root.width / 2 + Math.cos(t) * root.width * 0.3
@ -72,11 +72,11 @@ Rectangle {
speedFromMovement: 20 speedFromMovement: 20
speed: PointVector{ xVariation: 5; yVariation: 5;} speed: PointDirection{ xVariation: 5; yVariation: 5;}
acceleration: PointVector{ xVariation: 5; yVariation: 5;} acceleration: PointDirection{ xVariation: 5; yVariation: 5;}
particleSize: 16 size: 16
//particleEndSize: 8 //endSize: 8
//particleSizeVariation: 8 //sizeVariation: 8
} }
} }

View File

@ -39,7 +39,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Rectangle{ Rectangle{
width: 360 width: 360
@ -53,21 +53,21 @@ Rectangle{
id: particles id: particles
running: false running: false
} }
ColoredParticle{ ImageParticle{
anchors.fill: parent anchors.fill: parent
system: particles system: particles
image: "content/star.png" source: "content/star.png"
sizeTable: "content/sparkleSize.png" sizeTable: "content/sparkleSize.png"
alpha: 0 alpha: 0
colorVariation: 0.6 colorVariation: 0.6
} }
TrailEmitter{ Emitter{
anchors.fill: parent anchors.fill: parent
system: particles system: particles
particlesPerSecond: 2000 emitRate: 2000
particleDuration: 2000 lifeSpan: 2000
emitting: true emitting: true
particleSize: 30 size: 30
particleSizeVariation: 10 sizeVariation: 10
} }
} }

View File

@ -39,44 +39,44 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Rectangle{ Rectangle{
color: "black" color: "black"
width: 360 width: 360
height: 540 height: 540
ParticleSystem{ id: sys } ParticleSystem{ id: sys }
ColoredParticle{ ImageParticle{
system: sys system: sys
id: cp id: cp
image: "content/particle.png" source: "content/particle.png"
color: "#00FFFFFF" color: "#00FFFFFF"
colorVariation: 0.4 colorVariation: 0.4
} }
TrailEmitter{ Emitter{
//burst on click //burst on click
id: bursty id: bursty
system: sys system: sys
emitting: false emitting: false
particlesPerSecond: 2000 emitRate: 2000
particleDuration: 500 lifeSpan: 500
acceleration: AngleVector{ angle: 90; angleVariation: 360; magnitude: 640; } acceleration: AngledDirection{ angle: 90; angleVariation: 360; magnitude: 640; }
particleSize: 8 size: 8
particleEndSize: 16 endSize: 16
particleSizeVariation: 4 sizeVariation: 4
} }
TrailEmitter{ Emitter{
system: sys system: sys
speedFromMovement: 4.0 speedFromMovement: 4.0
emitting: ma.pressed emitting: ma.pressed
x: ma.mouseX x: ma.mouseX
y: ma.mouseY y: ma.mouseY
particlesPerSecond: 400 emitRate: 400
particleDuration: 2000 lifeSpan: 2000
acceleration: AngleVector{ angle: 90; angleVariation: 22; magnitude: 32; } acceleration: AngledDirection{ angle: 90; angleVariation: 22; magnitude: 32; }
particleSize: 8 size: 8
particleEndSize: 16 endSize: 16
particleSizeVariation: 8 sizeVariation: 8
} }
MouseArea{ MouseArea{
id: ma id: ma

View File

@ -39,7 +39,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Rectangle{ Rectangle{
width: 360 width: 360
@ -66,32 +66,32 @@ Rectangle{
frequency: 64 frequency: 64
gridSize: 16 gridSize: 16
} }
ColoredParticle{ ImageParticle{
particles: ["smoke"] particles: ["smoke"]
system: ps system: ps
image: "content/particle.png" source: "content/particle.png"
color: "#11111111" color: "#11111111"
colorVariation: 0 colorVariation: 0
} }
ColoredParticle{ ImageParticle{
particles: ["flame"] particles: ["flame"]
system: ps system: ps
image: "content/particle.png" source: "content/particle.png"
color: "#11ff400f" color: "#11ff400f"
colorVariation: 0.1 colorVariation: 0.1
} }
TrailEmitter{ Emitter{
anchors.centerIn: parent anchors.centerIn: parent
system: ps system: ps
particle: "flame" particle: "flame"
particlesPerSecond: 120 emitRate: 120
particleDuration: 1200 lifeSpan: 1200
particleSize: 20 size: 20
particleEndSize: 10 endSize: 10
particleSizeVariation: 10 sizeVariation: 10
acceleration: PointVector{ y: -40 } acceleration: PointDirection{ y: -40 }
speed: AngleVector{ angle: 270; magnitude: 20; angleVariation: 22; magnitudeVariation: 5 } speed: AngledDirection{ angle: 270; magnitude: 20; angleVariation: 22; magnitudeVariation: 5 }
} }
FollowEmitter{ FollowEmitter{
id: smoke1 id: smoke1
@ -101,14 +101,14 @@ Rectangle{
particle: "smoke" particle: "smoke"
follow: "flame" follow: "flame"
particlesPerParticlePerSecond: 4 emitRatePerParticle: 4
particleDuration: 2400 lifeSpan: 2400
particleDurationVariation: 400 lifeSpanVariation: 400
particleSize: 16 size: 16
particleEndSize: 8 endSize: 8
particleSizeVariation: 8 sizeVariation: 8
acceleration: PointVector{ y: -40 } acceleration: PointDirection{ y: -40 }
speed: AngleVector{ angle: 270; magnitude: 40; angleVariation: 22; magnitudeVariation: 5 } speed: AngledDirection{ angle: 270; magnitude: 40; angleVariation: 22; magnitudeVariation: 5 }
} }
FollowEmitter{ FollowEmitter{
id: smoke2 id: smoke2
@ -118,12 +118,12 @@ Rectangle{
particle: "smoke" particle: "smoke"
follow: "flame" follow: "flame"
particlesPerParticlePerSecond: 1 emitRatePerParticle: 1
particleDuration: 2400 lifeSpan: 2400
particleSize: 36 size: 36
particleEndSize: 24 endSize: 24
particleSizeVariation: 8 sizeVariation: 8
acceleration: PointVector{ y: -40 } acceleration: PointDirection{ y: -40 }
speed: AngleVector{ angle: 270; magnitude: 40; angleVariation: 22; magnitudeVariation: 5 } speed: AngledDirection{ angle: 270; magnitude: 40; angleVariation: 22; magnitudeVariation: 5 }
} }
} }

View File

@ -39,7 +39,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import Qt.labs.particles 2.0 import QtQuick.Particles 2.0
Rectangle { Rectangle {
@ -75,9 +75,9 @@ Rectangle {
} }
ParticleSystem{ id: sys1 } ParticleSystem{ id: sys1 }
ColoredParticle{ ImageParticle{
system: sys1 system: sys1
image: "content/particle.png" source: "content/particle.png"
color: "cyan" color: "cyan"
alpha: 0 alpha: 0
SequentialAnimation on color { SequentialAnimation on color {
@ -105,26 +105,26 @@ Rectangle {
} }
colorVariation: 0.3 colorVariation: 0.3
} }
TrailEmitter{ Emitter{
id: trailsNormal id: trailsNormal
system: sys1 system: sys1
particlesPerSecond: 500 emitRate: 500
particleDuration: 2000 lifeSpan: 2000
y: mouseArea.pressed ? mouseArea.mouseY : circle.cy y: mouseArea.pressed ? mouseArea.mouseY : circle.cy
x: mouseArea.pressed ? mouseArea.mouseX : circle.cx x: mouseArea.pressed ? mouseArea.mouseX : circle.cx
speed: PointVector{xVariation: 4; yVariation: 4;} speed: PointDirection{xVariation: 4; yVariation: 4;}
acceleration: PointVector{xVariation: 10; yVariation: 10;} acceleration: PointDirection{xVariation: 10; yVariation: 10;}
speedFromMovement: 8 speedFromMovement: 8
particleSize: 8 size: 8
particleSizeVariation: 4 sizeVariation: 4
} }
ParticleSystem { id: sys2 } ParticleSystem { id: sys2 }
ColoredParticle{ ImageParticle{
color: "cyan" color: "cyan"
system: sys2 system: sys2
alpha: 0 alpha: 0
@ -142,29 +142,29 @@ Rectangle {
} }
} }
colorVariation: 0.5 colorVariation: 0.5
image: "content/star.png" source: "content/star.png"
} }
TrailEmitter{ Emitter{
id: trailsStars id: trailsStars
system: sys2 system: sys2
particlesPerSecond: 100 emitRate: 100
particleDuration: 2200 lifeSpan: 2200
y: mouseArea.pressed ? mouseArea.mouseY : circle.cy y: mouseArea.pressed ? mouseArea.mouseY : circle.cy
x: mouseArea.pressed ? mouseArea.mouseX : circle.cx x: mouseArea.pressed ? mouseArea.mouseX : circle.cx
speed: PointVector{xVariation: 4; yVariation: 4;} speed: PointDirection{xVariation: 4; yVariation: 4;}
acceleration: PointVector{xVariation: 10; yVariation: 10;} acceleration: PointDirection{xVariation: 10; yVariation: 10;}
speedFromMovement: 8 speedFromMovement: 8
particleSize: 22 size: 22
particleSizeVariation: 4 sizeVariation: 4
} }
ParticleSystem { id: sys3; } ParticleSystem { id: sys3; }
ColoredParticle{ ImageParticle{
image: "content/particle.png" source: "content/particle.png"
system: sys3 system: sys3
color: "orange" color: "orange"
alpha: 0 alpha: 0
@ -185,28 +185,28 @@ Rectangle {
colorVariation: 0.2 colorVariation: 0.2
} }
TrailEmitter{ Emitter{
id: trailsNormal2 id: trailsNormal2
system: sys3 system: sys3
particlesPerSecond: 300 emitRate: 300
particleDuration: 2000 lifeSpan: 2000
y: mouseArea.pressed ? mouseArea.mouseY : circle2.cy y: mouseArea.pressed ? mouseArea.mouseY : circle2.cy
x: mouseArea.pressed ? mouseArea.mouseX : circle2.cx x: mouseArea.pressed ? mouseArea.mouseX : circle2.cx
speedFromMovement: 16 speedFromMovement: 16
speed: PointVector{xVariation: 4; yVariation: 4;} speed: PointDirection{xVariation: 4; yVariation: 4;}
acceleration: PointVector{xVariation: 10; yVariation: 10;} acceleration: PointDirection{xVariation: 10; yVariation: 10;}
particleSize: 12 size: 12
particleSizeVariation: 4 sizeVariation: 4
} }
ParticleSystem { id: sys4; } ParticleSystem { id: sys4; }
ColoredParticle{ ImageParticle{
system: sys4 system: sys4
image: "content/star.png" source: "content/star.png"
color: "green" color: "green"
alpha: 0 alpha: 0
SequentialAnimation on color { SequentialAnimation on color {
@ -225,23 +225,23 @@ Rectangle {
colorVariation: 0.5 colorVariation: 0.5
} }
TrailEmitter{ Emitter{
id: trailsStars2 id: trailsStars2
system: sys4 system: sys4
particlesPerSecond: 50 emitRate: 50
particleDuration: 2200 lifeSpan: 2200
y: mouseArea.pressed ? mouseArea.mouseY : circle2.cy y: mouseArea.pressed ? mouseArea.mouseY : circle2.cy
x: mouseArea.pressed ? mouseArea.mouseX : circle2.cx x: mouseArea.pressed ? mouseArea.mouseX : circle2.cx
speedFromMovement: 16 speedFromMovement: 16
speed: PointVector{xVariation: 2; yVariation: 2;} speed: PointDirection{xVariation: 2; yVariation: 2;}
acceleration: PointVector{xVariation: 10; yVariation: 10;} acceleration: PointDirection{xVariation: 10; yVariation: 10;}
particleSize: 22 size: 22
particleSizeVariation: 4 sizeVariation: 4
} }

View File

@ -147,27 +147,27 @@ Item {
PaletteItem { PaletteItem {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
componentFile: "Sun.qml" componentFile: "Sun.qml"
image: "../images/sun.png" source: "../images/sun.png"
} }
PaletteItem { PaletteItem {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
componentFile: "GenericSceneItem.qml" componentFile: "GenericSceneItem.qml"
image: "../images/moon.png" source: "../images/moon.png"
} }
PaletteItem { PaletteItem {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
componentFile: "PerspectiveItem.qml" componentFile: "PerspectiveItem.qml"
image: "../images/tree_s.png" source: "../images/tree_s.png"
} }
PaletteItem { PaletteItem {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
componentFile: "PerspectiveItem.qml" componentFile: "PerspectiveItem.qml"
image: "../images/rabbit_brown.png" source: "../images/rabbit_brown.png"
} }
PaletteItem { PaletteItem {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
componentFile: "PerspectiveItem.qml" componentFile: "PerspectiveItem.qml"
image: "../images/rabbit_bw.png" source: "../images/rabbit_bw.png"
} }
} }
} }

View File

@ -44,7 +44,7 @@ Image {
id: sun id: sun
property bool created: false property bool created: false
property string image: "../images/sun.png" property string source: "../images/sun.png"
source: image source: image

View File

@ -43,7 +43,7 @@ import QtQuick 1.0
Flipable { Flipable {
id: container id: container
property alias image: frontImage.source property alias source: frontImage.source
property bool flipped: true property bool flipped: true
property int xAxis: 0 property int xAxis: 0
property int yAxis: 0 property int yAxis: 0

View File

@ -49,7 +49,7 @@ Rectangle {
Row { Row {
anchors.centerIn: parent; spacing: 30 anchors.centerIn: parent; spacing: 30
Card { image: "content/9_club.png"; angle: 180; yAxis: 1 } Card { source: "content/9_club.png"; angle: 180; yAxis: 1 }
Card { image: "content/5_heart.png"; angle: 540; xAxis: 1 } Card { source: "content/5_heart.png"; angle: 540; xAxis: 1 }
} }
} }

View File

@ -56,7 +56,7 @@ class QJSDebuggerAgentPrivate
{ {
public: public:
QJSDebuggerAgentPrivate(QJSDebuggerAgent *q) QJSDebuggerAgentPrivate(QJSDebuggerAgent *q)
: q(q), state(NoState) : q(q), state(NoState), isInitialized(false)
{} {}
void continueExec(); void continueExec();
@ -79,6 +79,7 @@ public:
QHash<QString, JSAgentBreakpointData> fileNameToBreakpoints; QHash<QString, JSAgentBreakpointData> fileNameToBreakpoints;
QStringList watchExpressions; QStringList watchExpressions;
QSet<qint64> knownObjectIds; QSet<qint64> knownObjectIds;
bool isInitialized;
}; };
namespace { namespace {
@ -252,6 +253,14 @@ QJSDebuggerAgent::~QJSDebuggerAgent()
delete d; delete d;
} }
/*!
Indicates whether the agent got the list of breakpoints.
*/
bool QJSDebuggerAgent::isInitialized() const
{
return d->isInitialized;
}
void QJSDebuggerAgent::setBreakpoints(const JSAgentBreakpoints &breakpoints) void QJSDebuggerAgent::setBreakpoints(const JSAgentBreakpoints &breakpoints)
{ {
d->breakpoints = breakpoints; d->breakpoints = breakpoints;
@ -259,6 +268,8 @@ void QJSDebuggerAgent::setBreakpoints(const JSAgentBreakpoints &breakpoints)
d->fileNameToBreakpoints.clear(); d->fileNameToBreakpoints.clear();
foreach (const JSAgentBreakpointData &bp, breakpoints) foreach (const JSAgentBreakpointData &bp, breakpoints)
d->fileNameToBreakpoints.insertMulti(fileName(QString::fromUtf8(bp.fileUrl)), bp); d->fileNameToBreakpoints.insertMulti(fileName(QString::fromUtf8(bp.fileUrl)), bp);
d->isInitialized = true;
} }
void QJSDebuggerAgent::setWatchExpressions(const QStringList &watchExpressions) void QJSDebuggerAgent::setWatchExpressions(const QStringList &watchExpressions)

Some files were not shown because too many files have changed in this diff Show More