Hopefully a simple question here:
Say I've used KineticJS to draw a line as follows:
var redLine = new Kinetic.Line({
points: [73, 70, 340, 23, 450, 60, 500, 20],
stroke: "red",
strokeWidth: 15,
lineCap: "round",
lineJoin: "round"
});
And it's been added to a layer which has been added to the stage.
But now I need to completely remove this line as if it was never there to react to some user event. How do I go about doing this?
let's say you have a layer like below:
var layer = new Kinetic.Layer(....);
to remove your redLine
from the layer write:
layer.remove(redLine);