Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

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

int

option_count

0

String

root_subfolder

""

bool

show_hidden_files

false

String

title

"Save a File" (overrides Window)

bool

use_native_dialog

false

Methods

void

add_filter(filter: String, description: String = "")

void

add_option(name: String, values: PackedStringArray, index: int)

void

clear_filters()

void

deselect_all()

LineEdit

get_line_edit()

int

get_option_default(option: int) const

String

get_option_name(option: int) const

PackedStringArray

get_option_values(option: int) const

Dictionary

get_selected_options() const

VBoxContainer

get_vbox()

void

invalidate()

void

set_option_default(option: int, index: int)

void

set_option_name(option: int, name: String)

void

set_option_values(option: int, values: PackedStringArray)

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(dir: String)

Emitted when the user selects a directory.