I've used the Lua IO, the love.filesystem and all, but still can't make it work...
Any help would be greatly appreciated
Here's my latest code, just in case:
Code: Select all
function love.load()
love.graphics.setBackgroundColor(255,255,255)
fontie = love.graphics.newFont(12)
love.graphics.setFont(fontie)
file = love.filesystem.newFile("foo.txt")
s = file:read()
file:close()
end
function love.draw()
love.graphics.setColor(255,255,255,255)
love.graphics.print(typeof(s),100,100)
end
function typeof(var)
local _type = type(var);
if(_type ~= "table" and _type ~= "userdata") then
return _type;
end
local _meta = getmetatable(var);
if(_meta ~= nil and _meta._NAME ~= nil) then
return _meta._NAME;
else
return _type;
end
end