var CanvasDraw = {
canvas:null,//canvas元素
context:null,//canvas环境
fps:30,//帧频
type:null, //类型 letter或 img 对象
drawObj:null,
gap:null,
dotsData:[],
dots:[],
Init:function(canvas,width,height,type,drawObj,gap,fps,fn){
CanvasDraw.canvas = canvas;
CanvasDraw.context = canvas.getContext("2d");
CanvasDraw.canvas.width=width;
CanvasDraw.canvas.height=height;
CanvasDraw.fps = fps || 30;
CanvasDraw.type = type || "letter";
CanvasDraw.gap=gap||10;
CanvasDraw.drawObj=drawObj;
CanvasDraw.dotsData=[];
CanvasDraw.dots=[];
CanvasDraw.ShapeBuilder.Init();
},
Render:function(canvas,width,height,type,drawObj,fps,fn){
this.Init(canvas,width,height,type,drawObj,fps,fn);
},
StopRender:function(fn){
}
}
還有就是這個算是建構子嗎?