Mercurial > MadButterfly
comparison nodejs/mbapp.js @ 978:78312b44f48c
Implement Scene API.
author | wycc |
---|---|
date | Sat, 20 Nov 2010 20:04:31 +0800 |
parents | e4474cac20da |
children | 593a418ed8bf |
comparison
equal
deleted
inserted
replaced
977:5cefabccfb76 | 978:78312b44f48c |
---|---|
141 else { | 141 else { |
142 for(k in key) { | 142 for(k in key) { |
143 this.keymap[k] = f; | 143 this.keymap[k] = f; |
144 } | 144 } |
145 } | 145 } |
146 } | |
147 | |
148 | |
149 app.prototype.changeScene=function(s) { | |
150 var nth; | |
151 if (typeof(s)=='number') { | |
152 var i; | |
153 nth = s; | |
154 } else { | |
155 nth = this.svg.getFrameNumber(s); | |
156 if (nth == -1) return; | |
157 } | |
158 var scenes = this.svg.scenes; | |
159 for(i=0;i<scenes.length;i++) { | |
160 try { | |
161 if (nth >=scenes[i].start && nth <=scenes[i].end) { | |
162 this.get(scenes[i].ref).show(); | |
163 } else { | |
164 this.get(scenes[i].ref).hide(); | |
165 } | |
166 } catch(e) { | |
167 sys.puts(e); | |
168 sys.puts(scenes[i].ref); | |
169 } | |
170 } | |
171 } | |
172 app.prototype.addSceneListener=function(n, cb) { | |
173 sys.puts("This is not implemented yet") | |
146 } | 174 } |
147 | 175 |
148 var app_with_win = function(display, win) { | 176 var app_with_win = function(display, win) { |
149 var self = this; | 177 var self = this; |
150 var mb_rt; | 178 var mb_rt; |