I’ve been doing something analogous to sprite sheets, using mask textures, but obviously without engine support. This works well at certain scales, whereas with others I get cracks, much like a tiled map might have. I’m wondering if it’s possible to do this right, given more information.
The first question is more of a sanity-check (I’ve not had a lot of luck finding a “standard” example): assuming a scale of (1, 1), should a mask image have the same dimensions as its corresponding object, or those values plus the black pixel borders?
Secondly, what is the impetus behind the three black pixels on the border? Is this a common technique, or particular to Corona? (I ask, since I had little luck with Google here.) My best guess at the moment is that it simplifies some behavior outside the graphics card (fetching pixels for hit tests?), but I’d like to be sure.
My motivation is to apply marching squares to various tile-based things (so far, I use a “mask things out” approach, to carve paths, and “preserve these pixels” to smooth articulated shapes). The frames in the mask sheet correspond to the different contour lookup entries. Unfortunately, a lot of tile sizes are getting ruled out right now as cracks show up.
The current sheet logic is here (I called them “reels” because the output looked like film reels, but I’m warming up to mask sheet… reel won’t even make sense if they become 2D grids) and the marching squares generator is here (at present, there’s no interpolation, and the “obvious” way is a lot of work :P).
With respect to the second question in particular, do I also need three black pixels between “frames”, for correctness? Or is that meaningless, off-border? And if the former, is it fine that two side-by-side frames share the border?
Any help is appreciated. Thanks for reading!