d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Help Moving An Object With Tweenjs
Add Reply New Topic New Poll
Member
Posts: 29,412
Joined: Mar 27 2008
Gold: 504.69
Sep 4 2014 09:52am
I dont understand why the damn circle wont tween? :)

Quote
function init() {
var stage = new createjs.Stage("game");
var tweens;
tweens = [];
var circle = new createjs.Shape();
circle.graphics.beginFill("red").drawCircle(0, 0, 50);
circle.x = Math.random()*500;
circle.y = Math.random()*300;
var tween = createjs.Tween.get(circle).to({x:1, y:1});
tweens.push({ref:circle});
stage.addChild(circle);
circle.addEventListener("click", function(event) { alert("clicked"); })
    stage.update();
}
Member
Posts: 29,723
Joined: Jun 11 2007
Gold: 279.52
Sep 10 2014 10:00am
What's your final goal? I've never used tween.js but usually jquery animate can do most things people need.

This post was edited by AkuuZ on Sep 10 2014 10:01am
Member
Posts: 24,488
Joined: Jul 11 2011
Gold: 1,272.50
Member
Posts: 29,412
Joined: Mar 27 2008
Gold: 504.69
Sep 12 2014 05:00am
I got it but now I am having troubles if the user clicks to another location, interrupting the tween and starting another.

/edit

Wow :lol:
Right after I posted this I got it to work. :D

This post was edited by ROM on Sep 12 2014 05:06am
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll