Hi, I have this problem for a long time already, but it was never fixed, at least for me.
So, every time i try to display an image sheet, if the sheets inside the image are not separeted by some transparent borders of 1 or 2 pixel widths, then the texture coordinates between the near sheets will overwrite the actual frame and will show a line of 1 or 2 pixels width of the other frame’s texture.
Example:
Imagine all letters are 1 pixel inside the image:
image: = {oooaaaxxx}
If i would separate the image as a sprite sheet, using the graphics.newImageSheet() i would do like this:
local sheet = graphics.newImageSheet(“filename.png”,
{
width = 3, height = 1,
sheetContentWidth = 9, sheetContentHeight = 1,
numFrames = 3,
}
)
Now, after this, if i call the display.newImage(group, sheet, 2), the correct answer would be to render this:
aaa
But what shows in my screen is normally one of those options:
1. oaa
2. aax
3. oax
In another words, for some reason the texture coordinates (as i believe) are being recorded incorrectly, genrerating a weird result at the screen.
The results get better, and sometimes vanish when i resize the corona simulator screen size.
Currently, my window configurations are all default:
size:
width: 320
height: 480
Ah, i use windows 10, but after a build to android and test it on a samsung j7 pro, the bug still persists.
I am trying to display the image with these default settings:
display.setDefault(“minTextureFilter”, “nearest”)
display.setDefault(“magTextureFilter”, “nearest”)
But i already tried with “linear” and the results are the same.
I’m attaching some of my code here, alongside with the images im working with.
In my Windows.lua file, the function i’m using here is the: W:shadow()
Currently the function is incomplete, but calling it like this shows what im talking about:
W:shadow(someGroup, W/2, H/2, 100, 100, 30, 15)
In the screenshot it (taken from the android device) shows the error i’m talking about.
PS: I already know i can solve this problem like this: “add a 1 or 2 pixel border around every frame inside the image sheet”, but i wanted to know if it is some issue with the API or my own noob problem as always. I already tried to fix this exporting the image sheet by the texture packer, but the problem still persists.
If someone can help me with this, thanks! It’s a pain to fix all the sprites i created with this method i described above in the ‘PS’.