Page 1 of 2
My images won't load..
Posted: Fri Jul 02, 2010 4:33 am
by Wheaties
I am using:
Code: Select all
pappi = love.graphics.newImage("pappi.png")
and then later
Just the standard stuff.. But my images won't load. I have them in the file I am dragging into the LOVE exe, anything I am doing wrong?
Re: My images won't load..
Posted: Fri Jul 02, 2010 6:16 am
by Robin
Is this in main.lua?
Is the drawing code in love.draw()?
Are you dragging the folder main.lua is in on the exe?
If you answered any of these questions with "no": there's your answer.
Re: My images won't load..
Posted: Fri Jul 02, 2010 8:03 am
by kikito
Check the lowercase-uppercase of the filenames and extensions. If there is any difference between your source code and your files (i.e. in your code you wrote pappi.png but your file was pappi.PNG) then it will work on the "uncompressed" windows folder but it will not work when you make the compressed file.
Re: My images won't load..
Posted: Fri Jul 02, 2010 4:20 pm
by Wheaties
Well, I may need to rephrase this. The image itself is kind of loading, but I get a giant white box and no image, same when I run the hamster-ball tutorial code.
Re: My images won't load..
Posted: Fri Jul 02, 2010 4:33 pm
by kikito
Could be like a power-of-two issue then.
Try updating your graphic card drivers, and if that doesn't solve it, re-dimension the images so they are power-of-two sized (for example 128x128, or 128x256)
Re: My images won't load..
Posted: Fri Jul 02, 2010 8:33 pm
by TechnoCat
The hamster should be po2. Right now it is 82×81. Someone update it!
http://love2d.org/wiki/File:Resource-HamsterBall.png
Re: My images won't load..
Posted: Fri Jul 02, 2010 8:42 pm
by nevon
Re: My images won't load..
Posted: Sun Jul 11, 2010 9:35 am
by Will
I had the exact same problem. I was trying to use an image for a background; it was 800 x 600. I changed it to 512 x 512 and it displayed. This poses a problem for me though. Since the window for Love runs at a default 800 x 600 resolution, how am I supposed to add a background if the framework doesn't support images that are 800 x 600?
Is there a way to make the resolution of the default window smaller? Maybe something like 768 x 768, perhaps? I'm new to Love and new to Lua as well. Help would be greatly appreciated.
So far the framework seems really nice. I hope to continue using it. Thanks.
Re: My images won't load..
Posted: Sun Jul 11, 2010 9:47 am
by vrld
Will wrote:Is there a way to make the resolution of the default window smaller? Maybe something like 768 x 768, perhaps? I'm new to Love and new to Lua as well.
Yes, there is:
http://love2d.org/wiki/Config_Files
http://love2d.org/wiki/love.graphics.setMode
Re: My images won't load..
Posted: Sun Jul 11, 2010 9:48 am
by nevon
Will wrote:I had the exact same problem. I was trying to use an image for a background; it was 800 x 600. I changed it to 512 x 512 and it displayed. This poses a problem for me though. Since the window for Love runs at a default 800 x 600 resolution, how am I supposed to add a background if the framework doesn't support images that are 800 x 600?
Just create your image like you want it, and then add transparent padding to make it 1024x1024.
Will wrote:Is there a way to make the resolution of the default window smaller? Maybe something like 768 x 768, perhaps? I'm new to Love and new to Lua as well. Help would be greatly appreciated.
There is. 768 isn't a power of two though.