Difference between revisions of "love.window.showFileDialog"
(Created page with "{{newin|12.0|120|type=function}} Open system file dialog capable of picking files and folder. {{notice|This documents a function for a future version of LÖVE and may be...") |
m |
||
Line 19: | Line 19: | ||
{{subparam|table|filters (nil)|Filter names as keys and filter pattern strings as values.}} | {{subparam|table|filters (nil)|Filter names as keys and filter pattern strings as values.}} | ||
{{subparam|boolean|multiselect (false)|Allow selecting multiple files.}} | {{subparam|boolean|multiselect (false)|Allow selecting multiple files.}} | ||
− | {{subparam|boolean|attachtowindow (false)| | + | {{subparam|boolean|attachtowindow (false)|Attach to current game window.}} |
=== Returns === | === Returns === | ||
Nothing. | Nothing. | ||
== Notes == | == Notes == | ||
+ | * Not all platform supports this function or all dialog types. However "openfile" type is supported in most cases. | ||
* This is an asynchronous function. You'll get your result in the callback specified when calling the function. | * 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. | * Not all platform supports all settings. Some may support one subset of the settings, some may support the other. |
Latest revision as of 07:32, 16 January 2025
Available since LÖVE 12.0 |
This function is not supported in earlier versions. |
Open system file dialog capable of picking files and folder.
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)
- Attach to current game window.
Returns
Nothing.
Notes
- Not all platform supports this function or all dialog types. However "openfile" type is supported in most cases.
- 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
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info