Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: resources/test.lua

Issue 649013002: allow for lua click handlers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « resources/slides.lua ('k') | samplecode/SampleLua.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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()
OLDNEW
« no previous file with comments | « resources/slides.lua ('k') | samplecode/SampleLua.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698