wiilove icon indicating copy to clipboard operation
wiilove copied to clipboard

Texture not showing up.

Open emleskowitz opened this issue 3 years ago • 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

emleskowitz avatar May 07 '22 23:05 emleskowitz

It's likely that WiiLÖVE didn't crash at all and just isn't drawing the texture. This is a known issue, see https://github.com/GRRLIB/GRRLIB/discussions/12#discussioncomment-725819

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.

htv04 avatar May 07 '22 23:05 htv04

wait, i changed it to fit the requirements! it's not working. here's the image: kris (btw i got this off of google, credits to whoever made it)!

emleskowitz avatar May 08 '22 10:05 emleskowitz

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: kris

By the way, don't close this issue, because nothing was fixed. This is just a workaround.

htv04 avatar May 08 '22 11:05 htv04

How can I convert images to have RGB values in the future?

emleskowitz avatar May 08 '22 13:05 emleskowitz

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.

htv04 avatar May 08 '22 13:05 htv04

Fixed indexed PNGs in 19dd46f1c48f8d12af90ebcc17f234c162ba3949!

I made a modification of libpngu with fixes: https://github.com/HTV04/libpngu-mod

Screenshot (this is using your original image): ID-wiilove_2022-05-08_16-20-38

Next, I need to fix (or workaround in code) images that aren't multiples of 4.

htv04 avatar May 08 '22 20:05 htv04