changeset 930:30cd14b11bc7

USe the graphics from the Max.
author wycc
date Sat, 06 Nov 2010 00:53:59 +0800
parents d35f9702b8c2
children 3a3734289523
files nodejs/examples/mce/mainmenu.js nodejs/examples/mce/mbmce.js
diffstat 2 files changed, 21 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/nodejs/examples/mce/mainmenu.js	Thu Nov 04 07:21:17 2010 +0800
+++ b/nodejs/examples/mce/mainmenu.js	Sat Nov 06 00:53:59 2010 +0800
@@ -5,16 +5,25 @@
 var sys=require("sys");
 var animate=require("animate");
 var fs = require("fs");
+var EPG = require('./epg');
 
 function MainMenu(app) 
 {
     var self = this;
-    app.loadSVG("desktop.svg");
+    //var epg = new EPG.EPG();
+    //epg.registerInitDone(function() { self.init();});
+    self.init();
+}
+MainMenu.prototype.init=function()
+{
+    app.loadSVG("main.svg");
 
-    this.video = app.get("video");
-    this.audio = app.get("audio");
-    this.picture = app.get("picture");
-    this.setting = app.get("setting");
+    var i;
+    var self = this;
+    this.items=[];
+    for(i=0;i<4;i++) {
+	this.items.push(app.get("cat"+i));
+    }
     this.app = app;
 
     this.lightbar = app.get("lightbar");
@@ -24,8 +33,6 @@
         this.lines.push(line);
     }
     this.line=0;
-
-    this.items=[this.video, this.audio, this.picture, this.setting];
     this.item = 0;
 
     animate.run([new animate.scale(app,this.items[this.item], 1, 1.5)], 0, 0.1);
@@ -56,6 +63,9 @@
     animate.run([an], 0, 0.1);
     an = new animate.scale(this.app, target, 1, 1.5);
     animate.run([an], 0, 0.3);
+    var sx = target.center.x - this.lightbar.center.x;
+    var an = new animate.shift(this.app, this.lightbar, sx, 0);
+    animate.run([an], 0, 0.3);
 }
 
 MainMenu.prototype.key_right=function() 
@@ -76,6 +86,9 @@
     animate.run([an], 0, 0.1);
     an = new animate.scale(this.app, target, 1, 1.5);
     animate.run([an], 0, 0.3);
+    var sx = target.center.x - this.lightbar.center.x;
+    var an = new animate.shift(this.app, this.lightbar, sx, 0);
+    animate.run([an], 0, 0.3);
 }
 
 MainMenu.prototype.key_up=function() 
--- a/nodejs/examples/mce/mbmce.js	Thu Nov 04 07:21:17 2010 +0800
+++ b/nodejs/examples/mce/mbmce.js	Sat Nov 06 00:53:59 2010 +0800
@@ -6,6 +6,6 @@
 var animate=require("animate");
 var fs = require("fs");
 var main=require("./mainmenu");
-app = new mbapp.app();
+app = new mbapp.app(":0.0",1920,1080);
 scene=new main.MainMenu(app);
 app.loop();