paint method
- @override
Paints this node to the canvas.
Subclasses, such as Sprite, override this method to do the actual painting of the node. To do custom
drawing override this method and make calls to the canvas
object. All drawing is done in the node's local
coordinate system, relative to the node's position. If you want to make the drawing relative to the node's
bounding box's origin, override NodeWithSize and call the applyTransformForPivot method before making calls for
drawing.
void paint(Canvas canvas) {
canvas.save();
applyTransformForPivot(canvas);
// Do painting here
canvas.restore();
}
Implementation
@override
void paint(Canvas canvas) {
painter.paint(canvas);
}