Mercurial > MadButterfly
annotate nodejs/testdesktop.js @ 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.
However, the image does not work here since it does not use the transformation of the group.
author | wycc |
---|---|
date | Mon, 30 Aug 2010 08:56:44 +0800 |
parents | d11b0900f03c |
children | f84ccf1f59ae |
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]; | |
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
|
15 item = 0; |
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 an = new animate.scale(app,items[item],1,2,10); |
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(); |