Can't Get Files of Desktop with LOVE2D
Posted: Sat Apr 29, 2017 4:19 am
Hey There! I am new to the LOVE Forums even though I have programmed with this Library before, so I am pretty used to it ! However, Right now, I am working on a game using this framework, and it supposed to access the files of your Desktop! however every string says "nil" in the files!. Also, when I ask it to print out an entire table, it only shows some stuff I don't understand like: "table: 0x03059638" ! can you figure out why it does that? if yes, thanks!
The Code of the only file that really has something, since I can't figure out how to add a file:
The Code of the only file that really has something, since I can't figure out how to add a file:
Code: Select all
function love.load()
require "player" -- Not Really Anything Right Now
-- Lets add Some Variables!
-- Some Directory Suff first for Variables...
DesktopDirectory = love.filesystem.getUserDirectory().."Desktop"
DesktopFiles = love.filesystem.getDirectoryItems(DesktopDirectory)
-- These are the Images!
images = {
background = love.graphics.newImage("gfx/desktop.png")
}
players = {player.new(10, 10, 10, 10, "gfx/stickman.png", true)}
print(DesktopFiles)
end
function love.update(dt)
end
function love.draw()
love.graphics.draw(images.background)
end