0

I have a circle which I move it around, how can I make for the glow effect to follow that circle.

circle = paper.circle(x, y, 5);
glowSet = circle.glow({
    'fill': true,
    'color': '#bbb'
});   

// ...
// I animate the circle later on using

circle.animate({
    cx: coordX,
    cy: coordY
});

I've tried with animate on the entire set

glowSet.animate({
    x: coordX,
    y: coordY
});

I've tried to apply to each item using forEach over the set

glowSet.forEach(function(item) {
    item.animate({
        x: coordX,
        y: coordY
    });
});
user1236048
  • 5,542
  • 7
  • 50
  • 87

1 Answers1

0

The glow set and the circle remain independent. You should be able to achieve the effect you desire by simply combining them into a single set, like this:

circle = paper.circle(x, y, 5);
glowSet = paper.set(circle, circle.glow({
    'fill': true,
    'color': '#bbb'
}));

Then apply your animations to glowSet.

Kevin Nielsen
  • 4,413
  • 21
  • 26