# HG changeset patch # User wycc # Date 1302524744 -28800 # Node ID b916bb0dc7ca18bbdb948635ddae9198383acb48 # Parent 5a63ab082ef2390814455c1bb4d408fed7efed9b Add setFrameRate diff -r 5a63ab082ef2 -r b916bb0dc7ca nodejs/mbapp.js --- a/nodejs/mbapp.js Mon Apr 11 13:20:02 2011 +0800 +++ b/nodejs/mbapp.js Mon Apr 11 20:25:44 2011 +0800 @@ -130,6 +130,10 @@ this._componentmanager = new component.ComponentManager(this); } +app.prototype.setFrameRate=function(fps) { + this.frame_interval = 1000/fps; +} + app.prototype.ts=function(m) { var now = Date.now(); var t = now-this._time; @@ -138,14 +142,14 @@ app.prototype.loadSVG=function(fname) { this.svg.load(this.mb_rt,this.mb_rt.root,fname); this.changeScene(0); - sys.puts("xxxx"); } app.prototype.KeyPress = function(evt) { if (this.onKeyPress) this.onKeyPress(evt.sym); - if (evt.sym in this.keymap) { - this.keymap[evt.sym](); - } + sys.puts(this.keymap); + if (evt.sym in this.keymap) { + this.keymap[evt.sym](); + } } app.prototype.loop=function() { @@ -168,7 +172,6 @@ comp.realize(); sys.puts("Search for "+name); var obj = comp.toCoord(); - sys.puts("obj="+obj+" id="+obj.id+" refid="+obj.refid); return comp; }