aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleLua.cpp
diff options
context:
space:
mode:
authorGravatar mike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-06-11 02:20:28 +0000
committerGravatar mike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-06-11 02:20:28 +0000
commit792bbd14c63f217f2de0e6b2f8df99acb1928eea (patch)
treeacd4dabce5a0c741c0abc143ee242c991b9c8619 /samplecode/SampleLua.cpp
parent5f9f2b08759827169baeb5dc38a2b6cfd5e1ba76 (diff)
add drawImage to lua
git-svn-id: http://skia.googlecode.com/svn/trunk@9500 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SampleLua.cpp')
-rw-r--r--samplecode/SampleLua.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/samplecode/SampleLua.cpp b/samplecode/SampleLua.cpp
index 104a427d7a..00a3227d48 100644
--- a/samplecode/SampleLua.cpp
+++ b/samplecode/SampleLua.cpp
@@ -27,6 +27,8 @@ static const char gCode[] = ""
"local paint = Sk.newPaint();"
"paint:setAntiAlias(true);"
""
+ "local image = Sk.loadImage('/skia/trunk/sailboat.jpg');"
+ ""
"local color = {a = 1, r = 1, g = 0, b = 0};"
""
"function rnd(range) "
@@ -76,6 +78,7 @@ static const char gCode[] = ""
" canvas:translate(x, 0);"
" canvas:drawOval(r, paint) "
" x = x + 1;"
+ " canvas:drawImage(image, x, r.bottom + 50, 0.5);"
" if x > 100 then x = 0 end;"
"end "
""