aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative/canvas/svgpath/tiger.qml
blob: 052c0907080e8b20e2ad9c569809b1e71ce7da3c (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
28
29
30
31
32
33
import QtQuick 2.0
import "tiger.js" as Tiger

Canvas {
  id:canvas
  width:1900
  height:1150
  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;
}
*/
}