Merge branch 'qtquick2' of scm.dev.nokia.troll.no:qt/qtdeclarative-staging
Conflicts: src/declarative/items/qsgtextnode.cpp
|
@ -40,7 +40,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Flipable {
|
||||
id: container
|
||||
|
@ -57,6 +57,8 @@ Flipable {
|
|||
property int rating: 2
|
||||
property variant prevScale: 1.0
|
||||
|
||||
property int flipDuration: 1600
|
||||
|
||||
signal closed
|
||||
|
||||
transform: Rotation {
|
||||
|
@ -137,94 +139,172 @@ Flipable {
|
|||
slider.value = prevScale;
|
||||
}
|
||||
if (inBackState && bigImage.status == Image.Ready)
|
||||
particleBox.imageInAnim();
|
||||
effectBox.imageInAnim();
|
||||
}
|
||||
property bool inBackState: false
|
||||
onInBackStateChanged:{
|
||||
if(inBackState && bigImage.status == Image.Ready)
|
||||
particleBox.imageInAnim();
|
||||
effectBox.imageInAnim();
|
||||
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{
|
||||
id: particleBox
|
||||
id: effectBox
|
||||
width: bigImage.width * bigImage.scale
|
||||
height: bigImage.height * bigImage.scale
|
||||
anchors.centerIn: parent
|
||||
|
||||
function imageInAnim(){
|
||||
cp.visible = true;
|
||||
pixAffect.onceOff = false;
|
||||
bigImage.visible = false;
|
||||
noiseIn.visible = true;
|
||||
endEffectTimer.start();
|
||||
pixelEmitter.pulse(1);
|
||||
}
|
||||
function imageOutAnim(){
|
||||
cp.visible = true;
|
||||
pixAffect.onceOff = true;
|
||||
bigImage.visible = false;
|
||||
noiseIn.visible = false;
|
||||
turbulence.active = true;
|
||||
endEffectTimer.start();
|
||||
pixelEmitter.burst(2048);
|
||||
}
|
||||
Timer{
|
||||
id: endEffectTimer
|
||||
interval: 1000
|
||||
interval: flipDuration
|
||||
repeat: false
|
||||
running: false
|
||||
onTriggered:{
|
||||
bigImage.visible = true;
|
||||
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{
|
||||
id: imageSystem
|
||||
}
|
||||
ColoredParticle{
|
||||
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{
|
||||
Emitter{
|
||||
id: pixelEmitter
|
||||
system: imageSystem
|
||||
anchors.fill: parent
|
||||
particleSize: 4
|
||||
particleDuration: 1000
|
||||
particlesPerSecond: 2048
|
||||
//anchors.fill: parent
|
||||
width: Math.min(bigImage.width * bigImage.scale, flickable.width);
|
||||
height: Math.min(bigImage.height * bigImage.scale, flickable.height);
|
||||
anchors.centerIn: parent
|
||||
size: 4
|
||||
lifeSpan: flipDuration
|
||||
emitRate: 2048
|
||||
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 {
|
||||
SequentialAnimation {
|
||||
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 }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Item{
|
||||
id: container
|
||||
|
@ -59,24 +59,24 @@ Item{
|
|||
running: container.visible
|
||||
id: barSys
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
color: "lightsteelblue"
|
||||
alpha: 0.1
|
||||
colorVariation: 0.05
|
||||
image: "images/particle.png"
|
||||
source: "images/particle.png"
|
||||
system: barSys
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
y: 2; height: parent.height-4;
|
||||
x: 2; width: Math.max(parent.width * progress - 4, 0);
|
||||
speed: AngleVector{ angleVariation: 180; magnitudeVariation: 12 }
|
||||
speed: AngledDirection{ angleVariation: 180; magnitudeVariation: 12 }
|
||||
system: barSys
|
||||
particlesPerSecond: width;
|
||||
particleDuration: 1000
|
||||
particleSize: 20
|
||||
particleSizeVariation: 4
|
||||
particleEndSize: 12
|
||||
maxParticles: parent.width;
|
||||
emitRate: width;
|
||||
lifeSpan: 1000
|
||||
size: 20
|
||||
sizeVariation: 4
|
||||
endSize: 12
|
||||
emitCap: parent.width;
|
||||
}
|
||||
|
||||
Text {
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Item{
|
||||
id: container
|
||||
|
@ -52,7 +52,7 @@ Item{
|
|||
anchors.fill:parent
|
||||
overwrite: false
|
||||
}
|
||||
DataParticle{
|
||||
ModelParticle{
|
||||
id: mp
|
||||
fade: false
|
||||
system: sys
|
||||
|
@ -66,38 +66,38 @@ Item{
|
|||
}
|
||||
}
|
||||
property real emitterSpacing: parent.width/3
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
system: sys
|
||||
width: emitterSpacing - 64
|
||||
x: emitterSpacing*0 + 32
|
||||
y: -128
|
||||
height: 32
|
||||
speed: PointVector{ y: (container.height + 128)/12 }
|
||||
particlesPerSecond: 0.4
|
||||
particleDuration: 1000000//eventually -1 should mean a million seconds for neatness
|
||||
maxParticles: 15
|
||||
speed: PointDirection{ y: (container.height + 128)/12 }
|
||||
emitRate: 0.4
|
||||
lifeSpan: 1000000//eventually -1 should mean a million seconds for neatness
|
||||
emitCap: 15
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
system: sys
|
||||
width: emitterSpacing - 64
|
||||
x: emitterSpacing*1 + 32
|
||||
y: -128
|
||||
height: 32
|
||||
speed: PointVector{ y: (container.height + 128)/12 }
|
||||
particlesPerSecond: 0.4
|
||||
particleDuration: 1000000//eventually -1 should mean a million seconds for neatness
|
||||
maxParticles: 15
|
||||
speed: PointDirection{ y: (container.height + 128)/12 }
|
||||
emitRate: 0.4
|
||||
lifeSpan: 1000000//eventually -1 should mean a million seconds for neatness
|
||||
emitCap: 15
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
system: sys
|
||||
width: emitterSpacing - 64
|
||||
x: emitterSpacing*2 + 32
|
||||
y: -128
|
||||
height: 32
|
||||
speed: PointVector{ y: (container.height + 128)/12 }
|
||||
particlesPerSecond: 0.4
|
||||
particleDuration: 1000000//eventually -1 should mean a million seconds for neatness
|
||||
maxParticles: 15
|
||||
speed: PointDirection{ y: (container.height + 128)/12 }
|
||||
emitRate: 0.4
|
||||
lifeSpan: 1000000//eventually -1 should mean a million seconds for neatness
|
||||
emitCap: 15
|
||||
}
|
||||
Kill{
|
||||
system: sys
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Package {
|
||||
function photoClicked() {
|
||||
|
|
After Width: | Height: | Size: 25 KiB |
|
@ -40,7 +40,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
import "content"
|
||||
|
||||
Item {
|
||||
|
@ -56,21 +56,21 @@ Item {
|
|||
id: bgParticles
|
||||
startTime: 16000
|
||||
}
|
||||
ColoredParticle {
|
||||
ImageParticle {
|
||||
particles: ["trail"]
|
||||
image: "content/images/particle.png"
|
||||
source: "content/images/particle.png"
|
||||
color: "#1A1A6F"
|
||||
alpha: 0.1
|
||||
colorVariation: 0.01
|
||||
blueVariation: 0.8
|
||||
system: bgParticles
|
||||
}
|
||||
TrailEmitter {
|
||||
Emitter {
|
||||
particle: "drops"
|
||||
width: parent.width
|
||||
particlesPerSecond: 0.5
|
||||
particleDuration: 20000
|
||||
speed: PointVector{
|
||||
emitRate: 0.5
|
||||
lifeSpan: 20000
|
||||
speed: PointDirection{
|
||||
y: {screen.height/18}
|
||||
}
|
||||
system: bgParticles
|
||||
|
@ -78,16 +78,16 @@ Item {
|
|||
FollowEmitter {
|
||||
follow: "drops"
|
||||
particle: "trail"
|
||||
particlesPerParticlePerSecond: 18
|
||||
particleSize: 32
|
||||
particleEndSize: 0
|
||||
particleSizeVariation: 4
|
||||
particleDuration: 1200
|
||||
emitRatePerParticle: 18
|
||||
size: 32
|
||||
endSize: 0
|
||||
sizeVariation: 4
|
||||
lifeSpan: 1200
|
||||
system: bgParticles
|
||||
anchors.fill: parent
|
||||
emissionWidth: 16
|
||||
emissionHeight: 16
|
||||
emissionShape: Ellipse{}
|
||||
emitWidth: 16
|
||||
emitHeight: 16
|
||||
emitShape: EllipseShape{}
|
||||
}
|
||||
|
||||
VisualDataModel{
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Item {
|
||||
id: container
|
||||
|
@ -53,20 +53,20 @@ Item {
|
|||
|
||||
width: 24
|
||||
height: 24
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: visualization
|
||||
particle: "blaster"
|
||||
system: container.system
|
||||
emitting: show
|
||||
anchors.fill: parent
|
||||
shape: Ellipse{}
|
||||
speed: DirectedVector{ targetX: width/2; targetY: width/2; magnitude: -1; proportionalMagnitude: true}
|
||||
particleDuration: 1000
|
||||
particlesPerSecond: 64
|
||||
shape: EllipseShape{}
|
||||
speed: TargetedDirection{ targetX: width/2; targetY: width/2; magnitude: -1; proportionalMagnitude: true}
|
||||
lifeSpan: 1000
|
||||
emitRate: 64
|
||||
|
||||
particleSize: 24
|
||||
particleSizeVariation: 24
|
||||
particleEndSize: 0
|
||||
size: 24
|
||||
sizeVariation: 24
|
||||
endSize: 0
|
||||
}
|
||||
|
||||
property int blastsLeft: 0
|
||||
|
@ -112,20 +112,20 @@ Item {
|
|||
rofTimer.repeat = false;
|
||||
}
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: emitter
|
||||
particle: "blaster"
|
||||
emitting: false
|
||||
system: container.system
|
||||
anchors.centerIn: parent
|
||||
|
||||
particleDuration: 1000
|
||||
particlesPerSecond: 16
|
||||
maxParticles: blasts
|
||||
particleSize: 24
|
||||
particleEndSize:16
|
||||
particleSizeVariation: 8
|
||||
speed: DirectedVector{
|
||||
lifeSpan: 1000
|
||||
emitRate: 16
|
||||
emitCap: blasts
|
||||
size: 24
|
||||
endSize:16
|
||||
sizeVariation: 8
|
||||
speed: TargetedDirection{
|
||||
id: blastVector
|
||||
targetX: target.x; targetY: target.y; magnitude: 1.1; proportionalMagnitude: true
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Item {
|
||||
id: container
|
||||
|
@ -49,17 +49,17 @@ Item {
|
|||
|
||||
width: 24
|
||||
height: 24
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: visualization
|
||||
particle: "cannon"
|
||||
emitting: container.show
|
||||
system: container.system
|
||||
anchors.centerIn: parent
|
||||
particleDuration: 2000
|
||||
particlesPerSecond: 1
|
||||
lifeSpan: 2000
|
||||
emitRate: 1
|
||||
|
||||
particleSize: 4
|
||||
particleEndSize: 0
|
||||
size: 4
|
||||
endSize: 0
|
||||
}
|
||||
|
||||
function fireAt(targetArg, hardpoint){
|
||||
|
@ -78,18 +78,18 @@ Item {
|
|||
}
|
||||
emitter.burst(1);
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: emitter
|
||||
particle: "cannon"
|
||||
emitting: false
|
||||
system: container.system
|
||||
anchors.centerIn: parent
|
||||
|
||||
particleDuration: 1000
|
||||
particlesPerSecond: 1
|
||||
particleSize: 8
|
||||
particleEndSize: 4
|
||||
speed: DirectedVector{
|
||||
lifeSpan: 1000
|
||||
emitRate: 1
|
||||
size: 8
|
||||
endSize: 4
|
||||
speed: TargetedDirection{
|
||||
id: blastVector
|
||||
targetX: target.x; targetY: target.y; magnitude: 1.1; proportionalMagnitude: true
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Item{
|
||||
id: container
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Item {
|
||||
id: container
|
||||
|
@ -54,7 +54,7 @@ Item {
|
|||
property int gunType: 0
|
||||
width: 128
|
||||
height: 128
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
//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
|
||||
system: container.system
|
||||
|
@ -62,30 +62,30 @@ Item {
|
|||
anchors.centerIn: parent
|
||||
width: 64
|
||||
height: 64
|
||||
shape: Ellipse{}
|
||||
shape: EllipseShape{}
|
||||
|
||||
particlesPerSecond: hp > 0 ? hp * 1 + 20 : 0
|
||||
particleDuration: 2400
|
||||
maxParticles: (maxHP * 1 + 20)*2.4
|
||||
emitRate: hp > 0 ? hp * 1 + 20 : 0
|
||||
lifeSpan: 2400
|
||||
emitCap: (maxHP * 1 + 20)*2.4
|
||||
|
||||
particleSize: 48
|
||||
particleSizeVariation: 16
|
||||
particleEndSize: 16
|
||||
size: 48
|
||||
sizeVariation: 16
|
||||
endSize: 16
|
||||
|
||||
speed: AngleVector{angleVariation:360; magnitudeVariation: 32}
|
||||
speed: AngledDirection{angleVariation:360; magnitudeVariation: 32}
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
system: container.system
|
||||
particle: "cruiserArmor"
|
||||
anchors.fill: parent
|
||||
shape: Ellipse{ fill: false }
|
||||
shape: EllipseShape{ fill: false }
|
||||
emitting: hp>0
|
||||
|
||||
particlesPerSecond: 16
|
||||
particleDuration: 2000
|
||||
emitRate: 16
|
||||
lifeSpan: 2000
|
||||
|
||||
particleSize: 48
|
||||
particleSizeVariation: 24
|
||||
size: 48
|
||||
sizeVariation: 24
|
||||
|
||||
SpriteGoal{
|
||||
id: destructor
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Item {
|
||||
id: container
|
||||
|
@ -54,29 +54,29 @@ Item {
|
|||
property int gunType: 0
|
||||
width: 128
|
||||
height: 128
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
system: container.system
|
||||
particle: "frigateShield"
|
||||
anchors.centerIn: parent
|
||||
particleSize: 92
|
||||
particlesPerSecond: 1
|
||||
particleDuration: 4800
|
||||
size: 92
|
||||
emitRate: 1
|
||||
lifeSpan: 4800
|
||||
emitting: hp > 0
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
system: container.system
|
||||
particle: container.shipParticle
|
||||
anchors.centerIn: parent
|
||||
width: 64
|
||||
height: 16
|
||||
shape: Ellipse{}
|
||||
shape: EllipseShape{}
|
||||
|
||||
particleSize: 16
|
||||
particleSizeVariation: 8
|
||||
particleEndSize: 8
|
||||
particlesPerSecond: hp > 0 ? hp * 1 + 20 : 0
|
||||
particleDuration: 1200
|
||||
maxParticles: (maxHP * 1 + 20)*2
|
||||
size: 16
|
||||
sizeVariation: 8
|
||||
endSize: 8
|
||||
emitRate: hp > 0 ? hp * 1 + 20 : 0
|
||||
lifeSpan: 1200
|
||||
emitCap: (maxHP * 1 + 20)*2
|
||||
}
|
||||
Timer{
|
||||
id: fireControl
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Item {
|
||||
id: container
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
SequentialLoader {
|
||||
id: hLdr
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Item {
|
||||
id: container
|
||||
|
@ -49,20 +49,20 @@ Item {
|
|||
|
||||
width: 24
|
||||
height: 24
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: visualization
|
||||
particle: "laser"
|
||||
system: container.system
|
||||
anchors.fill: parent
|
||||
emitting: container.show
|
||||
shape: Ellipse{}
|
||||
speed: DirectedVector{ targetX: width/2; targetY: width/2; magnitude: -1; proportionalMagnitude: true }
|
||||
particleDuration: 1000
|
||||
particlesPerSecond: 64
|
||||
shape: EllipseShape{}
|
||||
speed: TargetedDirection{ targetX: width/2; targetY: width/2; magnitude: -1; proportionalMagnitude: true }
|
||||
lifeSpan: 1000
|
||||
emitRate: 64
|
||||
|
||||
particleSize: 24
|
||||
particleSizeVariation: 8
|
||||
particleEndSize: 8
|
||||
size: 24
|
||||
sizeVariation: 8
|
||||
endSize: 8
|
||||
}
|
||||
|
||||
function fireAt(targetArg, hardpoint){
|
||||
|
@ -84,7 +84,7 @@ Item {
|
|||
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)));
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: emitter
|
||||
particle: "laser"
|
||||
emitting: false
|
||||
|
@ -93,16 +93,16 @@ Item {
|
|||
width: Math.max(container.width/2, target.x) - x;
|
||||
y: Math.min(container.height/2, target.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
|
||||
}
|
||||
|
||||
particleDuration: 1000
|
||||
particlesPerSecond: 8000
|
||||
maxParticles: 800
|
||||
particleSize: 16
|
||||
particleEndSize: 0
|
||||
lifeSpan: 1000
|
||||
emitRate: 8000
|
||||
emitCap: 800
|
||||
size: 16
|
||||
endSize: 0
|
||||
|
||||
speed: PointVector{xVariation: 4; yVariation: 4}
|
||||
speed: PointDirection{xVariation: 4; yVariation: 4}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,87 +39,87 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Item{
|
||||
property ParticleSystem sys
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
particles: ["default"]
|
||||
image: "pics/blur-circle3.png"
|
||||
source: "pics/blur-circle3.png"
|
||||
color: "#003A3A3A"
|
||||
colorVariation: 0.1
|
||||
z: 0
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
particles: ["redTeam"]
|
||||
image: "pics/blur-circle3.png"
|
||||
source: "pics/blur-circle3.png"
|
||||
color: "#0028060A"
|
||||
colorVariation: 0.1
|
||||
z: 0
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
particles: ["greenTeam"]
|
||||
image: "pics/blur-circle3.png"
|
||||
source: "pics/blur-circle3.png"
|
||||
color: "#0006280A"
|
||||
colorVariation: 0.1
|
||||
z: 0
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
particles: ["blaster"]
|
||||
image: "pics/star2.png"
|
||||
source: "pics/star2.png"
|
||||
//color: "#0F282406"
|
||||
color: "#0F484416"
|
||||
colorVariation: 0.2
|
||||
z: 2
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
particles: ["laser"]
|
||||
image: "pics/star3.png"
|
||||
source: "pics/star3.png"
|
||||
//color: "#00123F68"
|
||||
color: "#00428FF8"
|
||||
colorVariation: 0.2
|
||||
z: 2
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
particles: ["cannon"]
|
||||
image: "pics/particle.png"
|
||||
source: "pics/particle.png"
|
||||
color: "#80FFAAFF"
|
||||
colorVariation: 0.1
|
||||
z: 2
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
particles: ["cannonCore"]
|
||||
image: "pics/particle.png"
|
||||
source: "pics/particle.png"
|
||||
color: "#00666666"
|
||||
colorVariation: 0.8
|
||||
z: 1
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
particles: ["cannonWake"]
|
||||
image: "pics/star.png"
|
||||
source: "pics/star.png"
|
||||
color: "#00CCCCCC"
|
||||
colorVariation: 0.2
|
||||
z: 1
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
particles: ["frigateShield"]
|
||||
image: "pics/blur-circle2.png"
|
||||
source: "pics/blur-circle2.png"
|
||||
color: "#00000000"
|
||||
colorVariation: 0.05
|
||||
blueVariation: 0.5
|
||||
greenVariation: 0.1
|
||||
z: 3
|
||||
}
|
||||
SpriteParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
particles: ["cruiserArmor"]
|
||||
z: 1
|
||||
|
@ -148,12 +148,12 @@ Item{
|
|||
system: sys
|
||||
particle: "cannonWake"
|
||||
follow: "cannon"
|
||||
particlesPerParticlePerSecond: 64
|
||||
particleDuration: 600
|
||||
speed: AngleVector{ angleVariation: 360; magnitude: 48}
|
||||
particleSize: 16
|
||||
particleEndSize: 8
|
||||
particleSizeVariation: 2
|
||||
emitRatePerParticle: 64
|
||||
lifeSpan: 600
|
||||
speed: AngledDirection{ angleVariation: 360; magnitude: 48}
|
||||
size: 16
|
||||
endSize: 8
|
||||
sizeVariation: 2
|
||||
emitting: true
|
||||
width: 1000//XXX: Terrible hack
|
||||
height: 1000
|
||||
|
@ -162,10 +162,10 @@ Item{
|
|||
system: sys
|
||||
particle: "cannonCore"
|
||||
follow: "cannon"
|
||||
particlesPerParticlePerSecond: 256
|
||||
particleDuration: 128
|
||||
particleSize: 24
|
||||
particleEndSize: 8
|
||||
emitRatePerParticle: 256
|
||||
lifeSpan: 128
|
||||
size: 24
|
||||
endSize: 8
|
||||
emitting: true
|
||||
width: 1000//XXX: Terrible hack
|
||||
height: 1000
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Item {
|
||||
id: me
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Item {
|
||||
id: container
|
||||
|
@ -55,23 +55,23 @@ Item {
|
|||
property int gunType: 0
|
||||
width: 128
|
||||
height: 128
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: emitter
|
||||
//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
|
||||
system: container.system
|
||||
particle: container.shipParticle
|
||||
shape: Ellipse{}
|
||||
shape: EllipseShape{}
|
||||
|
||||
particlesPerSecond: hp > 0 ? hp + 20 : 0
|
||||
particleDuration: blinkInterval
|
||||
maxParticles: (maxHP + 20)
|
||||
emitRate: hp > 0 ? hp + 20 : 0
|
||||
lifeSpan: blinkInterval
|
||||
emitCap: (maxHP + 20)
|
||||
|
||||
acceleration: AngleVector{angleVariation: 360; magnitude: 8}
|
||||
acceleration: AngledDirection{angleVariation: 360; magnitude: 8}
|
||||
|
||||
particleSize: 24
|
||||
particleEndSize: 4
|
||||
particleSizeVariation: 8
|
||||
size: 24
|
||||
endSize: 4
|
||||
sizeVariation: 8
|
||||
width: 16
|
||||
height: 16
|
||||
x: 64
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
import "content"
|
||||
|
||||
Rectangle {
|
||||
|
@ -93,18 +93,18 @@ Rectangle {
|
|||
id: title
|
||||
width: root.width
|
||||
height: 240
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
anchors.fill: parent
|
||||
system: particles
|
||||
emitting: true
|
||||
particle: "default"
|
||||
particlesPerSecond: 1200
|
||||
particleDuration: 1200
|
||||
shape: Mask{source:"content/pics/TitleText.png"}
|
||||
particleSize: 16
|
||||
particleEndSize: 0
|
||||
particleSizeVariation: 8
|
||||
speed: AngleVector{angleVariation:360; magnitudeVariation: 6}
|
||||
emitRate: 1200
|
||||
lifeSpan: 1200
|
||||
shape: MaskShape{source:"content/pics/TitleText.png"}
|
||||
size: 16
|
||||
endSize: 0
|
||||
sizeVariation: 8
|
||||
speed: AngledDirection{angleVariation:360; magnitudeVariation: 6}
|
||||
}
|
||||
}
|
||||
Button{
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Item {
|
||||
id: block
|
||||
|
@ -71,7 +71,7 @@ Item {
|
|||
Behavior on opacity { NumberAnimation { duration: 200 } }
|
||||
anchors.fill: parent
|
||||
}
|
||||
TrailEmitter {
|
||||
Emitter {
|
||||
id: particles
|
||||
system: particleSystem
|
||||
particle: {
|
||||
|
@ -85,14 +85,14 @@ Item {
|
|||
}
|
||||
anchors.fill: parent
|
||||
|
||||
speed: DirectedVector{targetX: block.width/2; targetY: block.height/2; magnitude: -60; magnitudeVariation: 60}
|
||||
shape: Ellipse{fill:true}
|
||||
speed: TargetedDirection{targetX: block.width/2; targetY: block.height/2; magnitude: -60; magnitudeVariation: 60}
|
||||
shape: EllipseShape{fill:true}
|
||||
emitting: false;
|
||||
particleDuration: 700; particleDurationVariation: 100
|
||||
particlesPerSecond: 1000
|
||||
maxParticles: 100 //only fires 0.1s bursts (still 2x old number, ColoredParticle wants less than 16000 max though)
|
||||
particleSize: 28
|
||||
particleEndSize: 14
|
||||
lifeSpan: 700; lifeSpanVariation: 100
|
||||
emitRate: 1000
|
||||
emitCap: 100 //only fires 0.1s bursts (still 2x old number, ImageParticle wants less than 16000 max though)
|
||||
size: 28
|
||||
endSize: 14
|
||||
}
|
||||
|
||||
states: [
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
import "SamegameCore"
|
||||
import "SamegameCore/samegame.js" as Logic
|
||||
|
||||
|
@ -77,27 +77,27 @@ Rectangle {
|
|||
}
|
||||
Item{
|
||||
ParticleSystem{ id: particleSystem; }
|
||||
ColoredParticle {
|
||||
ImageParticle {
|
||||
system: particleSystem
|
||||
particles: ["red"]
|
||||
color: Qt.darker("red");//Actually want desaturated...
|
||||
image: "SamegameCore/pics/particle.png"
|
||||
source: "SamegameCore/pics/particle.png"
|
||||
colorVariation: 0.4
|
||||
alpha: 0.1
|
||||
}
|
||||
ColoredParticle {
|
||||
ImageParticle {
|
||||
system: particleSystem
|
||||
particles: ["green"]
|
||||
color: Qt.darker("green");//Actually want desaturated...
|
||||
image: "SamegameCore/pics/particle.png"
|
||||
source: "SamegameCore/pics/particle.png"
|
||||
colorVariation: 0.4
|
||||
alpha: 0.1
|
||||
}
|
||||
ColoredParticle {
|
||||
ImageParticle {
|
||||
system: particleSystem
|
||||
particles: ["blue"]
|
||||
color: Qt.darker("blue");//Actually want desaturated...
|
||||
image: "SamegameCore/pics/particle.png"
|
||||
source: "SamegameCore/pics/particle.png"
|
||||
colorVariation: 0.4
|
||||
alpha: 0.1
|
||||
}
|
||||
|
|
|
@ -42,8 +42,8 @@ import "ImageProviderCore" // import the plugin that registers the color image p
|
|||
|
||||
//![0]
|
||||
Column {
|
||||
Image { source: "image://colors/yellow" }
|
||||
Image { source: "image://colors/red" }
|
||||
Image { source: "source://colors/yellow" }
|
||||
Image { source: "source://colors/red" }
|
||||
}
|
||||
//![0]
|
||||
|
||||
|
|
|
@ -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 " ]
|
||||
}
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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 " ]
|
||||
}
|
|
@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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 " ]
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
|
@ -39,35 +39,101 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Rectangle{
|
||||
id: root
|
||||
color: "white"
|
||||
width: 310
|
||||
height: 300
|
||||
ParticleSystem{ id: sys }
|
||||
Picture{
|
||||
CustomParticle{
|
||||
system: sys
|
||||
anchors.fill: parent
|
||||
image: "content/singlesmile.png"
|
||||
onceOff: true
|
||||
property real maxWidth: root.width
|
||||
property real maxHeight: root.height
|
||||
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{
|
||||
system: sys
|
||||
image: "content/particle.png"
|
||||
color: "black"
|
||||
alpha: 0.4
|
||||
sizeTable: "content/sizeInOut.png"
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: emitter
|
||||
system: sys
|
||||
emitting: false
|
||||
particleDuration: 4000
|
||||
maxParticles: 1200
|
||||
lifeSpan: 4000
|
||||
emitCap: 1200
|
||||
anchors.fill: parent
|
||||
particleSize: 32
|
||||
speed: PointVector{ xVariation: 12; yVariation: 12 }
|
||||
size: 32
|
||||
speed: PointDirection{ xVariation: 12; yVariation: 12 }
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
|
|
|
@ -39,27 +39,27 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Rectangle{
|
||||
color: "goldenrod"
|
||||
width: 400
|
||||
height: 400
|
||||
ParticleSystem{id:sys}
|
||||
DeformableParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
particles: ["goingLeft", "goingRight"]
|
||||
image: "content/singlesmile.png"
|
||||
source: "content/singlesmile.png"
|
||||
rotation: 90
|
||||
rotationSpeed: 90
|
||||
autoRotation: true
|
||||
}
|
||||
DeformableParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
particles: ["goingDown"]
|
||||
image: "content/squarefacespriteXX.png"
|
||||
source: "content/squarefacespriteXX.png"
|
||||
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{
|
||||
running: true
|
||||
|
@ -79,40 +79,40 @@ Rectangle{
|
|||
interval: 8400
|
||||
onTriggered: emitC.emitting = true;
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: emitA
|
||||
x: 0
|
||||
y: 120
|
||||
system: sys
|
||||
emitting: false
|
||||
particle: "goingRight"
|
||||
speed: PointVector{ x: 100 }
|
||||
particleDuration: 4000
|
||||
particlesPerSecond: 2
|
||||
particleSize: 32
|
||||
speed: PointDirection{ x: 100 }
|
||||
lifeSpan: 4000
|
||||
emitRate: 2
|
||||
size: 32
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: emitB
|
||||
x: 400
|
||||
y: 240
|
||||
system: sys
|
||||
emitting: false
|
||||
particle: "goingLeft"
|
||||
speed: PointVector{ x: -100 }
|
||||
particleDuration: 4000
|
||||
particlesPerSecond: 2
|
||||
particleSize: 32
|
||||
speed: PointDirection{ x: -100 }
|
||||
lifeSpan: 4000
|
||||
emitRate: 2
|
||||
size: 32
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: emitC
|
||||
x: 0
|
||||
y: 360
|
||||
system: sys
|
||||
emitting: false
|
||||
particle: "goingDown"
|
||||
speed: PointVector{ x: 100 }
|
||||
particleDuration: 4000
|
||||
particlesPerSecond: 2
|
||||
particleSize: 32
|
||||
speed: PointDirection{ x: 100 }
|
||||
lifeSpan: 4000
|
||||
emitRate: 2
|
||||
size: 32
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,60 +39,60 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Rectangle{
|
||||
color: "goldenrod"
|
||||
width: 400
|
||||
height: 400
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
id: test
|
||||
particles: ["Test"]
|
||||
image: "content/particle.png"
|
||||
source: "content/particle.png"
|
||||
system: sys
|
||||
z: 2
|
||||
anchors.fill: parent
|
||||
color: "#336666CC"
|
||||
colorVariation: 0.0
|
||||
}
|
||||
SpriteParticle{
|
||||
ImageParticle{
|
||||
id: single
|
||||
particles: ["Face"]
|
||||
system: sys
|
||||
z: 2
|
||||
anchors.fill: parent
|
||||
Sprite{
|
||||
sprites: Sprite{
|
||||
source: "content/squarefacesprite.png"
|
||||
frames: 6
|
||||
duration: 120
|
||||
}
|
||||
}
|
||||
Mask{
|
||||
MaskShape{
|
||||
id: mask
|
||||
source: "content/smileMask.png"
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
system: sys
|
||||
particle: "Test"
|
||||
anchors.fill: parent
|
||||
id: particles2
|
||||
particlesPerSecond: 6000
|
||||
particleDuration: 720
|
||||
emitRate: 6000
|
||||
lifeSpan: 720
|
||||
emitting: true
|
||||
particleSize: 10
|
||||
size: 10
|
||||
shape: mask
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
system: sys
|
||||
particle: "Face"
|
||||
anchors.fill: parent
|
||||
id: particles
|
||||
particlesPerSecond: 60
|
||||
particleDuration: 1440
|
||||
emitRate: 60
|
||||
lifeSpan: 1440
|
||||
emitting: true
|
||||
speed: PointVector{xVariation: 10; yVariation: 10;}
|
||||
particleSize: 30
|
||||
particleSizeVariation: 10
|
||||
speed: PointDirection{xVariation: 10; yVariation: 10;}
|
||||
size: 30
|
||||
sizeVariation: 10
|
||||
shape: mask
|
||||
}
|
||||
ParticleSystem{
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Rectangle{
|
||||
color: "goldenrod"
|
||||
|
@ -109,7 +109,7 @@ Rectangle{
|
|||
z:4
|
||||
}
|
||||
ParticleSystem{ id: sys }
|
||||
SpriteParticle{
|
||||
ImageParticle{
|
||||
anchors.fill: parent
|
||||
id: particles
|
||||
system: sys
|
||||
|
@ -168,15 +168,15 @@ Rectangle{
|
|||
duration: 10000
|
||||
}]
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
system: sys
|
||||
particlesPerSecond: 16
|
||||
particleDuration: 10000
|
||||
emitRate: 16
|
||||
lifeSpan: 10000
|
||||
emitting: true
|
||||
speed: AngleVector{angle: 90; magnitude: 60; angleVariation: 5}
|
||||
acceleration: PointVector{ y: 10 }
|
||||
particleSize: 30
|
||||
particleSizeVariation: 10
|
||||
speed: AngledDirection{angle: 90; magnitude: 60; angleVariation: 5}
|
||||
acceleration: PointDirection{ y: 10 }
|
||||
size: 30
|
||||
sizeVariation: 10
|
||||
width: parent.width
|
||||
height: 100
|
||||
}
|
||||
|
|
|
@ -39,14 +39,14 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Rectangle{
|
||||
color: "goldenrod"
|
||||
width: 800
|
||||
height: 800
|
||||
ParticleSystem{ id: sys }
|
||||
SpriteParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
anchors.fill: parent
|
||||
sprites: [Sprite{
|
||||
|
@ -92,17 +92,17 @@ Rectangle{
|
|||
duration: 120
|
||||
}]
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: particleEmitter
|
||||
system: sys
|
||||
width: parent.width
|
||||
particlesPerSecond: 16
|
||||
particleDuration: 8000
|
||||
emitRate: 16
|
||||
lifeSpan: 8000
|
||||
emitting: true
|
||||
speed: AngleVector{angle: 90; magnitude: 300; magnitudeVariation: 100; angleVariation: 5}
|
||||
acceleration: PointVector{ y: 10 }
|
||||
particleSize: 30
|
||||
particleSizeVariation: 10
|
||||
speed: AngledDirection{angle: 90; magnitude: 300; magnitudeVariation: 100; angleVariation: 5}
|
||||
acceleration: PointDirection{ y: 10 }
|
||||
size: 30
|
||||
sizeVariation: 10
|
||||
}
|
||||
Binding{
|
||||
target: particleEmitter
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Rectangle{
|
||||
color: "white"
|
||||
|
@ -48,7 +48,7 @@ Rectangle{
|
|||
ParticleSystem{
|
||||
id: sys
|
||||
}
|
||||
UltraParticle{
|
||||
ImageParticle{
|
||||
sprites: [
|
||||
Sprite{
|
||||
name: "licking"
|
||||
|
@ -80,16 +80,16 @@ Rectangle{
|
|||
factor: 0.1
|
||||
system: sys
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
system: sys
|
||||
anchors.centerIn: parent
|
||||
id: particles
|
||||
particlesPerSecond: 200
|
||||
particleDuration: 6000
|
||||
emitRate: 200
|
||||
lifeSpan: 6000
|
||||
emitting: true
|
||||
speed: AngleVector{angleVariation: 360; magnitude: 80; magnitudeVariation: 40}
|
||||
particleSize: 40
|
||||
particleEndSize: 80
|
||||
speed: AngledDirection{angleVariation: 360; magnitude: 80; magnitudeVariation: 40}
|
||||
size: 40
|
||||
endSize: 80
|
||||
}
|
||||
Text{
|
||||
x: 16
|
||||
|
|
|
@ -38,8 +38,8 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
|
||||
import Qt.labs.particles 2.0
|
||||
import Qt.labs.particles 2.0 as Qlp
|
||||
import QtQuick.Particles 2.0
|
||||
import QtQuick.Particles 2.0 as Qlp
|
||||
import QtQuick 2.0
|
||||
|
||||
Item {
|
||||
|
@ -65,42 +65,42 @@ Item {
|
|||
}
|
||||
|
||||
}
|
||||
ColoredParticle {
|
||||
ImageParticle {
|
||||
system: sys
|
||||
particles: ["starfield"]
|
||||
image: "content/star.png"
|
||||
source: "content/star.png"
|
||||
colorVariation: 0.3
|
||||
color: "white"
|
||||
}
|
||||
TrailEmitter {
|
||||
Emitter {
|
||||
id: starField
|
||||
system: sys
|
||||
particle: "starfield"
|
||||
|
||||
particlesPerSecond: 80
|
||||
particleDuration: 2500
|
||||
emitRate: 80
|
||||
lifeSpan: 2500
|
||||
|
||||
anchors.centerIn: parent
|
||||
|
||||
//acceleration: AngleVector{angleVariation: 360; magnitude: 200}//Is this a better effect, more consistent speed?
|
||||
acceleration: PointVector{ xVariation: 200; yVariation: 200; }
|
||||
//acceleration: AngledDirection{angleVariation: 360; magnitude: 200}//Is this a better effect, more consistent speed?
|
||||
acceleration: PointDirection{ xVariation: 200; yVariation: 200; }
|
||||
|
||||
particleSize: 0
|
||||
particleEndSize: 80
|
||||
particleSizeVariation: 10
|
||||
size: 0
|
||||
endSize: 80
|
||||
sizeVariation: 10
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
system: sys
|
||||
particle: "meteor"
|
||||
particlesPerSecond: 12
|
||||
particleDuration: 5000
|
||||
emitRate: 12
|
||||
lifeSpan: 5000
|
||||
emitting: true
|
||||
acceleration: PointVector{ xVariation: 80; yVariation: 80; }
|
||||
particleSize: 15
|
||||
particleEndSize: 300
|
||||
acceleration: PointDirection{ xVariation: 80; yVariation: 80; }
|
||||
size: 15
|
||||
endSize: 300
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
SpriteParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
particles: ["meteor"]
|
||||
sprites:[Sprite{
|
||||
|
@ -168,11 +168,11 @@ Item {
|
|||
|
||||
}
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
z:0
|
||||
system: sys
|
||||
particles: ["exhaust"]
|
||||
image: "content/particle4.png"
|
||||
source: "content/particle4.png"
|
||||
|
||||
color: "orange"
|
||||
SequentialAnimation on color {
|
||||
|
@ -191,23 +191,23 @@ Item {
|
|||
|
||||
colorVariation: 0.2
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: trailsNormal2
|
||||
system: sys
|
||||
particle: "exhaust"
|
||||
|
||||
particlesPerSecond: 300
|
||||
particleDuration: 500
|
||||
emitRate: 300
|
||||
lifeSpan: 500
|
||||
|
||||
y: holder.y
|
||||
x: holder.x
|
||||
|
||||
speed: PointVector{ xVariation: 40; yVariation: 40; }
|
||||
speed: PointDirection{ xVariation: 40; yVariation: 40; }
|
||||
speedFromMovement: 16
|
||||
|
||||
acceleration: PointVector{ xVariation: 10; yVariation: 10; }
|
||||
acceleration: PointDirection{ xVariation: 10; yVariation: 10; }
|
||||
|
||||
particleSize: 4
|
||||
particleSizeVariation: 4
|
||||
size: 4
|
||||
sizeVariation: 4
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Rectangle{
|
||||
id: root
|
||||
|
@ -65,41 +65,42 @@ Rectangle{
|
|||
}
|
||||
}
|
||||
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
particle: "stars"
|
||||
system: particles
|
||||
particlesPerSecond: 40
|
||||
particleDuration: 4000
|
||||
emitRate: 40
|
||||
lifeSpan: 4000
|
||||
emitting: true
|
||||
particleSize: 30
|
||||
particleSizeVariation: 10
|
||||
speed: PointVector{ x: 220; xVariation: 40 }
|
||||
size: 30
|
||||
sizeVariation: 10
|
||||
speed: PointDirection{ x: 220; xVariation: 40 }
|
||||
height: parent.height
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
particle: "roids"
|
||||
system: particles
|
||||
particlesPerSecond: 10
|
||||
particleDuration: 4000
|
||||
emitRate: 10
|
||||
lifeSpan: 4000
|
||||
emitting: true
|
||||
particleSize: 30
|
||||
particleSizeVariation: 10
|
||||
speed: PointVector{ x: 220; xVariation: 40 }
|
||||
size: 30
|
||||
sizeVariation: 10
|
||||
speed: PointDirection{ x: 220; xVariation: 40 }
|
||||
height: parent.height
|
||||
}
|
||||
ParticleSystem{
|
||||
id: particles
|
||||
anchors.fill: parent
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
id: stars
|
||||
particles: ["stars"]
|
||||
system: particles
|
||||
image: "content/star.png"
|
||||
source: "content/star.png"
|
||||
color: "white"
|
||||
colorVariation: 0.1
|
||||
alpha: 0
|
||||
}
|
||||
SpriteParticle{
|
||||
ImageParticle{
|
||||
id: roids
|
||||
particles: ["roids"]
|
||||
system: particles
|
||||
|
@ -112,20 +113,20 @@ Rectangle{
|
|||
speedModifiesDuration: -0.1
|
||||
}
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
id: shot
|
||||
particles: ["shot"]
|
||||
system: particles
|
||||
image: "content/star.png"
|
||||
source: "content/star.png"
|
||||
|
||||
color: "#0FF06600"
|
||||
colorVariation: 0.3
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
id: engine
|
||||
particles: ["engine"]
|
||||
system: particles
|
||||
image: "content/particle4.png"
|
||||
source: "content/particle4.png"
|
||||
|
||||
color: "orange"
|
||||
SequentialAnimation on color {
|
||||
|
@ -144,9 +145,11 @@ Rectangle{
|
|||
|
||||
colorVariation: 0.2
|
||||
}
|
||||
GravitationalSingularity{
|
||||
PointAttractor{
|
||||
id: gs; x: root.width/2; y: root.height/2; strength: 4000000;
|
||||
system: particles
|
||||
physics: PointAttractor.Acceleration
|
||||
proportionalToDistance: PointAttractor.Quadratic
|
||||
}
|
||||
Kill{
|
||||
system: particles
|
||||
|
@ -166,27 +169,27 @@ Rectangle{
|
|||
drag.axis: Drag.XandYAxis
|
||||
drag.target: ship
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
particle: "engine"
|
||||
system: particles
|
||||
particlesPerSecond: 200
|
||||
particleDuration: 1000
|
||||
emitRate: 200
|
||||
lifeSpan: 1000
|
||||
emitting: true
|
||||
particleSize: 10
|
||||
particleEndSize: 4
|
||||
particleSizeVariation: 4
|
||||
speed: PointVector{ x: -128; xVariation: 32 }
|
||||
size: 10
|
||||
endSize: 4
|
||||
sizeVariation: 4
|
||||
speed: PointDirection{ x: -128; xVariation: 32 }
|
||||
height: parent.height
|
||||
width: 20
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
particle: "shot"
|
||||
system: particles
|
||||
particlesPerSecond: 32
|
||||
particleDuration: 2000
|
||||
emitRate: 32
|
||||
lifeSpan: 2000
|
||||
emitting: spacePressed
|
||||
particleSize: 40
|
||||
speed: PointVector{ x: 256; }
|
||||
size: 40
|
||||
speed: PointDirection{ x: 256; }
|
||||
x: parent.width
|
||||
y: parent.height/2
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}"
|
||||
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 15 KiB |
|
@ -39,42 +39,66 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Rectangle{
|
||||
width: 360
|
||||
height: 540
|
||||
id: root
|
||||
ParticleSystem{ id: particles }
|
||||
SpriteParticle{
|
||||
system: particles
|
||||
sprites: Sprite{
|
||||
name: "snow"
|
||||
source: "content/flake-01.png"
|
||||
frames: 51
|
||||
duration: 40
|
||||
height: 600
|
||||
color: "black"
|
||||
Component{
|
||||
id: firework
|
||||
Item{
|
||||
id: container
|
||||
width: 48
|
||||
height: 48
|
||||
Image{
|
||||
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{
|
||||
system: particles
|
||||
ParticleSystem{
|
||||
anchors.fill: parent
|
||||
xDrift: 200
|
||||
}
|
||||
SpeedLimit{
|
||||
system: particles
|
||||
anchors.fill: parent
|
||||
speedLimit: 100
|
||||
}
|
||||
TrailEmitter{
|
||||
system: particles
|
||||
particlesPerSecond: 20
|
||||
particleDuration: 7000
|
||||
emitting: true
|
||||
speed: PointVector{ y:80; yVariation: 40; }
|
||||
acceleration: PointVector{ y: 4 }
|
||||
particleSize: 20
|
||||
particleSizeVariation: 10
|
||||
width: parent.width
|
||||
height: 40
|
||||
id: syssy
|
||||
Emitter{
|
||||
particle: "fire"
|
||||
width: parent.width
|
||||
y: parent.height
|
||||
emitRate: 2
|
||||
lifeSpan: 6000
|
||||
speed: PointDirection{y:-100}
|
||||
}
|
||||
ItemParticle{
|
||||
particles: ["fire"]
|
||||
delegate: firework
|
||||
}
|
||||
ImageParticle{
|
||||
particles: ["works"]
|
||||
source: "content/particle.png"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
}"
|
||||
|
||||
}
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
|
@ -39,40 +39,35 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0 as QLP
|
||||
|
||||
Rectangle{
|
||||
width: 200
|
||||
height: 200
|
||||
color: "black"
|
||||
QLP.ParticleSystem{ id: ps }
|
||||
QLP.ColoredParticle{
|
||||
system: ps
|
||||
particles: ["star1","star2"]
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
image: "content/star.png"
|
||||
Rectangle {
|
||||
id: container
|
||||
|
||||
property string text: "Button"
|
||||
signal clicked
|
||||
|
||||
width: buttonLabel.width + 20; height: buttonLabel.height + 20
|
||||
smooth: true
|
||||
property color myCol: "#999999"
|
||||
border { width: 1; color: Qt.darker(myCol) }
|
||||
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
|
||||
leaders: ["star2"];
|
||||
anchors.fill: parent
|
||||
strength: 128
|
||||
}
|
||||
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
|
||||
|
||||
MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() }
|
||||
|
||||
Text {
|
||||
id: buttonLabel; text: container.text; anchors.centerIn: container; color: "black"; font.pixelSize: 24
|
||||
}
|
||||
}
|
|
@ -39,36 +39,40 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
|
||||
Rectangle{
|
||||
width: 360
|
||||
height: 540
|
||||
ParticleSystem{ id: particles }
|
||||
SpriteParticle{
|
||||
system: particles
|
||||
Sprite{
|
||||
name: "snow"
|
||||
source: "content/flake-01.png"
|
||||
frames: 51
|
||||
duration: 40
|
||||
Loader{
|
||||
id: ldr
|
||||
visible: false
|
||||
focus: visible
|
||||
onVisibleChanged: source = ""
|
||||
opacity: visible?1:0
|
||||
Behavior on opacity{NumberAnimation{}}
|
||||
|
||||
function setDemo(str){
|
||||
visible = true;
|
||||
source = str;
|
||||
}
|
||||
Image{//TODO: Augment with PARTICLES
|
||||
z: 1
|
||||
source: "icons/close.png"
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked: ldr.visible = false;
|
||||
}
|
||||
}
|
||||
Drift{
|
||||
system: particles
|
||||
Rectangle{
|
||||
z: -1
|
||||
anchors.fill: parent
|
||||
xDrift: 400;
|
||||
}
|
||||
TrailEmitter{
|
||||
system: particles
|
||||
particlesPerSecond: 20
|
||||
particleDuration: 7000
|
||||
emitting: true
|
||||
speed: PointVector{ y:80; yVariation: 40; }
|
||||
acceleration: PointVector{ y: 4 }
|
||||
particleSize: 20
|
||||
particleSizeVariation: 10
|
||||
width: parent.width
|
||||
height: 100
|
||||
color:"black"
|
||||
Text{
|
||||
color: "white"
|
||||
anchors.centerIn: parent
|
||||
text: ldr.Status == Loader.Error ? "Error :(" : "Loading..."
|
||||
}
|
||||
MouseArea{
|
||||
id: graball
|
||||
anchors.fill: parent
|
||||
onClicked:;
|
||||
}
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 7.6 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 9.1 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 8.0 KiB |
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 1019 B |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 9.6 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 8.9 KiB |
After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 9.4 KiB |
After Width: | Height: | Size: 36 KiB |
|
@ -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";
|
||||
}
|
|
@ -39,7 +39,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
import "../../modelviews/listview/content" as OtherDemo
|
||||
import "content/script.js" as Script
|
||||
import "content"
|
||||
|
@ -56,21 +56,22 @@ Item{
|
|||
ParticleSystem{
|
||||
id: sys;
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
system: sys
|
||||
particle: "A"
|
||||
width: parent.width/2
|
||||
x: parent.width/4
|
||||
y:parent.height
|
||||
speed: PointVector{ y: -64; yVariation: 16 }
|
||||
particlesPerSecond: 1
|
||||
particleDuration: 8000
|
||||
speed: PointDirection{ y: -64; yVariation: 16 }
|
||||
emitRate: 1
|
||||
lifeSpan: 8000
|
||||
}
|
||||
Drift{
|
||||
Wander{
|
||||
system: sys
|
||||
xDrift: 200
|
||||
xVariance: 400
|
||||
pace: 200
|
||||
}
|
||||
DataParticle{
|
||||
ModelParticle{
|
||||
id: mp
|
||||
z: 0
|
||||
system: sys
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
import "content"
|
||||
|
||||
Item{
|
||||
|
@ -48,13 +48,14 @@ Item{
|
|||
height: 240
|
||||
property bool inGrid: false
|
||||
ParticleSystem{ id: sys }
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
system: sys
|
||||
id: burster;
|
||||
emitting: false
|
||||
particlesPerSecond: 1000
|
||||
particleDuration: 500
|
||||
speed: PointVector{xVariation: 400; yVariation: 400}
|
||||
emitRate: 1000
|
||||
lifeSpan: 50000
|
||||
emitCap: 100;
|
||||
speed: PointDirection{xVariation: 400; yVariation: 400}
|
||||
anchors.centerIn: parent
|
||||
Timer{
|
||||
interval: 1000
|
||||
|
@ -69,9 +70,9 @@ Item{
|
|||
onTriggered: {inGrid = true;}// sys.running = false;}
|
||||
}
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
image: "../trails/content/particle.png"
|
||||
source: "../trails/content/particle.png"
|
||||
color: "black"
|
||||
colorVariation: 0.0
|
||||
}
|
||||
|
@ -80,17 +81,14 @@ Item{
|
|||
width: 120
|
||||
height: 120
|
||||
}
|
||||
DataParticle{
|
||||
ModelParticle{
|
||||
system: sys
|
||||
model: theModel.parts.particles
|
||||
fade: false
|
||||
}
|
||||
Friction{
|
||||
system: sys
|
||||
factor: 1
|
||||
}
|
||||
Stasis{
|
||||
system: sys
|
||||
targetLife: 400
|
||||
factor: 5
|
||||
}
|
||||
VisualDataModel{
|
||||
id: theModel
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
import "content"
|
||||
|
||||
Rectangle {
|
||||
|
@ -69,7 +69,7 @@ Rectangle {
|
|||
width: 200; height:200
|
||||
model: visualModel.parts.list
|
||||
}
|
||||
DataParticle{
|
||||
ModelParticle{
|
||||
x: 200; width: 200; height:200
|
||||
model: visualModel.parts.grid
|
||||
system: sys
|
||||
|
@ -80,12 +80,12 @@ Rectangle {
|
|||
id: sys
|
||||
anchors.fill: parent
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
system: sys
|
||||
width: 100
|
||||
x: 50
|
||||
speed: PointVector{ y: 40 }
|
||||
particleDuration: 5000
|
||||
particlesPerSecond: 1.6
|
||||
speed: PointDirection{ y: 40 }
|
||||
lifeSpan: 5000
|
||||
emitRate: 1.6
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
import "content/script.js" as Script
|
||||
import "content"
|
||||
|
||||
|
@ -68,15 +68,15 @@ Item{
|
|||
overwrite: false
|
||||
startTime: 12000//Doesn't actually work with the loading time though...
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: emitter
|
||||
system: sys
|
||||
height: parent.height - 132/2
|
||||
x: -132/2
|
||||
y: 132/2
|
||||
speed: PointVector{ x: 32; xVariation: 8 }
|
||||
particlesPerSecond: 0.5
|
||||
particleDuration: 120000 //TODO: A -1 or something which does 'infinite'? (but need disable fade first)
|
||||
speed: PointDirection{ x: 32; xVariation: 8 }
|
||||
emitRate: 0.5
|
||||
lifeSpan: 120000 //TODO: A -1 or something which does 'infinite'? (but need disable fade first)
|
||||
particle: "photos"
|
||||
}
|
||||
Kill{
|
||||
|
@ -85,10 +85,10 @@ Item{
|
|||
height: parent.height
|
||||
width: 1000
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
particles: ["fireworks"]
|
||||
image: "../trails/content/star.png"
|
||||
source: "../trails/content/star.png"
|
||||
color: "lightsteelblue"
|
||||
alpha: 0
|
||||
colorVariation: 0
|
||||
|
@ -125,7 +125,7 @@ Item{
|
|||
}
|
||||
property Item alertItem;
|
||||
function alert(){
|
||||
resetter.active = false
|
||||
//resetter.active = false
|
||||
force.active = true;
|
||||
alertItem = alertDelegate.createObject(root);
|
||||
alertItem.x = root.width/2 - alertItem.width/2
|
||||
|
@ -142,34 +142,30 @@ Item{
|
|||
interval: 800
|
||||
onTriggered: {
|
||||
force.active = false
|
||||
resetter.active = true;
|
||||
//resetter.active = true;
|
||||
mp.take(alertItem, true);
|
||||
centerEmitter.burst(1);
|
||||
}
|
||||
}
|
||||
Attractor{
|
||||
PointAttractor{
|
||||
id: force
|
||||
system: sys
|
||||
x: root.width/2
|
||||
y: root.height/2
|
||||
strength: -30000
|
||||
strength: -10000
|
||||
active: false
|
||||
anchors.centerIn: parent
|
||||
width: parent.width/2
|
||||
height: parent.height/2
|
||||
particles:["photos"]
|
||||
physics: PointAttractor.Position
|
||||
}
|
||||
Reset{
|
||||
id: resetter
|
||||
system: sys
|
||||
particles:["photos"]
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: centerEmitter
|
||||
speed: PointVector{ x: 32; xVariation: 8;}
|
||||
particlesPerSecond: 0.5
|
||||
particleDuration: 12000 //TODO: A -1 or something which does 'infinite'? (but need disable fade first)
|
||||
maxParticles: 20
|
||||
speed: PointDirection{ x: 32; xVariation: 8;}
|
||||
emitRate: 0.5
|
||||
lifeSpan: 12000 //TODO: A -1 or something which does 'infinite'? (but need disable fade first)
|
||||
emitCap: 20
|
||||
particle: "photos"
|
||||
system: sys
|
||||
anchors.centerIn: parent
|
||||
|
@ -177,22 +173,22 @@ Item{
|
|||
|
||||
//TODO: Zoom in effect
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: spawnFireworks
|
||||
particle: "fireworks"
|
||||
system: sys
|
||||
maxParticles: 400
|
||||
particlesPerSecond: 400
|
||||
particleDuration: 2800
|
||||
emitCap: 400
|
||||
emitRate: 400
|
||||
lifeSpan: 2800
|
||||
x: parent.width/2
|
||||
y: parent.height/2 - 64
|
||||
width: 8
|
||||
height: 8
|
||||
emitting: false
|
||||
particleSize: 32
|
||||
particleEndSize: 8
|
||||
speed: AngleVector{ magnitude: 160; magnitudeVariation: 120; angleVariation: 90; angle: 270 }
|
||||
acceleration: PointVector{ y: 160 }
|
||||
size: 32
|
||||
endSize: 8
|
||||
speed: AngledDirection{ magnitude: 160; magnitudeVariation: 120; angleVariation: 90; angle: 270 }
|
||||
acceleration: PointDirection{ y: 160 }
|
||||
}
|
||||
Item{ x: -1000; y: -1000 //offscreen
|
||||
Repeater{//Load them here, add to system on completed
|
||||
|
|
|
@ -39,15 +39,17 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
import "content"
|
||||
import "../launcherContent" as UI
|
||||
|
||||
Rectangle{
|
||||
width: 360
|
||||
height: 540
|
||||
ParticleSystem { id: particles }
|
||||
SpriteParticle {
|
||||
ImageParticle {
|
||||
system: particles
|
||||
Sprite{
|
||||
sprites: Sprite{
|
||||
name: "snow"
|
||||
source: "content/flake-01.png"
|
||||
frames: 51
|
||||
|
@ -55,21 +57,38 @@ Rectangle{
|
|||
}
|
||||
}
|
||||
Wander {
|
||||
id: wanderer
|
||||
system: particles
|
||||
anchors.fill: parent
|
||||
xVariance: 40;
|
||||
pace: 40;
|
||||
xVariance: 360/(wanderer.physics+1);
|
||||
pace: 100*(wanderer.physics+1);
|
||||
}
|
||||
TrailEmitter {
|
||||
Emitter {
|
||||
system: particles
|
||||
particlesPerSecond: 20
|
||||
particleDuration: 7000
|
||||
emitRate: 20
|
||||
lifeSpan: 7000
|
||||
emitting: true
|
||||
speed: PointVector{ y:80; yVariation: 40; }
|
||||
acceleration: PointVector{ y: 4 }
|
||||
particleSize: 20
|
||||
particleSizeVariation: 10
|
||||
speed: PointDirection{ y:80; yVariation: 40; }
|
||||
acceleration: PointDirection{ y: 4 }
|
||||
size: 20
|
||||
sizeVariation: 10
|
||||
width: parent.width
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
import "content/helpers.js" as Helpers
|
||||
|
||||
Rectangle{
|
||||
|
@ -75,22 +75,22 @@ Rectangle{
|
|||
property bool fakeMoving: false
|
||||
property real fakeMovementDir: 0
|
||||
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
particle: "stars2"
|
||||
system: background
|
||||
particlesPerSecond: 60
|
||||
particleDuration: 4000
|
||||
emitRate: 60
|
||||
lifeSpan: 4000
|
||||
emitting: true
|
||||
particleSize: 10
|
||||
particleSizeVariation: 10
|
||||
size: 10
|
||||
sizeVariation: 10
|
||||
anchors.fill: parent
|
||||
}
|
||||
ParticleSystem{ id: background }
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
particles: ["stars2"]
|
||||
system: background
|
||||
anchors.fill: parent
|
||||
image: "content/star.png"
|
||||
source: "content/star.png"
|
||||
color: "white"
|
||||
colorVariation: 0.1
|
||||
}
|
||||
|
@ -197,29 +197,29 @@ Rectangle{
|
|||
|
||||
|
||||
ParticleSystem{ id: foreground }
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
particles: ["stars"]
|
||||
anchors.fill: parent
|
||||
system: foreground
|
||||
image: "content/star.png"
|
||||
source: "content/star.png"
|
||||
color: "white"
|
||||
colorVariation: 0.1
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
particles: ["shot"]
|
||||
anchors.fill: parent
|
||||
system: foreground
|
||||
image: "content/star.png"
|
||||
source: "content/star.png"
|
||||
|
||||
color: "orange"
|
||||
colorVariation: 0.3
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
id: engine
|
||||
particles: ["engine"]
|
||||
anchors.fill: parent
|
||||
system: foreground
|
||||
image: "content/particle4.png"
|
||||
source: "content/particle4.png"
|
||||
|
||||
color: "orange"
|
||||
SequentialAnimation on color {
|
||||
|
@ -238,30 +238,31 @@ Rectangle{
|
|||
|
||||
colorVariation: 0.2
|
||||
}
|
||||
SpriteParticle{
|
||||
ImageParticle{
|
||||
particles: ["powerups"]
|
||||
anchors.fill: parent
|
||||
system: foreground
|
||||
Sprite{
|
||||
sprites:[Sprite{
|
||||
name: "norm"
|
||||
source: "content/powerupScore.png"
|
||||
frames: 35
|
||||
duration: 40
|
||||
to: {"norm":1, "got":0}
|
||||
}
|
||||
},
|
||||
Sprite{
|
||||
name: "got"
|
||||
source: "content/powerupScore_got.png"
|
||||
frames: 22
|
||||
duration: 40
|
||||
to: {"null":1}
|
||||
}
|
||||
},
|
||||
Sprite{
|
||||
name: "null"
|
||||
source: "content/powerupScore_gone.png"
|
||||
frames: 1
|
||||
duration: 1000
|
||||
}
|
||||
]
|
||||
}
|
||||
SpriteGoal{
|
||||
x: rocket.x - 30
|
||||
|
@ -273,8 +274,9 @@ Rectangle{
|
|||
onAffected: if(!gameOver) score += 1000
|
||||
system: foreground
|
||||
}
|
||||
GravitationalSingularity{
|
||||
PointAttractor{
|
||||
id: gs1; x: vorteX; y: vorteY; strength: 800000;
|
||||
proportionalToDistance: PointAttractor.Quadratic;
|
||||
system: foreground
|
||||
}
|
||||
Kill{
|
||||
|
@ -285,8 +287,9 @@ Rectangle{
|
|||
system: foreground
|
||||
}
|
||||
|
||||
GravitationalSingularity{
|
||||
PointAttractor{
|
||||
id: gs2; x: vorteX2; y: vorteY2; strength: 800000;
|
||||
proportionalToDistance: PointAttractor.Quadratic;
|
||||
system: foreground
|
||||
}
|
||||
Kill{
|
||||
|
@ -297,8 +300,9 @@ Rectangle{
|
|||
system: foreground
|
||||
}
|
||||
|
||||
GravitationalSingularity{
|
||||
PointAttractor{
|
||||
id: gs3; x: vorteX3; y: vorteY3; strength: 800000;
|
||||
proportionalToDistance: PointAttractor.Quadratic;
|
||||
system: foreground
|
||||
}
|
||||
Kill{
|
||||
|
@ -308,8 +312,9 @@ Rectangle{
|
|||
height: holeSize * 2
|
||||
system: foreground
|
||||
}
|
||||
GravitationalSingularity{
|
||||
PointAttractor{
|
||||
id: gs4; x: vorteX4; y: vorteY4; strength: 800000;
|
||||
proportionalToDistance: PointAttractor.Quadratic;
|
||||
system: foreground
|
||||
}
|
||||
Kill{
|
||||
|
@ -319,24 +324,24 @@ Rectangle{
|
|||
height: holeSize * 2
|
||||
system: foreground
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
particle: "powerups"
|
||||
system: foreground
|
||||
particlesPerSecond: 1
|
||||
particleDuration: 6000
|
||||
emitRate: 1
|
||||
lifeSpan: 6000
|
||||
emitting: !gameOver
|
||||
particleSize: 60
|
||||
particleSizeVariation: 10
|
||||
size: 60
|
||||
sizeVariation: 10
|
||||
anchors.fill: parent
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
particle: "stars"
|
||||
system: foreground
|
||||
particlesPerSecond: 40
|
||||
particleDuration: 4000
|
||||
emitRate: 40
|
||||
lifeSpan: 4000
|
||||
emitting: !gameOver
|
||||
particleSize: 30
|
||||
particleSizeVariation: 10
|
||||
size: 30
|
||||
sizeVariation: 10
|
||||
anchors.fill: parent
|
||||
}
|
||||
SpriteImage{
|
||||
|
@ -374,16 +379,16 @@ Rectangle{
|
|||
drag.axis: Drag.XandYAxis
|
||||
drag.target: rocket
|
||||
},
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
system: foreground
|
||||
particle: "engine"
|
||||
particlesPerSecond: 100
|
||||
particleDuration: 1000
|
||||
emitRate: 100
|
||||
lifeSpan: 1000
|
||||
emitting: !gameOver
|
||||
particleSize: 10
|
||||
particleEndSize: 4
|
||||
particleSizeVariation: 4
|
||||
speed: PointVector{
|
||||
size: 10
|
||||
endSize: 4
|
||||
sizeVariation: 4
|
||||
speed: PointDirection{
|
||||
x: -128 * Math.cos(rocket.rotation * (Math.PI / 180))
|
||||
y: -128 * Math.sin(rocket.rotation * (Math.PI / 180))
|
||||
}
|
||||
|
@ -392,14 +397,14 @@ Rectangle{
|
|||
width: 4
|
||||
|
||||
},
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
system: foreground
|
||||
particle: "shot"
|
||||
particlesPerSecond: 16
|
||||
particleDuration: 1600
|
||||
emitRate: 16
|
||||
lifeSpan: 1600
|
||||
emitting: !gameOver && shoot
|
||||
particleSize: 40
|
||||
speed: PointVector{
|
||||
size: 40
|
||||
speed: PointDirection{
|
||||
x: 256 * Math.cos(rocket.rotation * (Math.PI / 180))
|
||||
y: 256 * Math.sin(rocket.rotation * (Math.PI / 180))
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Rectangle{
|
||||
id: root
|
||||
|
@ -49,26 +49,26 @@ Rectangle{
|
|||
ParticleSystem{
|
||||
id: sys
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
image: "content/particle.png"
|
||||
source: "content/particle.png"
|
||||
color: "white"
|
||||
colorVariation: 1.0
|
||||
alpha: 0.1
|
||||
}
|
||||
Component{
|
||||
id: emitterComp
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: container
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: emitMore
|
||||
system: sys
|
||||
emitting: true
|
||||
particlesPerSecond: 128
|
||||
particleDuration: 600
|
||||
particleSize: 16
|
||||
particleEndSize: 8
|
||||
speed: AngleVector{angleVariation:360; magnitude: 60}
|
||||
emitRate: 128
|
||||
lifeSpan: 600
|
||||
size: 16
|
||||
endSize: 8
|
||||
speed: AngledDirection{angleVariation:360; magnitude: 60}
|
||||
}
|
||||
|
||||
property int life: 2600
|
||||
|
@ -81,10 +81,10 @@ Rectangle{
|
|||
}
|
||||
system: sys
|
||||
emitting: true
|
||||
particlesPerSecond: 64
|
||||
particleDuration: 600
|
||||
particleSize: 24
|
||||
particleEndSize: 8
|
||||
emitRate: 32
|
||||
lifeSpan: 600
|
||||
size: 24
|
||||
endSize: 8
|
||||
NumberAnimation on x{
|
||||
id: xAnim;
|
||||
to: targetX
|
||||
|
@ -107,12 +107,12 @@ Rectangle{
|
|||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked:{
|
||||
for(var i=0; i<16; i++){
|
||||
for(var i=0; i<8; i++){
|
||||
var obj = emitterComp.createObject(root);
|
||||
obj.x = mouse.x
|
||||
obj.y = mouse.y
|
||||
obj.targetX = Math.random() * 640
|
||||
obj.targetY = Math.random() * 480
|
||||
obj.targetX = Math.random() * 240 - 120 + obj.x
|
||||
obj.targetY = Math.random() * 240 - 120 + obj.y
|
||||
obj.life = Math.round(Math.random() * 2400) + 200
|
||||
obj.go();
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
|
@ -52,35 +52,35 @@ Rectangle {
|
|||
}
|
||||
|
||||
/*
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
id: fireball
|
||||
anchors.fill: parent
|
||||
particles: ["E"]
|
||||
system: particles
|
||||
image: "content/particleA.png"
|
||||
source: "content/particleA.png"
|
||||
colorVariation: 0.2
|
||||
color: "#00ff400f"
|
||||
}
|
||||
*/
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
id: smoke
|
||||
system: particles
|
||||
anchors.fill: parent
|
||||
particles: ["A", "B"]
|
||||
image: "content/particle.png"
|
||||
source: "content/particle.png"
|
||||
colorVariation: 0
|
||||
color: "#00111111"
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
id: flame
|
||||
anchors.fill: parent
|
||||
system: particles
|
||||
particles: ["C", "D"]
|
||||
image: "content/particle.png"
|
||||
source: "content/particle.png"
|
||||
colorVariation: 0.1
|
||||
color: "#00ff400f"
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: fire
|
||||
system: particles
|
||||
particle: "C"
|
||||
|
@ -88,15 +88,15 @@ Rectangle {
|
|||
y: parent.height
|
||||
width: parent.width
|
||||
|
||||
particlesPerSecond: 350
|
||||
particleDuration: 3500
|
||||
emitRate: 350
|
||||
lifeSpan: 3500
|
||||
|
||||
acceleration: PointVector{ y: -17; xVariation: 3 }
|
||||
speed: PointVector{xVariation: 3}
|
||||
acceleration: PointDirection{ y: -17; xVariation: 3 }
|
||||
speed: PointDirection{xVariation: 3}
|
||||
|
||||
particleSize: 24
|
||||
particleSizeVariation: 8
|
||||
particleEndSize: 4
|
||||
size: 24
|
||||
sizeVariation: 8
|
||||
endSize: 4
|
||||
}
|
||||
FollowEmitter{
|
||||
id: fireSmoke
|
||||
|
@ -106,15 +106,15 @@ Rectangle {
|
|||
width: root.width
|
||||
height: root.height - 68
|
||||
|
||||
particlesPerParticlePerSecond: 1
|
||||
particleDuration: 2000
|
||||
emitRatePerParticle: 1
|
||||
lifeSpan: 2000
|
||||
|
||||
speed: PointVector{y:-17*6; yVariation: -17; xVariation: 3}
|
||||
acceleration: PointVector{xVariation: 3}
|
||||
speed: PointDirection{y:-17*6; yVariation: -17; xVariation: 3}
|
||||
acceleration: PointDirection{xVariation: 3}
|
||||
|
||||
particleSize: 36
|
||||
particleSizeVariation: 8
|
||||
particleEndSize: 16
|
||||
size: 36
|
||||
sizeVariation: 8
|
||||
endSize: 16
|
||||
}
|
||||
FollowEmitter{
|
||||
id: fireballFlame
|
||||
|
@ -123,14 +123,14 @@ Rectangle {
|
|||
particle: "D"
|
||||
follow: "E"
|
||||
|
||||
particlesPerParticlePerSecond: 120
|
||||
particleDuration: 180
|
||||
emissionWidth: 8
|
||||
emissionHeight: 8
|
||||
emitRatePerParticle: 120
|
||||
lifeSpan: 180
|
||||
emitWidth: 8
|
||||
emitHeight: 8
|
||||
|
||||
particleSize: 16
|
||||
particleSizeVariation: 4
|
||||
particleEndSize: 4
|
||||
size: 16
|
||||
sizeVariation: 4
|
||||
endSize: 4
|
||||
}
|
||||
|
||||
FollowEmitter{
|
||||
|
@ -140,19 +140,19 @@ Rectangle {
|
|||
particle: "A"
|
||||
follow: "E"
|
||||
|
||||
particlesPerParticlePerSecond: 128
|
||||
particleDuration: 2400
|
||||
emissionWidth: 16
|
||||
emissionHeight: 16
|
||||
emitRatePerParticle: 128
|
||||
lifeSpan: 2400
|
||||
emitWidth: 16
|
||||
emitHeight: 16
|
||||
|
||||
speed: PointVector{yVariation: 16; xVariation: 16}
|
||||
acceleration: PointVector{y: -16}
|
||||
speed: PointDirection{yVariation: 16; xVariation: 16}
|
||||
acceleration: PointDirection{y: -16}
|
||||
|
||||
particleSize: 24
|
||||
particleSizeVariation: 8
|
||||
particleEndSize: 8
|
||||
size: 24
|
||||
sizeVariation: 8
|
||||
endSize: 8
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: balls
|
||||
system: particles
|
||||
particle: "E"
|
||||
|
@ -160,14 +160,14 @@ Rectangle {
|
|||
y: parent.height
|
||||
width: parent.width
|
||||
|
||||
particlesPerSecond: 2
|
||||
particleDuration: 7000
|
||||
emitRate: 2
|
||||
lifeSpan: 7000
|
||||
|
||||
speed: PointVector{y:-17*4*2; xVariation: 6*6}
|
||||
acceleration: PointVector{y: 17*2; xVariation: 6*6}
|
||||
speed: PointDirection{y:-17*4*2; xVariation: 6*6}
|
||||
acceleration: PointDirection{y: 17*2; xVariation: 6*6}
|
||||
|
||||
particleSize: 12
|
||||
particleSizeVariation: 4
|
||||
size: 12
|
||||
sizeVariation: 4
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Rectangle{
|
||||
id: root
|
||||
|
@ -55,30 +55,26 @@ Rectangle{
|
|||
id: sys
|
||||
startTime: 4000
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
system: sys
|
||||
y:root.height + 20
|
||||
width: root.width
|
||||
particlesPerSecond: 200
|
||||
particleDuration: 4000
|
||||
speed: PointVector{ y: -120; }
|
||||
emitRate: 200
|
||||
lifeSpan: 4000
|
||||
speed: PointDirection{ y: -120; }
|
||||
}
|
||||
SpriteParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
visible: !cloneMode
|
||||
Sprite{
|
||||
source: "content/particle2.png"
|
||||
}
|
||||
source: "content/particle2.png"
|
||||
}
|
||||
SpriteParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
visible: cloneMode
|
||||
z: 0
|
||||
Sprite{
|
||||
source: "content/particle3.png"
|
||||
}
|
||||
source: "content/particle3.png"
|
||||
}
|
||||
SpriteParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
clip: true
|
||||
visible: cloneMode
|
||||
|
@ -86,8 +82,6 @@ Rectangle{
|
|||
height: 240
|
||||
width: root.width
|
||||
z: 1
|
||||
Sprite{
|
||||
source: "content/particle.png"
|
||||
}
|
||||
source: "content/particle.png"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,18 +43,18 @@
|
|||
// highlight bar is moved between items. + Particles.
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
import "content"
|
||||
|
||||
Rectangle {
|
||||
width: 200; height: 300
|
||||
color: "black"
|
||||
ParticleSystem{ id: particles }
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
anchors.fill: parent
|
||||
system: particles
|
||||
z: 10
|
||||
image: "content/star.png"
|
||||
source: "content/star.png"
|
||||
color: "white"
|
||||
colorVariation: 0.0
|
||||
}
|
||||
|
@ -92,14 +92,14 @@ Rectangle {
|
|||
y: listView.currentItem.y;
|
||||
//Behavior on y { SpringAnimation { spring: 2; damping: 0.1 } }
|
||||
Behavior on y { NumberAnimation {id: anim} }
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
anchors.fill: parent
|
||||
system: particles;
|
||||
emitting: anim.running
|
||||
particlesPerSecond: 600
|
||||
particleDuration: 600
|
||||
particleSize: 16
|
||||
particleEndSize: 8
|
||||
emitRate: 600
|
||||
lifeSpan: 600
|
||||
size: 16
|
||||
endSize: 8
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,34 +39,34 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Rectangle{
|
||||
color: "black"
|
||||
width: 360
|
||||
height: 540
|
||||
ParticleSystem{ id: sys }
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
id: cp
|
||||
image: "content/particle.png"
|
||||
source: "content/particle.png"
|
||||
colorVariation: 0.4
|
||||
color: "#000000FF"
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
//burst on click
|
||||
id: bursty
|
||||
system: sys
|
||||
emitting: ma.pressed
|
||||
x: ma.mouseX
|
||||
y: ma.mouseY
|
||||
particlesPerSecond: 16000
|
||||
particleDuration: 1000
|
||||
maxParticles: 4000
|
||||
acceleration: AngleVector{angleVariation: 360; magnitude: 360; }
|
||||
particleSize: 8
|
||||
particleEndSize: 16
|
||||
particleSizeVariation: 4
|
||||
emitRate: 16000
|
||||
lifeSpan: 1000
|
||||
emitCap: 4000
|
||||
acceleration: AngledDirection{angleVariation: 360; magnitude: 360; }
|
||||
size: 8
|
||||
endSize: 16
|
||||
sizeVariation: 4
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Rectangle{
|
||||
id: root
|
||||
|
@ -54,51 +54,51 @@ Rectangle{
|
|||
id: particles
|
||||
startTime: 2000
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
particles: ["center","edge"]
|
||||
anchors.fill: parent
|
||||
system: particles
|
||||
image: "content/particle.png"
|
||||
source: "content/particle.png"
|
||||
colorVariation: 0.1
|
||||
color: "#009999FF"
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
anchors.fill: parent
|
||||
particle: "center"
|
||||
system: particles
|
||||
particlesPerSecond: 200
|
||||
particleDuration: 2000
|
||||
emitRate: 200
|
||||
lifeSpan: 2000
|
||||
emitting: true
|
||||
particleSize: 20
|
||||
particleSizeVariation: 2
|
||||
particleEndSize: 0
|
||||
shape: Ellipse{fill: false}
|
||||
speed: DirectedVector{
|
||||
size: 20
|
||||
sizeVariation: 2
|
||||
endSize: 0
|
||||
shape: EllipseShape{fill: false}
|
||||
speed: TargetedDirection{
|
||||
targetX: root.width/2
|
||||
targetY: root.height/2
|
||||
proportionalMagnitude: true
|
||||
magnitude: 0.5
|
||||
}
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
anchors.fill: parent
|
||||
particle: "edge"
|
||||
system: particles
|
||||
particlesPerSecond: 4000
|
||||
particleDuration: 2000
|
||||
emitRate: 4000
|
||||
lifeSpan: 2000
|
||||
emitting: true
|
||||
particleSize: 20
|
||||
particleSizeVariation: 2
|
||||
particleEndSize: 0
|
||||
shape: Ellipse{fill: false}
|
||||
speed: DirectedVector{
|
||||
size: 20
|
||||
sizeVariation: 2
|
||||
endSize: 0
|
||||
shape: EllipseShape{fill: false}
|
||||
speed: TargetedDirection{
|
||||
targetX: root.width/2
|
||||
targetY: root.height/2
|
||||
proportionalMagnitude: true
|
||||
magnitude: 0.1
|
||||
magnitudeVariation: 0.1
|
||||
}
|
||||
acceleration: DirectedVector{
|
||||
acceleration: TargetedDirection{
|
||||
targetX: root.width/2
|
||||
targetY: root.height/2
|
||||
targetVariation: 200
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
import QtQuick 2.0
|
||||
|
||||
Rectangle {
|
||||
|
@ -48,19 +48,19 @@ Rectangle {
|
|||
color: "black"
|
||||
|
||||
ParticleSystem{ id: particles }
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
system: particles
|
||||
colorVariation: 0.5
|
||||
alpha: 0
|
||||
|
||||
image: "content/particle.png"
|
||||
source: "content/particle.png"
|
||||
colorTable: "content/colortable.png"
|
||||
sizeTable: "content/colortable.png"
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
system: particles
|
||||
particlesPerSecond: 500
|
||||
particleDuration: 2000
|
||||
emitRate: 500
|
||||
lifeSpan: 2000
|
||||
|
||||
y: root.height / 2 + Math.sin(t * 2) * root.height * 0.3
|
||||
x: root.width / 2 + Math.cos(t) * root.width * 0.3
|
||||
|
@ -72,11 +72,11 @@ Rectangle {
|
|||
|
||||
speedFromMovement: 20
|
||||
|
||||
speed: PointVector{ xVariation: 5; yVariation: 5;}
|
||||
acceleration: PointVector{ xVariation: 5; yVariation: 5;}
|
||||
speed: PointDirection{ xVariation: 5; yVariation: 5;}
|
||||
acceleration: PointDirection{ xVariation: 5; yVariation: 5;}
|
||||
|
||||
particleSize: 16
|
||||
//particleEndSize: 8
|
||||
//particleSizeVariation: 8
|
||||
size: 16
|
||||
//endSize: 8
|
||||
//sizeVariation: 8
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Rectangle{
|
||||
width: 360
|
||||
|
@ -53,21 +53,21 @@ Rectangle{
|
|||
id: particles
|
||||
running: false
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
anchors.fill: parent
|
||||
system: particles
|
||||
image: "content/star.png"
|
||||
source: "content/star.png"
|
||||
sizeTable: "content/sparkleSize.png"
|
||||
alpha: 0
|
||||
colorVariation: 0.6
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
anchors.fill: parent
|
||||
system: particles
|
||||
particlesPerSecond: 2000
|
||||
particleDuration: 2000
|
||||
emitRate: 2000
|
||||
lifeSpan: 2000
|
||||
emitting: true
|
||||
particleSize: 30
|
||||
particleSizeVariation: 10
|
||||
size: 30
|
||||
sizeVariation: 10
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,44 +39,44 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Rectangle{
|
||||
color: "black"
|
||||
width: 360
|
||||
height: 540
|
||||
ParticleSystem{ id: sys }
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
system: sys
|
||||
id: cp
|
||||
image: "content/particle.png"
|
||||
source: "content/particle.png"
|
||||
color: "#00FFFFFF"
|
||||
colorVariation: 0.4
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
//burst on click
|
||||
id: bursty
|
||||
system: sys
|
||||
emitting: false
|
||||
particlesPerSecond: 2000
|
||||
particleDuration: 500
|
||||
acceleration: AngleVector{ angle: 90; angleVariation: 360; magnitude: 640; }
|
||||
particleSize: 8
|
||||
particleEndSize: 16
|
||||
particleSizeVariation: 4
|
||||
emitRate: 2000
|
||||
lifeSpan: 500
|
||||
acceleration: AngledDirection{ angle: 90; angleVariation: 360; magnitude: 640; }
|
||||
size: 8
|
||||
endSize: 16
|
||||
sizeVariation: 4
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
system: sys
|
||||
speedFromMovement: 4.0
|
||||
emitting: ma.pressed
|
||||
x: ma.mouseX
|
||||
y: ma.mouseY
|
||||
particlesPerSecond: 400
|
||||
particleDuration: 2000
|
||||
acceleration: AngleVector{ angle: 90; angleVariation: 22; magnitude: 32; }
|
||||
particleSize: 8
|
||||
particleEndSize: 16
|
||||
particleSizeVariation: 8
|
||||
emitRate: 400
|
||||
lifeSpan: 2000
|
||||
acceleration: AngledDirection{ angle: 90; angleVariation: 22; magnitude: 32; }
|
||||
size: 8
|
||||
endSize: 16
|
||||
sizeVariation: 8
|
||||
}
|
||||
MouseArea{
|
||||
id: ma
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Rectangle{
|
||||
width: 360
|
||||
|
@ -66,32 +66,32 @@ Rectangle{
|
|||
frequency: 64
|
||||
gridSize: 16
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
particles: ["smoke"]
|
||||
system: ps
|
||||
image: "content/particle.png"
|
||||
source: "content/particle.png"
|
||||
color: "#11111111"
|
||||
colorVariation: 0
|
||||
}
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
particles: ["flame"]
|
||||
system: ps
|
||||
image: "content/particle.png"
|
||||
source: "content/particle.png"
|
||||
color: "#11ff400f"
|
||||
colorVariation: 0.1
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
anchors.centerIn: parent
|
||||
system: ps
|
||||
particle: "flame"
|
||||
|
||||
particlesPerSecond: 120
|
||||
particleDuration: 1200
|
||||
particleSize: 20
|
||||
particleEndSize: 10
|
||||
particleSizeVariation: 10
|
||||
acceleration: PointVector{ y: -40 }
|
||||
speed: AngleVector{ angle: 270; magnitude: 20; angleVariation: 22; magnitudeVariation: 5 }
|
||||
emitRate: 120
|
||||
lifeSpan: 1200
|
||||
size: 20
|
||||
endSize: 10
|
||||
sizeVariation: 10
|
||||
acceleration: PointDirection{ y: -40 }
|
||||
speed: AngledDirection{ angle: 270; magnitude: 20; angleVariation: 22; magnitudeVariation: 5 }
|
||||
}
|
||||
FollowEmitter{
|
||||
id: smoke1
|
||||
|
@ -101,14 +101,14 @@ Rectangle{
|
|||
particle: "smoke"
|
||||
follow: "flame"
|
||||
|
||||
particlesPerParticlePerSecond: 4
|
||||
particleDuration: 2400
|
||||
particleDurationVariation: 400
|
||||
particleSize: 16
|
||||
particleEndSize: 8
|
||||
particleSizeVariation: 8
|
||||
acceleration: PointVector{ y: -40 }
|
||||
speed: AngleVector{ angle: 270; magnitude: 40; angleVariation: 22; magnitudeVariation: 5 }
|
||||
emitRatePerParticle: 4
|
||||
lifeSpan: 2400
|
||||
lifeSpanVariation: 400
|
||||
size: 16
|
||||
endSize: 8
|
||||
sizeVariation: 8
|
||||
acceleration: PointDirection{ y: -40 }
|
||||
speed: AngledDirection{ angle: 270; magnitude: 40; angleVariation: 22; magnitudeVariation: 5 }
|
||||
}
|
||||
FollowEmitter{
|
||||
id: smoke2
|
||||
|
@ -118,12 +118,12 @@ Rectangle{
|
|||
particle: "smoke"
|
||||
follow: "flame"
|
||||
|
||||
particlesPerParticlePerSecond: 1
|
||||
particleDuration: 2400
|
||||
particleSize: 36
|
||||
particleEndSize: 24
|
||||
particleSizeVariation: 8
|
||||
acceleration: PointVector{ y: -40 }
|
||||
speed: AngleVector{ angle: 270; magnitude: 40; angleVariation: 22; magnitudeVariation: 5 }
|
||||
emitRatePerParticle: 1
|
||||
lifeSpan: 2400
|
||||
size: 36
|
||||
endSize: 24
|
||||
sizeVariation: 8
|
||||
acceleration: PointDirection{ y: -40 }
|
||||
speed: AngledDirection{ angle: 270; magnitude: 40; angleVariation: 22; magnitudeVariation: 5 }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.particles 2.0
|
||||
import QtQuick.Particles 2.0
|
||||
|
||||
Rectangle {
|
||||
|
||||
|
@ -75,9 +75,9 @@ Rectangle {
|
|||
}
|
||||
|
||||
ParticleSystem{ id: sys1 }
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
system: sys1
|
||||
image: "content/particle.png"
|
||||
source: "content/particle.png"
|
||||
color: "cyan"
|
||||
alpha: 0
|
||||
SequentialAnimation on color {
|
||||
|
@ -105,26 +105,26 @@ Rectangle {
|
|||
}
|
||||
colorVariation: 0.3
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: trailsNormal
|
||||
system: sys1
|
||||
|
||||
particlesPerSecond: 500
|
||||
particleDuration: 2000
|
||||
emitRate: 500
|
||||
lifeSpan: 2000
|
||||
|
||||
|
||||
y: mouseArea.pressed ? mouseArea.mouseY : circle.cy
|
||||
x: mouseArea.pressed ? mouseArea.mouseX : circle.cx
|
||||
|
||||
speed: PointVector{xVariation: 4; yVariation: 4;}
|
||||
acceleration: PointVector{xVariation: 10; yVariation: 10;}
|
||||
speed: PointDirection{xVariation: 4; yVariation: 4;}
|
||||
acceleration: PointDirection{xVariation: 10; yVariation: 10;}
|
||||
speedFromMovement: 8
|
||||
|
||||
particleSize: 8
|
||||
particleSizeVariation: 4
|
||||
size: 8
|
||||
sizeVariation: 4
|
||||
}
|
||||
ParticleSystem { id: sys2 }
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
color: "cyan"
|
||||
system: sys2
|
||||
alpha: 0
|
||||
|
@ -142,29 +142,29 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
colorVariation: 0.5
|
||||
image: "content/star.png"
|
||||
source: "content/star.png"
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: trailsStars
|
||||
system: sys2
|
||||
|
||||
particlesPerSecond: 100
|
||||
particleDuration: 2200
|
||||
emitRate: 100
|
||||
lifeSpan: 2200
|
||||
|
||||
|
||||
y: mouseArea.pressed ? mouseArea.mouseY : circle.cy
|
||||
x: mouseArea.pressed ? mouseArea.mouseX : circle.cx
|
||||
|
||||
speed: PointVector{xVariation: 4; yVariation: 4;}
|
||||
acceleration: PointVector{xVariation: 10; yVariation: 10;}
|
||||
speed: PointDirection{xVariation: 4; yVariation: 4;}
|
||||
acceleration: PointDirection{xVariation: 10; yVariation: 10;}
|
||||
speedFromMovement: 8
|
||||
|
||||
particleSize: 22
|
||||
particleSizeVariation: 4
|
||||
size: 22
|
||||
sizeVariation: 4
|
||||
}
|
||||
ParticleSystem { id: sys3; }
|
||||
ColoredParticle{
|
||||
image: "content/particle.png"
|
||||
ImageParticle{
|
||||
source: "content/particle.png"
|
||||
system: sys3
|
||||
color: "orange"
|
||||
alpha: 0
|
||||
|
@ -185,28 +185,28 @@ Rectangle {
|
|||
colorVariation: 0.2
|
||||
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: trailsNormal2
|
||||
system: sys3
|
||||
|
||||
particlesPerSecond: 300
|
||||
particleDuration: 2000
|
||||
emitRate: 300
|
||||
lifeSpan: 2000
|
||||
|
||||
y: mouseArea.pressed ? mouseArea.mouseY : circle2.cy
|
||||
x: mouseArea.pressed ? mouseArea.mouseX : circle2.cx
|
||||
|
||||
speedFromMovement: 16
|
||||
|
||||
speed: PointVector{xVariation: 4; yVariation: 4;}
|
||||
acceleration: PointVector{xVariation: 10; yVariation: 10;}
|
||||
speed: PointDirection{xVariation: 4; yVariation: 4;}
|
||||
acceleration: PointDirection{xVariation: 10; yVariation: 10;}
|
||||
|
||||
particleSize: 12
|
||||
particleSizeVariation: 4
|
||||
size: 12
|
||||
sizeVariation: 4
|
||||
}
|
||||
ParticleSystem { id: sys4; }
|
||||
ColoredParticle{
|
||||
ImageParticle{
|
||||
system: sys4
|
||||
image: "content/star.png"
|
||||
source: "content/star.png"
|
||||
color: "green"
|
||||
alpha: 0
|
||||
SequentialAnimation on color {
|
||||
|
@ -225,23 +225,23 @@ Rectangle {
|
|||
|
||||
colorVariation: 0.5
|
||||
}
|
||||
TrailEmitter{
|
||||
Emitter{
|
||||
id: trailsStars2
|
||||
system: sys4
|
||||
|
||||
particlesPerSecond: 50
|
||||
particleDuration: 2200
|
||||
emitRate: 50
|
||||
lifeSpan: 2200
|
||||
|
||||
|
||||
y: mouseArea.pressed ? mouseArea.mouseY : circle2.cy
|
||||
x: mouseArea.pressed ? mouseArea.mouseX : circle2.cx
|
||||
|
||||
speedFromMovement: 16
|
||||
speed: PointVector{xVariation: 2; yVariation: 2;}
|
||||
acceleration: PointVector{xVariation: 10; yVariation: 10;}
|
||||
speed: PointDirection{xVariation: 2; yVariation: 2;}
|
||||
acceleration: PointDirection{xVariation: 10; yVariation: 10;}
|
||||
|
||||
particleSize: 22
|
||||
particleSizeVariation: 4
|
||||
size: 22
|
||||
sizeVariation: 4
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -147,27 +147,27 @@ Item {
|
|||
PaletteItem {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
componentFile: "Sun.qml"
|
||||
image: "../images/sun.png"
|
||||
source: "../images/sun.png"
|
||||
}
|
||||
PaletteItem {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
componentFile: "GenericSceneItem.qml"
|
||||
image: "../images/moon.png"
|
||||
source: "../images/moon.png"
|
||||
}
|
||||
PaletteItem {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
componentFile: "PerspectiveItem.qml"
|
||||
image: "../images/tree_s.png"
|
||||
source: "../images/tree_s.png"
|
||||
}
|
||||
PaletteItem {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
componentFile: "PerspectiveItem.qml"
|
||||
image: "../images/rabbit_brown.png"
|
||||
source: "../images/rabbit_brown.png"
|
||||
}
|
||||
PaletteItem {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
componentFile: "PerspectiveItem.qml"
|
||||
image: "../images/rabbit_bw.png"
|
||||
source: "../images/rabbit_bw.png"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ Image {
|
|||
id: sun
|
||||
|
||||
property bool created: false
|
||||
property string image: "../images/sun.png"
|
||||
property string source: "../images/sun.png"
|
||||
|
||||
source: image
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ import QtQuick 1.0
|
|||
Flipable {
|
||||
id: container
|
||||
|
||||
property alias image: frontImage.source
|
||||
property alias source: frontImage.source
|
||||
property bool flipped: true
|
||||
property int xAxis: 0
|
||||
property int yAxis: 0
|
||||
|
|
|
@ -49,7 +49,7 @@ Rectangle {
|
|||
|
||||
Row {
|
||||
anchors.centerIn: parent; spacing: 30
|
||||
Card { image: "content/9_club.png"; angle: 180; yAxis: 1 }
|
||||
Card { image: "content/5_heart.png"; angle: 540; xAxis: 1 }
|
||||
Card { source: "content/9_club.png"; angle: 180; yAxis: 1 }
|
||||
Card { source: "content/5_heart.png"; angle: 540; xAxis: 1 }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ class QJSDebuggerAgentPrivate
|
|||
{
|
||||
public:
|
||||
QJSDebuggerAgentPrivate(QJSDebuggerAgent *q)
|
||||
: q(q), state(NoState)
|
||||
: q(q), state(NoState), isInitialized(false)
|
||||
{}
|
||||
|
||||
void continueExec();
|
||||
|
@ -79,6 +79,7 @@ public:
|
|||
QHash<QString, JSAgentBreakpointData> fileNameToBreakpoints;
|
||||
QStringList watchExpressions;
|
||||
QSet<qint64> knownObjectIds;
|
||||
bool isInitialized;
|
||||
};
|
||||
|
||||
namespace {
|
||||
|
@ -252,6 +253,14 @@ QJSDebuggerAgent::~QJSDebuggerAgent()
|
|||
delete d;
|
||||
}
|
||||
|
||||
/*!
|
||||
Indicates whether the agent got the list of breakpoints.
|
||||
*/
|
||||
bool QJSDebuggerAgent::isInitialized() const
|
||||
{
|
||||
return d->isInitialized;
|
||||
}
|
||||
|
||||
void QJSDebuggerAgent::setBreakpoints(const JSAgentBreakpoints &breakpoints)
|
||||
{
|
||||
d->breakpoints = breakpoints;
|
||||
|
@ -259,6 +268,8 @@ void QJSDebuggerAgent::setBreakpoints(const JSAgentBreakpoints &breakpoints)
|
|||
d->fileNameToBreakpoints.clear();
|
||||
foreach (const JSAgentBreakpointData &bp, breakpoints)
|
||||
d->fileNameToBreakpoints.insertMulti(fileName(QString::fromUtf8(bp.fileUrl)), bp);
|
||||
|
||||
d->isInitialized = true;
|
||||
}
|
||||
|
||||
void QJSDebuggerAgent::setWatchExpressions(const QStringList &watchExpressions)
|
||||
|
|