Mercurial > MadButterfly
comparison nodejs/testcase.js @ 690:86c6ebf1de25
Add JS binding for sh_rect_t
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Sat, 07 Aug 2010 23:00:16 +0800 |
parents | b601a4d6f7d1 |
children | 8b7964869f7a f46a0771fd30 |
comparison
equal
deleted
inserted
replaced
689:a05a4a27ff46 | 690:86c6ebf1de25 |
---|---|
16 var ldr = mbfly.img_ldr_new("."); | 16 var ldr = mbfly.img_ldr_new("."); |
17 var img_data = ldr.load("sample.png"); | 17 var img_data = ldr.load("sample.png"); |
18 var paint = mb_rt.paint_image_new(img_data); | 18 var paint = mb_rt.paint_image_new(img_data); |
19 paint.fill(img); | 19 paint.fill(img); |
20 root.add_shape(img); | 20 root.add_shape(img); |
21 | |
22 /* test alpha blending and rectangle */ | |
23 var rect = mb_rt.rect_new(40, 40, 100, 100, 10, 10); | |
24 sys.puts(mb_rt.paint_color_new); | |
25 var paint = mb_rt.paint_color_new(1, 0.5, 0.5, 0.5); | |
26 paint.fill(rect); | |
27 root.add_shape(rect); | |
21 | 28 |
22 /* Moving a path */ | 29 /* Moving a path */ |
23 sys.puts(mb_rt.path_new); | 30 sys.puts(mb_rt.path_new); |
24 var path = mb_rt.path_new("m 100,50 L 120,50 L 200,150 L 180,150 z"); | 31 var path = mb_rt.path_new("m 100,50 L 120,50 L 200,150 L 180,150 z"); |
25 sys.puts(path); | 32 sys.puts(path); |