redraw()

Redraw the canvas.

Syntax redraw()

Return Type Core

Description

Redraw the canvas with all the added objects. Shorthand method for the redraw() method in the draw module.

Return Value

Core. Returns the core 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.redraw();
});
Output