Why won't the image load?[On Windows 64bit]

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
goodguy68
Prole
Posts: 1
Joined: Tue Oct 08, 2013 10:46 pm

Why won't the image load?[On Windows 64bit]

Post by goodguy68 »

OK So I don't know what the problem is, I looked to see if anyone else knew what the problem would be a no... So every time I go to load up an image on .love, it can't find the image. I've tried many diffrent ways/routes to the image, but it still doesn't load. Heres the love.load part of the codeing.

Code: Select all

function love.load()
	image = love.graphics.newImage("HappyB-Day.png")
	local f = love.graphics.newFont(48)
	love.graphics.setFont(f)
	love.graphics.setColor(0,0,0,255)
	love.graphics.setBackgroundColor(255,255,255)
end
Anywhere I'm suppost to place the HappyB-Day.png file or something? Please if you can help me, thank you. <3
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Why won't the image load?[On Windows 64bit]

Post by raidho36 »

I fail to see your problem. I have W764 and it works just fine for me. Besides, you haven't provided an error message. You're supposed to read these thoughtfully, 'y'no.

Just to clarify: unless you specify an absolute path, your working directory is assumed to be base for the relative path. Without subpaths, your files must be in the same folder as executable file. Also, make sure you spelled your filename correctly down the single glyph. Windows should make no difference between uppercase and lowercase letters (hello DOS legacy), but just make sure. Also, make sure you don't overwrite your "image" anywhere before you get to draw it.
User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: Why won't the image load?[On Windows 64bit]

Post by Plu »

Can you provide the .love file? The image should be in the same folder as your main.lua and it should be named exactly like it is in the code, including capital letters.
HJW012
Prole
Posts: 8
Joined: Tue Sep 03, 2013 9:50 pm

Re: Why won't the image load?[On Windows 64bit]

Post by HJW012 »

Did you ever actually draw in the image or did you only define the variable that is the directory to the image? If you haven't, you can try this.

Code: Select all

function love.draw()
 love.graphics.draw(imagename, x, y)
end
User avatar
iPoisonxL
Party member
Posts: 227
Joined: Wed Feb 06, 2013 3:53 am
Location: Australia
Contact:

Re: Why won't the image load?[On Windows 64bit]

Post by iPoisonxL »

I think he's referring that Love2D tells him the image doesn't exist. The way you're calling it is checking in the same directory as main.lua, so make sure it's in the same directory. If it's another folder, like for example IMG, call love.graphics.loadImage("IMG/Happy-Bday.png")

Code: Select all

      L
    L Ö
    Ö V
L Ö V E
Ö B E
V E
E Y
Website
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 5 guests