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 »

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: 3727
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: LÖVE 0.9.0 released

Post by Jasoco »

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: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: LÖVE 0.9.0 released

Post by slime »

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: 108
Joined: Tue Dec 20, 2011 3:27 am

Re: LÖVE 0.9.0 released

Post by Mermersk »

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 »

Awesome news! I'm going to work on adding 0.9.0 support to StackMachine ASAP.
User avatar
Davidobot
Party member
Posts: 1226
Joined: Sat Mar 31, 2012 5:18 am
Location: Oxford, UK
Contact:

Re: LÖVE 0.9.0 released

Post by Davidobot »

Wow, I just casually missed this post...

Great job guys! Keep up the good work! :awesome:
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
Kyle
Party member
Posts: 146
Joined: Sat Mar 16, 2013 9:46 pm

Re: LÖVE 0.9.0 released

Post by Kyle »

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: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: LÖVE 0.9.0 released

Post by Karai17 »

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 »

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 »

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: Ahrefs [Bot], Google [Bot] and 3 guests