EditorPaths

package
v0.0.0-...-156fa99 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package EditorPaths provides methods for working with EditorPaths object instances.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsEditorPaths() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsEditorPaths

func (self *Extension[T]) AsEditorPaths() Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.EditorPaths

This editor-only singleton returns OS-specific paths to various data folders and files. It can be used in editor plugins to ensure files are saved in the correct location on each operating system. [b]Note:[/b] This singleton is not accessible in exported projects. Attempting to access it in an exported project will result in a script error as the singleton won't be declared. To prevent script errors in exported projects, use [method Engine.has_singleton] to check whether the singleton is available before using it. [b]Note:[/b] On the Linux/BSD platform, Godot complies with the [url=https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html]XDG Base Directory Specification[/url]. You can override environment variables following the specification to change the editor and project data paths.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsEditorPaths

func (self Instance) AsEditorPaths() Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) GetCacheDir

func (self Instance) GetCacheDir() string

Returns the absolute path to the user's cache folder. This folder should be used for temporary data that can be removed safely whenever the editor is closed (such as generated resource thumbnails). [b]Default paths per platform:[/b] [codeblock lang=text] - Windows: %LOCALAPPDATA%\Godot\ - macOS: ~/Library/Caches/Godot/ - Linux: ~/.cache/godot/ [/codeblock]

func (Instance) GetConfigDir

func (self Instance) GetConfigDir() string

Returns the absolute path to the user's configuration folder. This folder should be used for [i]persistent[/i] user configuration files. [b]Default paths per platform:[/b] [codeblock lang=text] - Windows: %APPDATA%\Godot\ (same as `get_data_dir()`) - macOS: ~/Library/Application Support/Godot/ (same as `get_data_dir()`) - Linux: ~/.config/godot/ [/codeblock]

func (Instance) GetDataDir

func (self Instance) GetDataDir() string

Returns the absolute path to the user's data folder. This folder should be used for [i]persistent[/i] user data files such as installed export templates. [b]Default paths per platform:[/b] [codeblock lang=text] - Windows: %APPDATA%\Godot\ (same as `get_config_dir()`) - macOS: ~/Library/Application Support/Godot/ (same as `get_config_dir()`) - Linux: ~/.local/share/godot/ [/codeblock]

func (Instance) GetProjectSettingsDir

func (self Instance) GetProjectSettingsDir() string

Returns the project-specific editor settings path. Projects all have a unique subdirectory inside the settings path where project-specific editor settings are saved.

func (Instance) GetSelfContainedFile

func (self Instance) GetSelfContainedFile() string

Returns the absolute path to the self-contained file that makes the current Godot editor instance be considered as self-contained. Returns an empty string if the current Godot editor instance isn't self-contained. See also [method is_self_contained].

func (Instance) ID

func (self Instance) ID() ID

func (Instance) IsSelfContained

func (self Instance) IsSelfContained() bool

Returns [code]true[/code] if the editor is marked as self-contained, [code]false[/code] otherwise. When self-contained mode is enabled, user configuration, data and cache files are saved in an [code]editor_data/[/code] folder next to the editor binary. This makes portable usage easier and ensures the Godot editor minimizes file writes outside its own folder. Self-contained mode is not available for exported projects. Self-contained mode can be enabled by creating a file named [code]._sc_[/code] or [code]_sc_[/code] in the same folder as the editor binary or macOS .app bundle while the editor is not running. See also [method get_self_contained_file]. [b]Note:[/b] On macOS, quarantine flag should be manually removed before using self-contained mode, see [url=https://docs.godotengine.org/en/stable/tutorials/export/running_on_macos.html]Running on macOS[/url]. [b]Note:[/b] On macOS, placing [code]_sc_[/code] or any other file inside .app bundle will break digital signature and make it non-portable, consider placing it in the same folder as the .app bundle instead. [b]Note:[/b] The Steam release of Godot uses self-contained mode by default.

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL