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: 384
Joined: Sat Oct 22, 2011 7:37 am

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

Post by Santos »

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: 1949
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 »

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: Bing [Bot] and 236 guests