Page 1 of 1

Load image not packed into .love/.exe

Posted: Wed May 10, 2017 2:08 pm
by LetsOfBrains
I need to load images outside of .exe/.love file.
I'm trying to load image that lies next to .exe/.love.

Code: Select all

qwe = love.graphics.newImage( "24.png" ) --don't think you need a .love file for this
Getting an error, ofc. "Does not exist".
It load's if i pack it into .love, but it's useless.
Hopefully you understood this mess.

Re: Load image not packed into .love/.exe

Posted: Wed May 10, 2017 7:16 pm
by zorg
Short answer: you can only read from the .love itself, and read from / write to the save directory, if you set the project's identity with either a conf.lua file, or the function love.filesystem.setIdentity. (you can drag files/folders from anywhere and use the love.filedropped and love.directorydropped callbacks though)

Long answer: lua's own io functions are able to access arbitrary locations, but it's not cross-platform and will be a pain to get to work right.

Re: Load image not packed into .love/.exe

Posted: Thu May 11, 2017 12:11 am
by slime
Check out the description and example in the love.filesystem.getSourceBaseDirectory wiki page.