onDraw | This drawing event is triggered if the object graphics needs to be redrawn.
Parameters:
| ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Auxiliary methods | Because some drawings can be very complex it may be handy to divide the whole drawing into auxiliary user drawing methods that can be created on the same level as the onDraw event.
Auxiliary drawing methods have the same parameters as the onDraw event and can also have its own extra parameters. It is recommended that the methods have at least one extra ctx parameter, so it does not to be obtained individually - see the example: One method draws the scale (named for example DrawScale) and another method draws the value curve (named for example DrawCurve). In the onDraw event, there is only a simple script that calls these methods. |