redraw()
Redraw the canvas.
Description
Redraw the canvas with all the added objects.
Return Value
Draw. Returns the draw instance itself.
Examples
Example 1
First we create an instance of the core object. Then we create a display object and add it to the canvas. We also set the fill to a new color, so we can see the difference. Finally we add an event handler that will redraw the canvas when the object is clicked.
View Example
Code
var canvas = oCanvas.create({
canvas: "#canvas",
background: "#ccc"
});
var button = canvas.display.rectangle({
x: 77,
y: 74,
width: 200,
height: 100,
fill: "#000"
});
canvas.addChild(button);
button.fill = "#999";
button.bind("click tap", function () {
canvas.draw.redraw();
});
Output