Tuesday, 10 September 2013

draw all shapes in a stage KineticJS

draw all shapes in a stage KineticJS

I am putting two layers in a stage. The first layer has only a rectangle.
The other layer has several line objects. I need to draw these lines very
fast so I'm trying to draw all the lines at once, but I couldn't make it
work. Here is my code:
var line = new Kinetic.Line({
points : line_points,
stroke : 'black',
strokeWidth : 5,
lineCap : 'round'
});
layer.add(line);
layer.draw();
});
};
});
stage.add(layer);
This code draws all lines separately after being created, so it takes a
little bit more time. How can I draw all of the lines at once?

No comments:

Post a Comment