OLD | NEW |
1 | 1 |
2 local r = { left = 10, top = 10, right = 100, bottom = 80 } | 2 local r = { left = 10, top = 10, right = 100, bottom = 80 } |
3 local x = 0; | 3 local x = 0; |
4 | 4 |
5 local paint = Sk.newPaint(); | 5 local paint = Sk.newPaint(); |
6 paint:setAntiAlias(true); | 6 paint:setAntiAlias(true); |
7 | 7 |
8 local image -- = Sk.loadImage('/skia/sailboat.jpg'); | 8 local image -- = Sk.loadImage('/skia/sailboat.jpg'); |
9 function setImageFilename(filename) | 9 function setImageFilename(filename) |
10 image = Sk.loadImage(filename) | 10 image = Sk.loadImage(filename) |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 canvas:translate(x, 0); | 62 canvas:translate(x, 0); |
63 canvas:drawOval(r, paint) | 63 canvas:drawOval(r, paint) |
64 x = x + 1; | 64 x = x + 1; |
65 local r2 = {} | 65 local r2 = {} |
66 r2.left = x; | 66 r2.left = x; |
67 r2.top = r.bottom + 50; | 67 r2.top = r.bottom + 50; |
68 r2.right = r2.left + image:width() * 1; | 68 r2.right = r2.left + image:width() * 1; |
69 r2.bottom = r2.top + image:height() * 1; | 69 r2.bottom = r2.top + image:height() * 1; |
70 canvas:drawImageRect(image, nil, r2, 0.75); | 70 canvas:drawImageRect(image, nil, r2, 0.75); |
71 if x > 200 then x = 0 end; | 71 if x > 200 then x = 0 end; |
| 72 |
| 73 return true -- so we can animate |
72 end | 74 end |
73 | 75 |
74 onStartup() | 76 onStartup() |
OLD | NEW |