# HG changeset patch # User wycc # Date 1288976039 -28800 # Node ID 30cd14b11bc7ae993993d05680ffd78e9ab6f2a3 # Parent d35f9702b8c2321054956d5b6fb8d81b355e69f5 USe the graphics from the Max. diff -r d35f9702b8c2 -r 30cd14b11bc7 nodejs/examples/mce/mainmenu.js --- 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() diff -r d35f9702b8c2 -r 30cd14b11bc7 nodejs/examples/mce/mbmce.js --- 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();