File error help?
Posted: Mon Oct 19, 2015 8:15 am
Hello, I am new to love and simply trying to learn the API.
The error I am getting is saying the file does not exist, but I have done some checking and the file is there and the path is correct.
Code:
What I read on the wiki page said nothing about any special behavior with the path.
If it will help, this is the gameroot file source:
And the project view looks like this:
The error I am getting is saying the file does not exist, but I have done some checking and the file is there and the path is correct.
Code:
Code: Select all
math.randomseed(os.time()*3)
local print = require("output")
local code = require("encode")
local path = require("gameroot")
love.load = function()
os.setlocale ("", "time")
print(os.date("%c") .. "\n------------------------------\n")
print(io.open(path .. "\\assets\\orange.png")) -- a simple check to make sure the path is correct, prints "file (0x07fef215c500)"
print(pcall(function() return love.graphics.newImage(path .. "\\assets\\orange.png") end)) -- prints "false Could not open file C:/Users/myaccountname/Documents\TestGame\assets\orange.png. Does not exist."
end
love.quit = function()
print("\n------------------------------\n\n\n")
end
If it will help, this is the gameroot file source:
Code: Select all
local GameName = love.filesystem.getIdentity()
local FilePath = love.filesystem.getSourceBaseDirectory()
return FilePath .. "\\" .. GameName
And the project view looks like this: