Mercurial > MadButterfly
annotate nodejs/testdesktop.js @ 801:f84ccf1f59ae
Add icons for the menu demo
author | wycc |
---|---|
date | Wed, 01 Sep 2010 02:01:40 +0800 |
parents | 77b561bb7929 |
children | 7875e8026e86 |
rev | line source |
---|---|
801 | 1 // vim: ts=4 |
752 | 2 var svg = require("./svg"); |
3 var mbapp = require("./mbapp"); | |
4 var sys=require("sys"); | |
5 var animate=require("./animate"); | |
6 var fs = require("fs"); | |
7 | |
8 app = new mbapp.app(); | |
9 app.loadSVG("desktop.svg"); | |
10 | |
11 video = app.get("video"); | |
12 audio = app.get("audio"); | |
13 picture = app.get("picture"); | |
14 setting = app.get("setting"); | |
15 items=[video,audio,picture,setting]; | |
776
77b561bb7929
Implement new algorithm to calculate the origin of the SVG elemnts so that we can implement object resize without changing the position of the object.
wycc
parents:
758
diff
changeset
|
16 item = 0; |
801 | 17 an = new animate.scale(app,items[item],1,1.5,0.1); |
752 | 18 an.start(); |
19 | |
20 app.addKeyListener(mbapp.KEY_UP, function() { | |
21 var old = items[item]; | |
22 item = item - 1; | |
23 if (item == -1) { | |
24 item = 0; | |
25 return; | |
26 } | |
27 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
|
28 var an = new animate.scale(app,old,1,1,0.1); |
752 | 29 an.start(); |
801 | 30 an = new animate.scale(app,target,1,1.5,0.3); |
752 | 31 an.start(); |
32 }); | |
33 | |
34 app.addKeyListener(mbapp.KEY_DOWN, function() { | |
35 var old = items[item]; | |
36 item = item + 1; | |
37 if (item == items.length) { | |
38 item = item - 1; | |
39 return; | |
40 } | |
41 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
|
42 var an = new animate.scale(app,old,1,1,0.1); |
752 | 43 an.start(); |
801 | 44 an = new animate.scale(app,target,1,1.5,0.3); |
752 | 45 an.start(); |
46 }); | |
47 | |
48 app.loop(); |