Mercurial > MadButterfly
annotate nodejs/testdesktop.js @ 758:d11b0900f03c
Check in the dynamic menu example. Currently, it illustarte a bug in the renderer.
author | wycc |
---|---|
date | Sat, 28 Aug 2010 17:31:59 +0800 |
parents | ffbf9910213c |
children | 77b561bb7929 |
rev | line source |
---|---|
752 | 1 var svg = require("./svg"); |
2 var mbapp = require("./mbapp"); | |
3 var sys=require("sys"); | |
4 var animate=require("./animate"); | |
5 var fs = require("fs"); | |
6 | |
7 app = new mbapp.app(); | |
8 app.loadSVG("desktop.svg"); | |
9 | |
10 video = app.get("video"); | |
11 audio = app.get("audio"); | |
12 picture = app.get("picture"); | |
13 setting = app.get("setting"); | |
14 items=[video,audio,picture,setting]; | |
15 item = 2; | |
758
d11b0900f03c
Check in the dynamic menu example. Currently, it illustarte a bug in the renderer.
wycc
parents:
752
diff
changeset
|
16 an = new animate.scale(app,items[item],1,2,0.1); |
752 | 17 an.start(); |
18 | |
19 app.addKeyListener(mbapp.KEY_UP, function() { | |
20 var old = items[item]; | |
21 item = item - 1; | |
22 if (item == -1) { | |
23 item = 0; | |
24 return; | |
25 } | |
26 var target = items[item]; | |
758
d11b0900f03c
Check in the dynamic menu example. Currently, it illustarte a bug in the renderer.
wycc
parents:
752
diff
changeset
|
27 var an = new animate.scale(app,old,1,1,0.1); |
752 | 28 an.start(); |
758
d11b0900f03c
Check in the dynamic menu example. Currently, it illustarte a bug in the renderer.
wycc
parents:
752
diff
changeset
|
29 an = new animate.scale(app,target,1,2,0.3); |
752 | 30 an.start(); |
31 }); | |
32 | |
33 app.addKeyListener(mbapp.KEY_DOWN, function() { | |
34 var old = items[item]; | |
35 item = item + 1; | |
36 if (item == items.length) { | |
37 item = item - 1; | |
38 return; | |
39 } | |
40 var target = items[item]; | |
758
d11b0900f03c
Check in the dynamic menu example. Currently, it illustarte a bug in the renderer.
wycc
parents:
752
diff
changeset
|
41 var an = new animate.scale(app,old,1,1,0.1); |
752 | 42 an.start(); |
758
d11b0900f03c
Check in the dynamic menu example. Currently, it illustarte a bug in the renderer.
wycc
parents:
752
diff
changeset
|
43 an = new animate.scale(app,target,1,2,0.3); |
752 | 44 an.start(); |
45 }); | |
46 | |
47 app.loop(); |