Creating Custom Canvas Contexts
- I have worked out how to create your own custom contexts. My code is
very robust, it makes no variable pollution as everything is local to
an anonymous function, and the interface is exactly the same as the
local 2d context.
Here is the code:
The context can be called like:
Then you can create a plethora of methods and properties so that you
can do things like:
And that could perhaps draw a bar onto a bar graph or whatever you like.
Let me know if my commenting makes it clear enough and if you find any
sections that could be done simpler.