- var stage;
- var logo;
- var myText;
- init();
- function init(){
- stage = new Stage(document.getElementById("container"));
- logo = new Bitmap("http://jsrun.it/assets/3/6/8/m/368mt.png");
- logo.shadow = new Shadow("#4d4d4d", 2, 2, 2);
- myText = new Text('Happy new year 2012', 'Bold 18px Arial', '#000');
- myText.x = 0;
- myText.y = 0;
- stage.addChild(myText);
- Tween.get(myText).to({x:150},6000);
- Tween.get(myText).to({y:250},6000);
- myText.scaleX = 1.2;
- myText.scaleY = 1.2;
- stage.addChild(logo);
- var g = new Graphics();
- g.beginFill("#d2e9ff");
- g.drawCircle(0,0,3);
- //dd
- Ticker.setFPS(80);
- Ticker.addListener(window);
- }
- function tick(){
- myText.rotation += 1;
- var temp = logo.clone();
- stage.addChild(temp);
- logo.rotation +=5;
- logo.x +=(stage.mouseX - logo.x) *0.1;
- logo.y +=(stage.mouseY - logo.y) *0.1;
- setTimeout(function(){stage.removeChild(temp);},700);
- stage.update();
- }
- <script src="http://mgraph-communication.com/easel.js"></script>
- <script src="http://tweenjs.com/src/tweenjs/Tween.js"></script>
- <script src="http://tweenjs.com/src/tweenjs/Ease.js"></script>
- <canvas id="container" width="460" height="400"></canvas>
vendredi 1 juin 2012
HTML 5 - EaselJs : Like flash Syntax (animation)
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire