changeset 1447:b916bb0dc7ca

Add setFrameRate
author wycc
date Mon, 11 Apr 2011 20:25:44 +0800
parents 5a63ab082ef2
children e18c51c1c48f
files nodejs/mbapp.js
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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;
 }