love.filesystem:setIdenity() error
Posted: Sun Mar 27, 2011 8:54 pm
Whenever I use this code to try and understand love.filesystem, it creates an error.
This is all the code. Again, here is the error. main.lua:4: Calling 'setIdentity' on bad self. (string expected, got table)
Code: Select all
local text="If this shows, it did not work."
function love.load()
love.filesystem:setIdentity("TEST") --Right here! It says "main.lua:4: Calling 'setIdentity' on bad self. (string expected, got table)" "TEST" is a table I guess?
local h=love.filesystem:newFile("text.txt")
h:open("w")
h:write("If this shows, it worked")
h:close()
h:open("r")
text=h:read()
end
function love.draw()
love.graphics:print(text, 20, 20)
end