class_filedialog - dragonsoulz/godot GitHub Wiki

FileDialog

####Inherits: ConfirmationDialog ####Category: Core

Brief Description

Dialog for selecting files or directories in the filesystem.

Member Functions

Signals

Numeric Constants

  • MODE_OPEN_FILE = 0 - Editor will not allow to select unexisting files.
  • MODE_OPEN_FILES = 1
  • MODE_OPEN_DIR = 2
  • MODE_SAVE_FILE = 3 - Editor will warn when a file exists.
  • ACCESS_RESOURCES = 0
  • ACCESS_USERDATA = 1
  • ACCESS_FILESYSTEM = 2

Description

FileDialog is a preset dialog used to choose files and directories in the filesystem. It supports filter masks.

Member Function Description

clear_filters

  • void clear_filters ( )

Clear all the added filters in the dialog.

add_filter

  • void add_filter ( String filter )

Add a custom filter. Filter format is: "mask ; description", example (C++): dialog-"lt;add_filter("*.png ; PNG Images");

get_current_dir

  • String get_current_dir ( ) const

Get the current working directory of the file dialog.

get_current_file

  • String get_current_file ( ) const

Get the current selected file of the file dialog (empty if none).

get_current_path

  • String get_current_path ( ) const

Get the current selected path (directory and file) of the file dialog (empty if none).

set_mode

  • void set_mode ( int mode )

Set the file dialog mode from the MODE_* enum.

get_mode

  • int get_mode ( ) const

Get the file dialog mode from the MODE_* enum.