aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative/canvas/svgpath/tiger.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/canvas/svgpath/tiger.qml')
-rw-r--r--examples/declarative/canvas/svgpath/tiger.qml33
1 files changed, 33 insertions, 0 deletions
diff --git a/examples/declarative/canvas/svgpath/tiger.qml b/examples/declarative/canvas/svgpath/tiger.qml
new file mode 100644
index 0000000000..96d19d3dba
--- /dev/null
+++ b/examples/declarative/canvas/svgpath/tiger.qml
@@ -0,0 +1,33 @@
+import QtQuick 2.0
+import "tiger.js" as Tiger
+
+Canvas {
+ id:canvas
+ width:1900
+ height:1100
+ property int frame:0
+
+ Timer {
+ repeat:true
+ interval:100
+ running:true
+ onTriggered: {
+ canvas.frame++;
+ if (canvas.frame > Tiger.tiger.length) {
+ canvas.frame = 0;
+ } else {
+ Tiger.draw(canvas.getContext(), canvas.frame);
+ }
+ }
+ }
+/*
+ onDrawRegion:{
+ Tiger.draw(context, canvas.frame);
+ }
+Text {
+ anchors.top : parent.top
+ font.pixelSize : 30
+ text: "drawing path:" + canvas.frame + "/" + Tiger.tiger.length;
+}
+*/
+}