Hi fellow löve users !
I have the project to create a desktop application and since I’m in love with Lua and Love and in the contrary confused with oriented object programming and other framework, I have in mind to actually create it using Lua and Love2D. I know this is kind of stupid since it’s not what Love2D is made for, but unless I discover a simple framework to create desktop/web application with the same philosophy as Love2D, I think it’s not such a bad idea.
So, the application itself will be an application to generate content (mainly textual) and allow the user to edit it, and like any other application of this kind, save it somewhere on his computer as a file that he can later load and edit etc.
Only problem is : the file you create and save using Love2D/Lua usually goes to a hidden directory on the computer. I know where this directory is, but the users won’t, so I was wondering if there is any solution to actually save the file somewhere else on the computer ? I know it work this way for obvious security reasons, but I wondered if that could be avoided ?
Also, do you think using Love2D to create a desktop application is actually a very bad idea ? If so, do you have a framework to create desktop/web application that uses a language similar to Lua ? By that, I mean functional programming and not oriented object programming ?
Thanks for the answers
Create a desktop application with LÖVE : how to export files in a chose location ?
- Harrylechienfou
- Prole
- Posts: 30
- Joined: Tue May 21, 2019 2:02 pm
Re: Create a desktop application with LÖVE : how to export files in a chose location ?
Using io.open, you can read/write files anywhere (as strings). There are also libraries to scan directories, open file dialogues and that kind of stuff.
About it being a good idea or not, it's a matter of opinion. Mine is that using OpenGL is a bit overkill for a normal desktop application, but that doesn't exclude it.
About it being a good idea or not, it's a matter of opinion. Mine is that using OpenGL is a bit overkill for a normal desktop application, but that doesn't exclude it.
- Harrylechienfou
- Prole
- Posts: 30
- Joined: Tue May 21, 2019 2:02 pm
Re: Create a desktop application with LÖVE : how to export files in a chose location ?
Thank you for your very clear and simple answer !
Re: Create a desktop application with LÖVE : how to export files in a chose location ?
Note that io.open() is not made to take Unicode strings - at least not in Windows. I'd suggest looking at how the problem is solved in e.g. nativefs.
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
"If each mistake being made is a new one, then progress is being made."
- Harrylechienfou
- Prole
- Posts: 30
- Joined: Tue May 21, 2019 2:02 pm
Re: Create a desktop application with LÖVE : how to export files in a chose location ?
Ok, I'll take a look at it, thanks !
Re: Create a desktop application with LÖVE : how to export files in a chose location ?
For the unicode problem in io.open(), you can just slap https://gist.github.com/MikuAuahDark/d6 ... d710347ac0 and pass UTF-8 files.
Profile. Do you encounter crashes in LÖVE Android and wanna send me logcats? Please hit me up in LÖVE Discord and send the full logcat file!
- zorg
- Party member
- Posts: 3470
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Create a desktop application with LÖVE : how to export files in a chose location ?
Might not work on Win7 :pAuahDark wrote: ↑Sat Jun 27, 2020 2:56 pm For the unicode problem in io.open(), you can just slap https://gist.github.com/MikuAuahDark/d6 ... d710347ac0 and pass UTF-8 files.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Create a desktop application with LÖVE : how to export files in a chose location ?
Do you even try that?
Profile. Do you encounter crashes in LÖVE Android and wanna send me logcats? Please hit me up in LÖVE Discord and send the full logcat file!
Re: Create a desktop application with LÖVE : how to export files in a chose location ?
Seems to work for me on Windows 7. It doesn't look like the script is doing anything that shouldn't work on Windows Vista and later either.
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
"If each mistake being made is a new one, then progress is being made."
- zorg
- Party member
- Posts: 3470
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Create a desktop application with LÖVE : how to export files in a chose location ?
Yep, just tested, it did work; false alarm.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Who is online
Users browsing this forum: No registered users and 1 guest