Wiki proposal: merge constructor variants differing only by filepath/File/FileData argument

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Santos
Party member
Posts: 383
Joined: Sat Oct 22, 2011 7:37 am

Wiki proposal: merge constructor variants differing only by filepath/File/FileData argument

Post by Santos » Thu Jul 27, 2017 11:09 am

So as far as I can tell, all these constructors which use a loaded-into-memory file accept a file path, or a File object, or a FileData object.

love.audio.newSource (static)
love.graphics.newFont
love.graphics.newImage
love.graphics.newImageFont
love.image.newCompressedData
love.image.newImageData
love.sound.newSoundData
love.thread.newThread

And all the constructors which use a streamed-off-disk file accept a file path or a File object.

love.audio.newSource (stream)
love.graphics.newVideo
love.sound.newDecoder
love.video.newVideoStream

Currently, the wiki has separate variants for each of these file argument types (or it's incomplete and doesn't) which are identical except for the file argument, and I think this is duplicated noisy madness and would be more fun to read and write if it was deduplicated.

So, I propose we combine them. (I am happy to make the edits if we agree that this is sensible!)

I think it would be good if it looked like this, with "string", "File" and "FileData" linking to their wiki pages (this might require modifying a template):

string/File/FileData file

(And string/File file for the streaming files.)

What do you think?

User avatar
Nixola
Inner party member
Posts: 1940
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Wiki proposal: merge constructor variants differing only by filepath/File/FileData argument

Post by Nixola » Tue Aug 01, 2017 6:39 pm

I personally agree with this.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests