Create new context for every canvas object?
I'm creating a simple physics engine working with the Canvas API. What is
the best practice in terms of performance? Is it to create a separate
context for ever object in the canvas (ex. for every ball, box etc..), or
to use just one context? The latter involves defining the path on the
context for every object to be redrawn, plus setting the color etc..
Is it a bad idea to use multiple contexts when the number of objects get
near a hundred?
The reason why I ask, is because I don't want to get a surprise a hundred
working hours later because I went with the wrong way of doing this.
No comments:
Post a Comment