Hard to fit all of the relevant information in the title, so here’s the gist of it:
I’m working on a sprite editor that will hopefully be able to spit out usable tile sheets/palettes for the GameBoy Advance for another project I’m working on (and thus, I have committed the cardinal sin of programming). Since I’m already going to be keeping track of the tile data, palettes, and sprites separately, I figured it might be more efficient to render the tile sheet to an image, then have a <canvas>
context draw sections of the tile sheet into the editing frame, rather than using context.fillRect
or similar to draw directly to the canvas. Part of the reason I had this idea was because I was concerned about zooming in/out in the editor, which would expand/shrink the sprite. Instead of having to write my own aliasing code, I could draw the tile sheet to an image buffer at a known size, then use context.drawImage
to actually display the required tiles and reaping the benefits of the already-existing aliasing algorithm.
As such, my question is two-fold: should I actually write the tile sheet to an image then draw parts of the image to a canvas or should I just fillRect
the “””pixels”””? And if I should generate an image, how would I go about doing such?
Note: I’m preferring not to use jQuery here. It seems like a pretty hefty library that wouldn’t gain me much in this context.