I remember reading a while ago that the draw method was not available in JavaScript because it would have an effect on performance. I’m not sure if this is true or even if it’s still valid, but that’s why I’ve never bothered worrying about it myself.
/**
* Render function using the canvas 2d context or WebGL context, internal usage only, please do not call this function
* @function
* @param {CanvasRenderingContext2D | WebGLRenderingContext} ctx The render context
*/
draw: function (ctx) {
// override me
// Only use- this function to draw your staff.
// DON'T draw your stuff outside this method
},
But i don’t know how to solve your problem. What do you want to add inside draw function ?