From 0700379dac314221f66499910739a3cf6320d664 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sun, 6 Dec 2020 11:56:47 +0100 Subject: [PATCH] Mention the ProjectSettings globalize/localize methods in Data paths This closes https://github.com/godotengine/godot-docs/issues/4409. --- tutorials/io/data_paths.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tutorials/io/data_paths.rst b/tutorials/io/data_paths.rst index c5ac2bf2a..f3cbf42dc 100644 --- a/tutorials/io/data_paths.rst +++ b/tutorials/io/data_paths.rst @@ -42,6 +42,19 @@ Linux, and ``%APPDATA%/Name`` on Windows. ``Name`` is based on the application name defined in the Project Settings, but you can override it on a per-platform basis using :ref:`feature tags `. +Converting paths to absolute paths or "local" paths +--------------------------------------------------- + +You can use :ref:`ProjectSettings.globalize_path() ` +to convert a "local" path like ``res://path/to/file.txt`` to an absolute OS path. +For example, :ref:`ProjectSettings.globalize_path() ` +can be used to open "local" paths in the OS file manager +using :ref:`OS.shell_open() ` since it only accepts +native OS paths. + +To convert an absolute OS path to a "local" path starting with ``res://``, use +:ref:`ProjectSettings.localize_path() `. + Editor data paths -----------------