Hi, I am a new LOVE user and I've been sat around for the past hour trying to figure out how to set the directory at which my main.lua will find a file on my computer.
local imageFile
function love.load()
imageFile = love.graphics.newImage("wom.png")
end
function love.draw()
love.graphics.draw(imageFile)
end
^ is my current code, however when I run thisI get error " main.lua:10: Could not open file wom.png. Does not exist."
I have seen people before say that the image needs to be in the same directory as the main.lua file https://love2d.org/imgmirrur/JwncWtP.png
I don't understand why the image won't load up, any tips?
The image is called "wom.png.png". Thank Windows for hiding files extensions, letting people into this kind of mistakes and into scams. Rename the file to "wom" and you should be fine, but I'd suggest you to search how to see files extensions.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Nixola wrote:The image is called "wom.png.png". Thank Windows for hiding files extensions, letting people into this kind of mistakes and into scams. Rename the file to "wom" and you should be fine, but I'd suggest you to search how to see files extensions.
folder options > uncheck "hide known extensions". That and "hide system files" are the first two things I do on ANY windows system I get my hands on.
skiippii wrote:Hi, I am a new LOVE user and I've been sat around for the past hour trying to figure out how to set the directory at which my main.lua will find a file on my computer.
Just to clarify, you can't really do that though; you have two "root" folders, the project folder, where your main.lua is, and the save folder where you can create/modify files and folders. The former can be anywhere, the latter has specific locations depending on operating system and whether the game is fused or not.
That said, what the others said above should fix your issue.
s-ol wrote:
Nixola wrote:The image is called "wom.png.png". Thank Windows for hiding files extensions, letting people into this kind of mistakes and into scams. Rename the file to "wom" and you should be fine, but I'd suggest you to search how to see files extensions.
folder options > uncheck "hide known extensions". That and "hide system files" are the first two things I do on ANY windows system I get my hands on.
I go a few steps further and disable UAC, then do a forced takeown(ership) of the root drive and all files so that i can freely delete stuff that i know i don't want running; poweruser [/size]
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.