Mercurial > MadButterfly
comparison nodejs/svg.js @ 709:920c9e6e4214
Make code clear
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Fri, 13 Aug 2010 17:51:21 +0800 |
parents | ac9c20db953e |
children | c93381320d6e |
comparison
equal
deleted
inserted
replaced
708:ac9c20db953e | 709:920c9e6e4214 |
---|---|
1 var libxml = require('libxmljs'); | 1 var libxml = require('libxmljs'); |
2 var sys=require('sys'); | 2 var sys=require('sys'); |
3 var mbfly = require("mbfly"); | 3 var mbfly = require("mbfly"); |
4 var mb_rt = new mbfly.mb_rt(":0.0", 720,480); | 4 var mb_rt = new mbfly.mb_rt(":0.0", 720,480); |
5 var ldr = mbfly.img_ldr_new("."); | 5 var ldr = mbfly.img_ldr_new("."); |
6 var background = mb_rt.rect_new(0, 0, 720, 480, 0, 0); | |
7 var paint = mb_rt.paint_color_new(1, 1, 1, 1); | |
8 paint.fill(background); | |
9 mb_rt.root.add_shape(background); | |
6 | 10 |
7 function MB_loadSVG(mb_rt,root,filename) { | 11 function MB_loadSVG(mb_rt,root,filename) { |
8 var doc = libxml.parseXmlFile(filename); | 12 var doc = libxml.parseXmlFile(filename); |
9 var nodes = doc.root().childNodes(); | 13 var nodes = doc.root().childNodes(); |
10 var coord = mb_rt.coord_new(root); | 14 var coord = mb_rt.coord_new(root); |