-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDragComponent.qml
42 lines (36 loc) · 923 Bytes
/
DragComponent.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import QtQuick 2.0
Rectangle {
id:root
property int floatCompNum: 10;
property real defWidth: 100;
property real defHeight: 50;
function getRandomArbitrary(min, max) {
return Math.random() * (max - min) + min;
}
ShaderEffect
{
id:rootShader
anchors.fill: parent
property real iGlobalTime: 0.0
property size u_Resolution:Qt.size(root.width,root.height)
Timer
{
id:timer
interval: 1; running: true; repeat: true
onTriggered: {
rootShader.iGlobalTime += 0.001;
}
}
fragmentShader: "qrc:/BlinkingShader.fsh"
}
Repeater
{
model:root.floatCompNum
FloatComponent{
width: defWidth
height: defHeight
x: getRandomArbitrary(0,500*0.8)
y: getRandomArbitrary(0,600*0.8)
}
}
}