What I'm trying to do is create a game with extreme zoom on the canvas element. I would like to take advantage of the fact that vector graphics has the ability to be programmatically created at runtime with high performance bitmap images.
What I would like to do is programmatically create an image of the first frame of the game "sprite" ... it will be a vector image. However, after the first frame, I do not want to waste time on processor cycles when drawing an image. I would like to cache it as a bitmap / high-performance image for this zoom level.
After that, if the user enlarges the image by> 20%, I will then redraw the image with a higher level of detail of the vector image. As above, this vector image will then be cached and optimized.

As you can see here, it will be a fairly simple spaceship. I would first make it programmatically as a vector, and then ... a raster, I think? The goal is to avoid processor loss.
If the user scales ...

A new vector image of the same shape will be created, albeit with a much higher level of detail. It is basically a level of detail system. In this case, after the initial software draw, I would βrasterizeβ the image for maximum performance.
Does anyone have any ideas on what tools I need to make this a reality inside an HTML canvas? (The rest of the game will be launched inside the canvas element.)
Thanks so much for your thoughts.
** Edit: I wanted to add ... maybe the way to render the image via SVG (programmatically), and then clicking this png file on the canvas using drawimage () may give some success? Something similar to? Hm ...
source share