Nebula Effect: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
[[Category:snippets]] | |||
Ported from this example in HTML5 "example":http://www.professorcloud.com/mainsite/canvas-nebula.htm, "Source code":https://github.com/skhaz/qtquick-nebula | |||
* [ | <code><br />import QtQuick 1.1 | ||
Rectangle {<br /> width: 570<br /> height: 570<br /> color: "black&quot; | |||
Repeater {<br /> id: repeater<br /> model: 8 | |||
Rectangle {<br /> id: rect | |||
visible: false<br /> color: "transparent&quot;<br /> clip: true | |||
width: 285; height: 285<br /> x: parent.width / 2 - width / 2<br /> y: parent.height / 2 - height / 2 | |||
Timer {<br /> id: timer<br /> interval: 500 * index<br /> running: true<br /> repeat: false<br /> onTriggered: {<br /> rect.visible = true<br /> animation.running = true<br /> }<br /> } | |||
Image {<br /> source: "nebula.jpg&quot;<br /> smooth: true<br /> x: –1 * (Math.random() * 285) >> 0<br /> y: –1 * (Math.random() * 285) >> 0<br /> } | |||
ParallelAnimation {<br /> id: animation<br /> running: false<br /> loops: Animation.Infinite | |||
SequentialAnimation {<br /> NumberAnimation {<br /> target: rect<br /> property: "opacity&quot;<br /> from: .0; to: 1.0<br /> duration: 3000<br /> } | |||
NumberAnimation {<br /> target: rect<br /> property: "opacity&quot;<br /> from: 1.0; to: .0<br /> duration: 500<br /> }<br /> } | |||
NumberAnimation {<br /> target: rect<br /> property: "scale&quot;<br /> from: 2.0; to: 4.0<br /> duration: 4000<br /> }<br /> }<br /> }<br /> }<br />}<br /></code> | |||
[YouTubeID:ALL5KV5u5U4] |
Revision as of 10:29, 24 February 2015
Ported from this example in HTML5 "example":http://www.professorcloud.com/mainsite/canvas-nebula.htm, "Source code":https://github.com/skhaz/qtquick-nebula
<br />import QtQuick 1.1
Rectangle {<br /> width: 570<br /> height: 570<br /> color: "black&quot;
Repeater {<br /> id: repeater<br /> model: 8
Rectangle {<br /> id: rect
visible: false<br /> color: "transparent&quot;<br /> clip: true
width: 285; height: 285<br /> x: parent.width / 2 - width / 2<br /> y: parent.height / 2 - height / 2
Timer {<br /> id: timer<br /> interval: 500 * index<br /> running: true<br /> repeat: false<br /> onTriggered: {<br /> rect.visible = true<br /> animation.running = true<br /> }<br /> }
Image {<br /> source: "nebula.jpg&quot;<br /> smooth: true<br /> x: –1 * (Math.random() * 285) >> 0<br /> y: –1 * (Math.random() * 285) >> 0<br /> }
ParallelAnimation {<br /> id: animation<br /> running: false<br /> loops: Animation.Infinite
SequentialAnimation {<br /> NumberAnimation {<br /> target: rect<br /> property: "opacity&quot;<br /> from: .0; to: 1.0<br /> duration: 3000<br /> }
NumberAnimation {<br /> target: rect<br /> property: "opacity&quot;<br /> from: 1.0; to: .0<br /> duration: 500<br /> }<br /> }
NumberAnimation {<br /> target: rect<br /> property: "scale&quot;<br /> from: 2.0; to: 4.0<br /> duration: 4000<br /> }<br /> }<br /> }<br /> }<br />}<br />
[YouTubeID:ALL5KV5u5U4]