Texture not showing up.
Opened this issue · 6 comments
so I had tried newImage, but that didn't work, and then I tried newTexture. It didn't crash or give me an error, its just a black screen. Here's my lua code:
function love.load()
kris = love.graphics.newTexture("kris.png");
end
function love.update(dt)
end
function love.draw()
love.graphics.draw(kris, 100, 100, 0, 1, 1, 48, 48);
end
It's likely that WiiLÖVE didn't crash at all and just isn't drawing the texture. This is a known issue, see GRRLIB/GRRLIB#12 (comment)
I'm trying to look for ways around this, but in the meantime you can try padding the image with transparent pixels to fit the requirements.
Seems that there was also one more issue with the image. libpngu (PNG handling library) can't handle paletted images yet. The original image uses a palette instead of RGB values (probably automatically done to save space).
Here's the fixed image, it now draws with your code:
By the way, don't close this issue, because nothing was fixed. This is just a workaround.
How can I convert images to have RGB values in the future?
I used GIMP to convert the image from Indexed to RGB.
However, I may have found a way to integrate palette conversion into libpngu, so you might not need to do this in the future.
Fixed indexed PNGs in 19dd46f!
I made a modification of libpngu with fixes: https://github.com/HTV04/libpngu-mod
Screenshot (this is using your original image):
Next, I need to fix (or workaround in code) images that aren't multiples of 4.