LÖVE Question - Opening Files Program

Feel free to showcase your own projects!
Post Reply
User avatar
Mari0Maker
Posts: 1348
Joined: 07 Apr 2012, 17:10
Contact:

Post » 01 Jun 2013, 06:08

Is it possible in LÖVE to make a program that loads up a menu screen, and select a program such as an .exe or a different file type association?
So, for example, I make a LÖVE program that views files inside a certain folder. The folder contains files, such as, .png files. The program just lists the name of a file, and when you click on it, the LÖVE program exits, and it opens the .png you selected, with the program that normally opens .png files (normally with Windows Photo Gallery/Viewer).
So, is this possible?
If it is, the only thing I'd want different, would be for each file, you can add a image to it. Like, I make a LÖVE program for opening PC games, and I put the shortcut/.exe for the game in the folder, and add a image inside the .love file.

But, I'm going over my head here now. Is this possible?

User avatar
Automatik
Posts: 1073
Joined: 20 Jul 2012, 17:54
Contact:

Post » 01 Jun 2013, 07:31

yes

User avatar
Mr.Q.Marx?
Posts: 849
Joined: 15 May 2012, 18:35

Post » 01 Jun 2013, 19:14

Code: Select all

   
if love.keyboard.isDown("m") then
      os.execute("applicatiom.png")
      os.execute("applicatiom.exe")
      love.event.push('q')
end
EDIT: Note, I have not tried this code.

User avatar
Automatik
Posts: 1073
Joined: 20 Jul 2012, 17:54
Contact:

Post » 01 Jun 2013, 19:26

Code: Select all

   
if love.keyboard.isDown("m") then
      os.execute("applicatiom.png")
      os.execute("applicatiom.exe")
      love.event.push('q')
end
love.event.push('q') has been renamed to love.event.quit() in 0.8.0
Also, I'm not sure why you would want to execute a png, then immediately after execute an .exe.
And your code is Windows-only.
(On linux, it's os.execute("xdg-open your_file.ext") to open a file with whatever program is right for that. Mac os is the same, but with "open" instead of "xdg-open")

User avatar
Mr.Q.Marx?
Posts: 849
Joined: 15 May 2012, 18:35

Post » 01 Jun 2013, 19:46

I honestly don't know. I had difficulty understanding the brief.

Post Reply