data_paths.rst 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. .. _doc_data_paths:
  2. Data paths
  3. ==========
  4. Path separators
  5. ---------------
  6. For the sake of supporting as many platforms as possible, Godot only
  7. accepts UNIX-style path separators (``/``). These work on all
  8. platforms, including Windows.
  9. A path like ``C:\Projects`` will become ``C:/Projects``.
  10. Resource path
  11. -------------
  12. As mentioned before, Godot considers that a project exists in any
  13. given folder that contains a ``project.godot`` text file, even if such
  14. file is empty.
  15. Accessing project files can be done by opening any path with ``res://``
  16. as a base. For example, a texture located in the root of the project
  17. folder may be opened from the following path: ``res://some_texture.png``.
  18. User path (persistent data)
  19. -------------------------------
  20. While the project is running, it is a common scenario that the
  21. resource path will be read-only, due to it being inside a package,
  22. self-contained executable, or system-wide install location.
  23. Storing persistent files in such scenarios should be done by using the
  24. ``user://`` prefix, for example: ``user://game_save.txt``.
  25. On some devices (for example, mobile and consoles), this path is unique
  26. to the project. On desktop operating systems, the engine uses the
  27. typical ``~/.local/share/godot/app_userdata/Name`` on macOS and Linux,
  28. and ``%APPDATA%/Name`` on Windows. ``Name`` is taken from the
  29. application name defined in the Project Settings, but it can be
  30. overridden on a per-platform basis using
  31. :ref:`feature tags <doc_feature_tags>`.