Page 1 of 1

Loading external graphics outside of love?

Posted: Thu Nov 26, 2009 10:04 pm
by Chris016
So i compile everything into a exe. I learned how to run external lua files which was pretty easy using the default lua io commands. Does anyone know how to do external images so people could say mod there players character and i could have the love load them externally?

btw im using love 0.5.0 im sure that shoudnt really matter for the help but just thought i throw that out there.

Re: Loading external graphics outside of love?

Posted: Fri Nov 27, 2009 11:26 am
by napco
You can load files from 2 places only: the .love file and the save directory. You can get the path to this folder by using the command:

Code: Select all

love.filesystem.getSaveDirectory()

Re: Loading external graphics outside of love?

Posted: Fri Nov 27, 2009 1:07 pm
by Robin
napco wrote:You can load files from 2 places only: the .love file and the save directory. You can get the path to this folder by using the command:

Code: Select all

love.filesystem.getSaveDirectory()
Actually, both are accessible as the current directory (.). So if you have an image with the name "~/.love/mygame/awesome.png"*, you can load it as "awesome.png"

* Assuming you're on Linux/UNIX. For Windows, the story is similar.

Re: Loading external graphics outside of love?

Posted: Fri Nov 27, 2009 1:53 pm
by bartbes
With 0.6.0 you can load images from strings too, thus making loading external files possible too.