love.window.showFileDialog

Available since LÖVE 12.0
This function is not supported in earlier versions.

Open system file dialog capable of picking files and folder.

O.png This documents a function for a future version of LÖVE and may be changed before final release.  


Function

Synopsis

love.window.showFileDialog( type, callback, settings )

Arguments

FileDialogType type
File dialog type.
function callback
Function with 3 parameters: files (array of full platform-dependent paths to selected files, empty if the dialog is canceled by the user), filtername (nil if not set), and errorstring (nil if no error)
table settings (nil)
A table containing the given fields:
string title (nil)
Dialog window title.
string acceptlabel (nil)
Custom name for the Accept button.
string cancellabel (nil)
Custom name for the Cancel button.
string defaultname (nil)
Default folder/file name for the file text box.
table filters (nil)
Filter names as keys and filter pattern strings as values.
boolean multiselect (false)
Allow selecting multiple files.
boolean attachtowindow (false)
Allow selecting multiple files.

Returns

Nothing.

Notes

  • This is an asynchronous function. You'll get your result in the callback specified when calling the function.
  • Not all platform supports all settings. Some may support one subset of the settings, some may support the other.
  • In Windows and Android, it's recommended to use love.filesystem.openNativeFile to open them instead of standard Lua io.open.

See Also

Other Languages