data_paths.rst 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 everywhere,
  8. 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 at any
  13. given folder that contains an "engine.cfg" 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://sometexture.png``.
  18. Userdata path (persistent data)
  19. -------------------------------
  20. While the project is running, it is a very 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://gamesave.txt``.
  25. In some devices (for example, mobile ad consoles) this path is unique
  26. for the app. Under desktop operating systems, the engine uses the
  27. typical ~/.Name (check the project name under the settings) in OSX and
  28. Linux, and APPDATA/Name for Windows.