annotate nodejs/mbapp.js @ 716:72abb4154936

Add mbapp module
author wycc
date Sat, 14 Aug 2010 00:06:00 +0800
parents
children 01d02382dea7
rev   line source
716
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
1 var mbfly = require("mbfly");
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
2 var svg = require("./svg");
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
3 var mb_rt = new mbfly.mb_rt(":0.0", 720,480);
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
4 var ldr = mbfly.img_ldr_new(".");
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
5 var background = mb_rt.rect_new(0, 0, 720, 480, 0, 0);
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
6 var paint = mb_rt.paint_color_new(1, 1, 1, 1);
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
7 paint.fill(background);
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
8 mb_rt.root.add_shape(background);
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
9
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
10 app=function() {
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
11 this.mb_rt = mb_rt;
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
12
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
13 }
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
14 app.prototype.loadSVG=function(fname) {
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
15 svg.loadSVG(mb_rt,mb_rt.root,fname);
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
16 }
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
17
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
18 app.prototype.loop=function() {
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
19 mb_rt.redraw_all();
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
20 mb_rt.flush();
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
21 }
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
22
72abb4154936 Add mbapp module
wycc
parents:
diff changeset
23 exports.app=app;