Inheritance #
- AudioServer
- CameraServer
- ClassDB
- DisplayServer
- EditorFileSystemDirectory
- EditorInterface
- EditorPaths
- EditorSelection
- EditorUndoRedoManager
- EditorVCSInterface
- Engine
- EngineDebugger
- FramebufferCacheRD
- GDExtensionManager
- Geometry2D
- Geometry3D
- IP
- Input
- InputMap
- JNISingleton
- JSONRPC
- JavaClassWrapper
- JavaScriptBridge
- MainLoop (1)
- Marshalls
- MovieWriter
- NativeMenu
- NavigationMeshGenerator
- NavigationServer2D
- NavigationServer3D
- Node (21)
- OS
- OpenXRExtensionWrapperExtension
- OpenXRInteractionProfileMetadata
- Performance
- PhysicsDirectBodyState2D (1)
- PhysicsDirectBodyState3D (1)
- PhysicsDirectSpaceState2D (1)
- PhysicsDirectSpaceState3D (1)
- PhysicsServer2D (1)
- PhysicsServer2DManager
- PhysicsServer3D (1)
- PhysicsServer3DManager
- PhysicsServer3DRendering
ServerHandler
- ProjectSettings
- RefCounted (121)
- RenderData (2)
- RenderSceneData (2)
- RenderingDevice
- RenderingServer
- ResourceLoader
- ResourceSaver
- ResourceUID
- ScriptLanguage (1)
- ShaderIncludeDB
- TextServerManager
- ThemeDB
- TileData
- Time
- TranslationServer
- TreeItem
- UndoRedo
- UniformSetCacheRD
- WorkerThreadPool
- XRServer
- XRVRS
- AnimationMixer (2)
- AudioStreamPlayer
- CanvasItem (2)
- CanvasLayer (1)
- EditorFileSystem
- EditorPlugin (1)
- EditorResourcePreview
- HTTPRequest
- InstancePlaceholder
- MissingNode
- MultiplayerSpawner
- MultiplayerSynchronizer
- NavigationAgent2D
- NavigationAgent3D
- Node3D (31)
- ResourcePreloader
- ShaderGlobalsOverride
- StatusIndicator
- Timer
- Viewport (2)
- WorldEnvironment
Table of contents
-
var access = ACCESS_RESOURCES -
var current_dir: String -
var current_file: String -
var current_path: String -
var dialog_hide_on_ok: bool = false -
var disable_overwrite_warning: bool = false -
var display_mode = DISPLAY_THUMBNAILS -
var file_mode = FILE_MODE_SAVE_FILE -
var filters: PackedStringArray = PackedStringArray() -
var option_count: int = 0 -
var show_hidden_files: bool = false -
var title: String = "Save a File" -
func add_filter(description: String = "") -> void -
func add_option(default_value_index: int) -> void -
func add_side_menu(title: String = "") -> void -
func clear_filename_filter() -> void -
func clear_filters() -> void -
const func get_filename_filter() -> String -
func get_line_edit() -> LineEdit -
const func get_option_default(option: int) -> int -
const func get_option_name(option: int) -> String -
const func get_option_values(option: int) -> PackedStringArray -
const func get_selected_options() -> Dictionary -
func get_vbox() -> VBoxContainer -
func invalidate() -> void -
func popup_file_dialog() -> void -
func set_filename_filter(filter: String) -> void -
func set_option_default(default_value_index: int) -> void -
func set_option_name(name: String) -> void -
func set_option_values(values: PackedStringArray) -> void -
const FILE_MODE_OPEN_FILE = 0 enum FileMode -
const FILE_MODE_OPEN_FILES = 1 enum FileMode -
const FILE_MODE_OPEN_DIR = 2 enum FileMode -
const FILE_MODE_OPEN_ANY = 3 enum FileMode -
const FILE_MODE_SAVE_FILE = 4 enum FileMode -
const ACCESS_RESOURCES = 0 enum Access -
const ACCESS_USERDATA = 1 enum Access -
const ACCESS_FILESYSTEM = 2 enum Access -
const DISPLAY_THUMBNAILS = 0 enum DisplayMode -
const DISPLAY_LIST = 1 enum DisplayMode -
enum FileMode -
enum Access -
enum DisplayMode -
signal dir_selected(dir: String) -
signal file_selected(path: String) -
signal filename_filter_changed(filter: String) -
signal files_selected(paths: PackedStringArray)
EditorFileDialog #
is_instantiable, Node, editor, not_builtin_classes
A modified version of FileDialog used by the editor.
EditorFileDialog is an enhanced version of FileDialog available only to editor plugins. Additional features include list of favorited/recent files and the ability to see files as thumbnails grid instead of list.
Unlike FileDialog, EditorFileDialog does not have a property for using native dialogs. Instead, native dialogs can be enabled globally via the EditorSettings.interface/editor/use_native_file_dialogs editor setting. They are also enabled automatically when running in sandbox (e.g. on macOS).
Members #
var access = ACCESS_RESOURCES#
The location from which the user may select a file, including res://, user://, and the local file system.
var current_dir: String#
The currently occupied directory.
var current_file: String#
The currently selected file.
var current_path: String#
The file system path in the address bar.
var dialog_hide_on_ok: bool = false#
var disable_overwrite_warning: bool = false#
If true, the EditorFileDialog will not warn the user before overwriting files.
var display_mode = DISPLAY_THUMBNAILS#
The view format in which the EditorFileDialog displays resources to the user.
var file_mode = FILE_MODE_SAVE_FILE#
The dialog's open or save mode, which affects the selection behavior. See FileMode.
var filters: PackedStringArray = PackedStringArray()#
The available file type filters. For example, this shows only .png and .gd files: set_filters(PackedStringArray(["*.png ; PNG Images","*.gd ; GDScript Files"])). Multiple file types can also be specified in a single filter. "*.png, *.jpg, *.jpeg ; Supported Images" will show both PNG and JPEG files when selected.
var option_count: int = 0#
The number of additional OptionButtons and CheckBoxes in the dialog.
var show_hidden_files: bool = false#
If true, hidden files and directories will be visible in the EditorFileDialog. This property is synchronized with EditorSettings.filesystem/file_dialog/show_hidden_files.
var title: String = "Save a File"#
Methods #
func add_filter(description: String = "") -> void#
Adds a comma-delimited file name filter option to the EditorFileDialog with an optional description, which restricts what files can be picked.
A filter should be of the form "filename.extension", where filename and extension can be * to match any string. Filters starting with . (i.e. empty filenames) are not allowed.
For example, a filter of "*.tscn, *.scn" and a description of "Scenes" results in filter text "Scenes (*.tscn, *.scn)".
func add_option(default_value_index: int) -> void#
Adds an additional OptionButton to the file dialog. If values is empty, a CheckBox is added instead.
default_value_index should be an index of the value in the values. If values is empty it should be either 1 (checked), or 0 (unchecked).
func add_side_menu(title: String = "") -> void#
Adds the given menu to the side of the file dialog with the given title text on top. Only one side menu is allowed.
func clear_filename_filter() -> void#
Clear the filter for file names.
func clear_filters() -> void#
Removes all filters except for "All Files (*.*)".
const func get_filename_filter() -> String#
Returns the value of the filter for file names.
func get_line_edit() -> LineEdit#
Returns the LineEdit for the selected file.
Warning: This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their CanvasItem.visible property.
const func get_option_default(option: int) -> int#
Returns the default value index of the OptionButton or CheckBox with index option.
const func get_option_name(option: int) -> String#
Returns the name of the OptionButton or CheckBox with index option.
const func get_option_values(option: int) -> PackedStringArray#
Returns an array of values of the OptionButton with index option.
const func get_selected_options() -> Dictionary#
Returns a Dictionary with the selected values of the additional OptionButtons and/or CheckBoxes. Dictionary keys are names and values are selected value indices.
func get_vbox() -> VBoxContainer#
Returns the VBoxContainer used to display the file system.
Warning: This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their CanvasItem.visible property.
func invalidate() -> void#
Notify the EditorFileDialog that its view of the data is no longer accurate. Updates the view contents on next view update.
func popup_file_dialog() -> void#
Shows the EditorFileDialog at the default size and position for file dialogs in the editor, and selects the file name if there is a current file.
func set_filename_filter(filter: String) -> void#
Sets the value of the filter for file names.
func set_option_default(default_value_index: int) -> void#
Sets the default value index of the OptionButton or CheckBox with index option.
func set_option_name(name: String) -> void#
Sets the name of the OptionButton or CheckBox with index option.
func set_option_values(values: PackedStringArray) -> void#
Sets the option values of the OptionButton with index option.
Annotations #
Constants #
const FILE_MODE_OPEN_FILE = 0 enum FileMode#
The EditorFileDialog can select only one file. Accepting the window will open the file.
const FILE_MODE_OPEN_FILES = 1 enum FileMode#
The EditorFileDialog can select multiple files. Accepting the window will open all files.
const FILE_MODE_OPEN_DIR = 2 enum FileMode#
The EditorFileDialog can select only one directory. Accepting the window will open the directory.
const FILE_MODE_OPEN_ANY = 3 enum FileMode#
The EditorFileDialog can select a file or directory. Accepting the window will open it.
const FILE_MODE_SAVE_FILE = 4 enum FileMode#
The EditorFileDialog can select only one file. Accepting the window will save the file.
const ACCESS_RESOURCES = 0 enum Access#
The EditorFileDialog can only view res:// directory contents.
const ACCESS_USERDATA = 1 enum Access#
The EditorFileDialog can only view user:// directory contents.
const ACCESS_FILESYSTEM = 2 enum Access#
The EditorFileDialog can view the entire local file system.
const DISPLAY_THUMBNAILS = 0 enum DisplayMode#
The EditorFileDialog displays resources as thumbnails.
const DISPLAY_LIST = 1 enum DisplayMode#
The EditorFileDialog displays resources as a list of filenames.
Constructors #
Enums #
FileMode#
enum FileMode {
FILE_MODE_OPEN_FILE = 0,
FILE_MODE_OPEN_FILES = 1,
FILE_MODE_OPEN_DIR = 2,
FILE_MODE_OPEN_ANY = 3,
FILE_MODE_SAVE_FILE = 4,
}Access#
enum Access {
ACCESS_RESOURCES = 0,
ACCESS_USERDATA = 1,
ACCESS_FILESYSTEM = 2,
}DisplayMode#
enum DisplayMode {
DISPLAY_THUMBNAILS = 0,
DISPLAY_LIST = 1,
} Operators #
Signals #
signal dir_selected(dir: String)#
Emitted when a directory is selected.
signal file_selected(path: String)#
Emitted when a file is selected.
signal filename_filter_changed(filter: String)#
Emitted when the filter for file names changes.
signal files_selected(paths: PackedStringArray)#
Emitted when multiple files are selected.