CreateJS / TweenJS

A simple but powerful tweening / animation library for Javascript. Part of the CreateJS suite of libraries.
http://createjs.com/
MIT License
3.56k stars 967 forks source link

Tween the stroke of a circle #62

Closed MarcGodard closed 9 years ago

MarcGodard commented 9 years ago

Is there a way to:

var circle = new createjs.Shape();
circle.graphics.setStrokeStyle(12);

createjs.Tween.get(circle, {override: true})
                        .to({
                            setStrokeStyle: 5
                        }, 2000, createjs.Ease.bounceOut)

I want to change the thickness of the circle.

lannymcnie commented 9 years ago

In EaselJS 0.8.0, this is super easy. All Graphics commands can be saved off, and edited. Here is a quick fiddle using your code: http://jsfiddle.net/lannymcnie/bg6446mb/ You can see the parameters in the EaselJS docs for each command. http://www.createjs.com/Docs/EaselJS/classes/Graphics.StrokeStyle.html

Here is an article on the Graphics commands: http://blog.createjs.com/new-command-approach-to-easeljs-graphics/

In version 0.7.1, the easiest approach is to just redraw the circle each frame. http://jsfiddle.net/lannymcnie/bg6446mb/1/

lannymcnie commented 9 years ago

Note: Please post questions to StackOverflow instead. This list is meant for reporting issues. Thanks!