I’m making billiards game, and I’m using a filter/shader to make things look like they’re wrapped around a ball, and rotating on it. Here’s what the final, desired effect looks like:
The filter/shader works fine, but it only works when the image that I am trying to wrap is a bitmap fill, like so:
sprite.fill = { type = "image", filename = "art/pool/sliced/ice.png" }
If I try to use this filter effect on a sprite from an imagesheet made by TexturePacker, it doesn’t work, because the sprite is from a larger image, and the filter depends on the edge of the fill being the edge of the image file, if you catch my meaning. That is, if I use a spritesheet with my filter effect, I end up seeing other sprites once the ball “rotates”, because I’m offsetting into a different part of the spritesheet, instead of just repeating a smaller image.
To fix this problem, I’m trying to use display.capture and display.save to CREATE a .png image that I can use as a repeating bitmap fill for each ball – basically, extract the sprite with display.capture and display.save, and then use it as a fill, so my filter/shader will work. Unfortunately, there’s a problem when trying to use display.capture with my rendered sprites – they always get these weird alpha artifacts on the sides. Here:
It makes sense that the fisheye filter is showing those black lines, because they’re in the captured/displayed files, which is the real problem. Here’s a file that I get from saving the screen, but the original, rendered file doesn’t have these black lines:
You can see the black lines that are in the captured/saved sprite from the simulator. I’m not sure what is causing this distortion. i’ve attached the original spritesheet created by texturepacker, as well as my fisheye filter code (in case anybody’s interested)
Does anyone know what’s going wrong? Has anyone seen the black lines before? Is it something to do with the image file, or do you think it’s something to do with corona?