-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmain.qml
160 lines (143 loc) · 4.49 KB
/
main.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
import QtQuick 2.0
import QQuickBgfx 1.0
Item {
width: 1024
height: 640
BgfxItem {
objectName: "bgfxItem1"
id: bgfxItem1
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
height: parent.height / 3
viewId: 0
backgroundColor: "#3369ff"
Text {
id: labelItem1
color: "white"
wrapMode: Text.WordWrap
text: "Name: " + parent.objectName + " | ViewId: " + parent.viewId + " | Color: " + parent.backgroundColor
anchors.right: parent.right
anchors.left: parent.left
anchors.top: parent.top
anchors.margins: 20
}
SequentialAnimation on backgroundColor {
ColorAnimation { to: "#3369ff"; duration: 2000 }
ColorAnimation { to: bgfxItem2.backgroundColor; duration: 1500 }
loops: Animation.Infinite
running: true
}
Rectangle {
anchors.fill: parent
border.width: 4
border.color: parent.backgroundColor
color: "transparent"
}
}
BgfxItem {
objectName: "bgfxItem2"
id: bgfxItem2
anchors.top: bgfxItem1.bottom
anchors.left: parent.left
anchors.right: parent.right
height: parent.height / 3
viewId: 1
backgroundColor: "#ff69ff"
SequentialAnimation on backgroundColor {
ColorAnimation { to: "#ff69ff"; duration: 1500 }
ColorAnimation { to: bgfxItem3.backgroundColor; duration: 1400 }
loops: Animation.Infinite
running: true
}
Text {
id: labelItem2
color: "white"
wrapMode: Text.WordWrap
text: "Name: " + parent.objectName + " | ViewId: " + parent.viewId + " | Color: " + parent.backgroundColor
anchors.right: parent.right
anchors.left: parent.left
anchors.top: parent.top
anchors.margins: 20
}
Rectangle {
anchors.fill: parent
border.width: 4
border.color: parent.backgroundColor
color: "transparent"
}
}
BgfxItem {
objectName: "bgfxItem3"
id: bgfxItem3
anchors.top: bgfxItem2.bottom
anchors.left: parent.left
anchors.right: parent.right
height: parent.height / 3
viewId: 2
backgroundColor: "#4fa92f"
SequentialAnimation on backgroundColor {
ColorAnimation { to: "#4fa92f"; duration: 1600 }
ColorAnimation { to: bgfxItem1.backgroundColor; duration: 1200 }
loops: Animation.Infinite
running: true
}
Text {
id: labelItem3
color: "white"
wrapMode: Text.WordWrap
text: "Name: " + parent.objectName + " | ViewId: " + parent.viewId + " | Color: " + parent.backgroundColor
anchors.right: parent.right
anchors.left: parent.left
anchors.top: parent.top
anchors.margins: 20
}
Rectangle {
anchors.fill: parent
border.width: 4
border.color: parent.backgroundColor
color: "transparent"
}
}
Rectangle {
color: Qt.rgba(1, 0.85, 0.7, 0.7)
radius: 10
border.width: 1
border.color: "white"
anchors.top: label1.top
anchors.right: label1.right
anchors.left: label1.left
anchors.bottom: label3.bottom
anchors.margins: -10
}
Text {
id: label1
color: "black"
// wrapMode: Text.WordWrap
text: "Drag mouse over the height: change Bgfx color luminance at render time. Change camera Z coord."
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: label2.top
anchors.margins: 2
}
Text {
id: label2
color: "black"
// wrapMode: Text.WordWrap
text: "Drag mouse over the width: change camera X coord."
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: label3.top
anchors.margins: 2
}
Text {
id: label3
color: "black"
// wrapMode: Text.WordWrap
text: "BgfxItem background color is animated using SequentialAnimation in main.qml."
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.margins: 2
}
}