Painter - xkp/Doc GitHub Wiki

Overview

A painter component allow developers to programatically draw some components. Whenever a painter is invalidated (i.e. must be drawn) an event will trigger letting the developer do the drawing.

Usage

<painter id="myPainter" x="0" y="0" .../>

in code:

on myPainter.paint(canvas)
{
    //canvas is an html5 canvas, do as you please
}

Events

paint(canvas): Fires whenever the component needs to be drawn, receives a standard canvas