FileDialog

Inherits: ConfirmationDialog < AcceptDialog < Window < Viewport < Node < Object

A dialog for selecting files or directories in the filesystem.

Description

FileDialog is a preset dialog used to choose files and directories in the filesystem. It supports filter masks. FileDialog automatically sets its window title according to the file_mode. If you want to use a custom title, disable this by setting mode_overrides_title to false.

Properties

Access

access

0

String

current_dir

String

current_file

String

current_path

bool

dialog_hide_on_ok

false (overrides AcceptDialog)

FileMode

file_mode

4

PackedStringArray

filters

PackedStringArray()

bool

mode_overrides_title

true

String

root_subfolder

""

bool

show_hidden_files

false

String

title

"Save a File" (overrides Window)

bool

use_native_dialog

false

Methods

void

add_filter ( String filter, String description="" )

void

clear_filters ( )

void

deselect_all ( )

LineEdit

get_line_edit ( )

VBoxContainer

get_vbox ( )

void

invalidate ( )

Theme Properties

Color

file_disabled_color

Color(1, 1, 1, 0.25)

Color

file_icon_color

Color(1, 1, 1, 1)

Color

folder_icon_color

Color(1, 1, 1, 1)

Texture2D

back_folder

Texture2D

file

Texture2D

folder

Texture2D

forward_folder

Texture2D

parent_folder

Texture2D

reload

Texture2D

toggle_hidden


Signals

dir_selected ( String dir )

Emitted when the user selects a directory.


file_selected ( String path )

Emitted when the user selects a file by double-clicking it or pressing the OK button.


files_selected ( PackedStringArray paths )

Emitted when the user selects multiple files.


Enumerations

enum FileMode:

FileMode FILE_MODE_OPEN_FILE = 0

The dialog allows selecting one, and only one file.

FileMode FILE_MODE_OPEN_FILES = 1

The dialog allows selecting multiple files.

FileMode FILE_MODE_OPEN_DIR = 2

The dialog only allows selecting a directory, disallowing the selection of any file.

FileMode FILE_MODE_OPEN_ANY = 3

The dialog allows selecting one file or directory.

FileMode FILE_MODE_SAVE_FILE = 4

The dialog will warn when a file exists.


enum Access:

Access ACCESS_RESOURCES = 0

The dialog only allows accessing files under the