ProjectSettingsGlobalizePath Method |
Returns the absolute, native OS path corresponding to the localized path (starting with res:// or user://). The returned path will vary depending on the operating system and user preferences. See File paths in Godot projects to see what those paths convert to. See also LocalizePath(String).
Note: GlobalizePath(String) with res:// will not work in an exported project. Instead, prepend the executable's base directory to the path when running from an exported project:
var path = "" if OS.has_feature("editor"): # Running from an editor binary. # `path` will contain the absolute path to `hello.txt` located in the project root. path = ProjectSettings.globalize_path("res://hello.txt") else: # Running from an exported project. # `path` will contain the absolute path to `hello.txt` next to the executable. # This is *not* identical to using `ProjectSettings.globalize_path()` with a `res://` path, # but is close enough in spirit. path = OS.get_executable_path().get_base_dir().plus_file("hello.txt")
Namespace: Godot
public static string GlobalizePath( string path )
[Missing <param name="path"/> documentation for "M:Godot.ProjectSettings.GlobalizePath(System.String)"]
[Missing <returns> documentation for "M:Godot.ProjectSettings.GlobalizePath(System.String)"]