LÖVE 0.9.0 released

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Clean3d
Prole
Posts: 30
Joined: Fri Mar 29, 2013 4:16 pm

Re: LÖVE 0.9.0 released

Post by Clean3d » Sat Dec 14, 2013 2:34 am

Thanks so much for this release! Can't wait to try it out. : D

If you won't tell anyone, Internet, I'll admit that I jumped up more than once while reading this summary and did a stupid little dance.
Clean3d's Twitter, Game, and Blog

User avatar
Jasoco
Inner party member
Posts: 3620
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: LÖVE 0.9.0 released

Post by Jasoco » Sat Dec 14, 2013 3:10 am

Besides the Clipboard stuff, is there anything we can actually do with love.system? I mean, getting the OS could be useful, but what about the power supply or processor count ones? What can we do with this information?

Also, can we get some examples of some of the new stuff, like mesh's?

User avatar
slime
Solid Snayke
Posts: 2763
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: LÖVE 0.9.0 released

Post by slime » Sat Dec 14, 2013 3:32 am

Jasoco wrote:what about the power supply or processor count ones? What can we do with this information?
Power supply info is mostly only useful for laptops right now, for example if you have a fullscreen game you might want to display a warning if the computer is on battery and about to run out of power.
The processor count function might be useful when using threads, to optimize the amount you have running in some situations.
Jasoco wrote:Also, can we get some examples of some of the new stuff, like mesh's?
Yeah, I'll make some examples sometime after I wake up tomorrow.

User avatar
Mermersk
Party member
Posts: 106
Joined: Tue Dec 20, 2011 3:27 am

Re: LÖVE 0.9.0 released

Post by Mermersk » Sat Dec 14, 2013 3:34 am

Congratulations to everyone who has contributed! I'm very thankful for all the hard work that the Löve devs do to make Löve as awesome as it is. Can't wait to try out and learn some of the new features. :D

User avatar
conroy
Prole
Posts: 46
Joined: Thu May 24, 2012 3:33 pm

Re: LÖVE 0.9.0 released

Post by conroy » Sat Dec 14, 2013 4:39 am

Awesome news! I'm going to work on adding 0.9.0 support to StackMachine ASAP.

User avatar
Davidobot
Party member
Posts: 1144
Joined: Sat Mar 31, 2012 5:18 am
Location: Game-Dev. Land
Contact:

Re: LÖVE 0.9.0 released

Post by Davidobot » Sat Dec 14, 2013 5:51 am

Wow, I just casually missed this post...

Great job guys! Keep up the good work! :awesome:
My library:
LovelyMoon

Check out my current project:
Raycaster

Oh hey, I have a website now!

Kyle
Party member
Posts: 146
Joined: Sat Mar 16, 2013 9:46 pm

Re: LÖVE 0.9.0 released

Post by Kyle » Sat Dec 14, 2013 7:18 am

It's about time, slime!

Great work to everyone involved. :D I'm glad I can finally stop getting made fun of for having outdated code!

User avatar
Karai17
Party member
Posts: 853
Joined: Sun Sep 02, 2012 10:46 pm

Re: LÖVE 0.9.0 released

Post by Karai17 » Sat Dec 14, 2013 7:30 am

URAH!

Congrats on the release! ~@u@~ <3
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé

User avatar
Kasperelo
Party member
Posts: 343
Joined: Fri Apr 13, 2012 1:47 pm
Location: The Milky Way

Re: LÖVE 0.9.0 released

Post by Kasperelo » Sat Dec 14, 2013 8:34 am

Finally!
:awesome:

User avatar
jack0088
Prole
Posts: 33
Joined: Fri Mar 22, 2013 4:59 am

Re: LÖVE 0.9.0 released

Post by jack0088 » Sat Dec 14, 2013 8:39 am

Jasoco wrote:Besides the Clipboard stuff, is there anything we can actually do with love.system? I mean, getting the OS could be useful, but what about the power supply or processor count ones? What can we do with this information?

Also, can we get some examples of some of the new stuff, like mesh's?

You CAN get the OS filesystem. Here is one possible way of doing so:
(Only tested on OS X... but might run on Windows as well)

Code: Select all

-- Hack by jack0088
-- Get access to filesystem outside the love2d sandbox.
-- Known issues:
-- 		Not supported: Alias, dead Symlink

Filesystem = {}

function Filesystem.getDirectoryItems(dir, wanted_type, wanted_file, ram)
	dir = tostring(dir) or os.getenv("HOME") --define entrypoint
	dir = dir:gsub("\\?%s", "\\ "):gsub([[["']*]], "") --handle (already escaped) whitespaces!
	if #dir > 1 and dir:sub(#dir) ~= "/" then dir = dir .. "/" end --end always with slash
	
	local files = ram or {}
	
    for file in io.popen("ls -F " .. dir):lines() do
		if file ~= dir then
			local file_indicator = file:sub(#file)
			local file_type = Filesystem.type(file)
			local file_name = file:sub(1, #file-1)
			
			-- symlink
			if file_indicator == "@" then
				if (not wanted_file) or (wanted_file and wanted_file == file_name) then
					for link in io.popen("readlink " .. dir .. file_name):lines() do
						local link_parent_dir = link:match(".*/")
						local pre = link_parent_dir:sub(1, 3)
						
						if pre:find("%.%..") then
							link_parent_dir = dir:sub(1, #dir-1):match(".*/") .. link_parent_dir:sub(4)
						elseif not pre:find("/") then
							link_parent_dir = dir .. link_parent_dir
						end
						
						Filesystem.getDirectoryItems(link_parent_dir, wanted_type, file_name, files)
					end
				end
			else
				if	-- folder
					((file_type == "folder") and (not wanted_type or wanted_type == "folder"))
				or	-- file
					((file_type == "file") and (not wanted_type or wanted_type == "file"))
				then
					-- .exe and .app file
					if (file_indicator == "*") or (file_type == "folder" and file:find(".app")) then file = file_name end
					
					if not wanted_file or (wanted_file and file:find(wanted_file)) then
						table.insert(files, dir .. file)
					end
				end
			end
		end
    end
	
    return files
end

function Filesystem.updated(sec)
	if not Filesystem._tmr then
		Filesystem._tmr = love.timer.getTime()
		return true
	end
	
	local time = love.timer.getTime()
	
	if time >= Filesystem._tmr + (sec or 1) then
		Filesystem._tmr = nil
		return true
	end
	
	return false
end

function Filesystem.type(file)
	return file:sub(#file) == "/" and "folder" or "file"
end
Use: Filesystem.getDirectoryItems([string dir, string type, string file])
(all parameters are optionally, therefor I wrote them inside [] )

Code: Select all

require "Filesystem"

function love.draw()
    if Filesystem.updated(3) then --gets called every x seconds, in this case, each three sec.
        files = Filesystem.getDirectoryItems("/", "folder") --lists (/update) all folders inside system's root
     
        --do with files what ever you need... loop through them and display or whatever...
    end
end
If you don't need to always have an updated filesystem you just can:

Code: Select all

function love.load()
    files = Filesystem.getDirectoryItems() --lists all files of type "file" and "folder", inside the "/" root directory
end

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests