summaryrefslogtreecommitdiffstats
path: root/examples/declarative/fonts/hello.qml
blob: e15a0f01cf4e781a5118a2f7f5c961b81a664b4b (plain)
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
import Qt 4.6

Rectangle {
    id: screen; width: 800; height: 480; color: "black"

    Item {
        id: container; x: screen.width / 2; y: screen.height / 2
        Text {
            id: text; color: "white"; anchors.centerIn: parent
            text: "Hello world!"; font.pixelSize: 60

            SequentialAnimation on font.letterSpacing {
                loops: Animation.Infinite;
                NumberAnimation { from: 100; to: 300; easing.type: "InQuad"; duration: 3000 }
                ScriptAction { script: {
                    container.y = (screen.height / 4) + (Math.random() * screen.height / 2)
                    container.x = (screen.width / 4) + (Math.random() * screen.width / 2)
                } }
            }
            SequentialAnimation on opacity {
                loops: Animation.Infinite;
                NumberAnimation { from: 1; to: 0; duration: 2600 }
                PauseAnimation { duration: 400 }
            }
        }
    }
}