0
如何動畫fillLinearGradientColorStops
KineticJS Rect
?我嘗試使用補間,但肯定它不工作。動畫「fillLinearGradientColorStops」形狀
矩形:
var rect = new Kinetic.Rect({
x: 20,
y: 20,
width: 100,
height: 100,
fillLinearGradientStartPoint: { x: -50, y: -50 },
fillLinearGradientEndPoint: { x: 50, y: 50 },
fillLinearGradientColorStops: [0, 'red', 1, 'yellow']
});
補間:
var tween = new Kinetic.Tween({
node: rect,
duration: 2,
easing: Kinetic.Easings.Linear,
fillLinearGradientColorStops: [0, 'black', 1, 'green']
});
tween.play();
請參閱小提琴http://jsfiddle.net/ZdCmS/。這不可能嗎?