Mercurial > MadButterfly
annotate nodejs/testdesktop.js @ 822:586e50f82c1f
Unify coding style tag for emacs and vim.
author | Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com> |
---|---|
date | Tue, 14 Sep 2010 01:08:39 +0800 |
parents | 7875e8026e86 |
children | 2101a355acba |
rev | line source |
---|---|
822
586e50f82c1f
Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents:
820
diff
changeset
|
1 // -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 4; -*- |
586e50f82c1f
Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents:
820
diff
changeset
|
2 // vim: sw=4:ts=8:sts=4 |
752 | 3 var svg = require("./svg"); |
4 var mbapp = require("./mbapp"); | |
5 var sys=require("sys"); | |
6 var animate=require("./animate"); | |
7 var fs = require("fs"); | |
8 | |
9 app = new mbapp.app(); | |
10 app.loadSVG("desktop.svg"); | |
11 | |
12 video = app.get("video"); | |
13 audio = app.get("audio"); | |
14 picture = app.get("picture"); | |
15 setting = app.get("setting"); | |
16 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
|
17 item = 0; |
801 | 18 an = new animate.scale(app,items[item],1,1.5,0.1); |
752 | 19 an.start(); |
820 | 20 setInterval(function() { |
21 | |
752 | 22 |
820 | 23 }, 300); |
24 app.addKeyListener(mbapp.KEY_LEFT, function() { | |
752 | 25 var old = items[item]; |
26 item = item - 1; | |
27 if (item == -1) { | |
28 item = 0; | |
29 return; | |
30 } | |
31 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
|
32 var an = new animate.scale(app,old,1,1,0.1); |
752 | 33 an.start(); |
801 | 34 an = new animate.scale(app,target,1,1.5,0.3); |
752 | 35 an.start(); |
36 }); | |
37 | |
820 | 38 app.addKeyListener(mbapp.KEY_RIGHT, function() { |
752 | 39 var old = items[item]; |
40 item = item + 1; | |
41 if (item == items.length) { | |
42 item = item - 1; | |
43 return; | |
44 } | |
45 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
|
46 var an = new animate.scale(app,old,1,1,0.1); |
752 | 47 an.start(); |
801 | 48 an = new animate.scale(app,target,1,1.5,0.3); |
752 | 49 an.start(); |
50 }); | |
51 | |
52 app.loop(); |