Mercurial > MadButterfly
diff nodejs/mbapp.js @ 716:72abb4154936
Add mbapp module
author | wycc |
---|---|
date | Sat, 14 Aug 2010 00:06:00 +0800 |
parents | |
children | 01d02382dea7 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nodejs/mbapp.js Sat Aug 14 00:06:00 2010 +0800 @@ -0,0 +1,23 @@ +var mbfly = require("mbfly"); +var svg = require("./svg"); +var mb_rt = new mbfly.mb_rt(":0.0", 720,480); +var ldr = mbfly.img_ldr_new("."); +var background = mb_rt.rect_new(0, 0, 720, 480, 0, 0); +var paint = mb_rt.paint_color_new(1, 1, 1, 1); +paint.fill(background); +mb_rt.root.add_shape(background); + +app=function() { + this.mb_rt = mb_rt; + +} +app.prototype.loadSVG=function(fname) { + svg.loadSVG(mb_rt,mb_rt.root,fname); +} + +app.prototype.loop=function() { + mb_rt.redraw_all(); + mb_rt.flush(); +} + +exports.app=app;