mirror of
https://github.com/minetest/minetest.git
synced 2025-01-03 11:57:30 +01:00
Menu docs: clarify that image paths must be escaped to correctly render on Windows (#15072)
This commit is contained in:
parent
c893e0b72b
commit
3441fd6e04
@ -8,6 +8,15 @@ The main menu is defined as a formspec by Lua in `builtin/mainmenu/`
|
||||
Description of formspec language to show your menu is in `lua_api.md`
|
||||
|
||||
|
||||
Images and 3D models
|
||||
------
|
||||
|
||||
Directory delimiters change according to the OS (e.g. on Unix-like systems
|
||||
is `/`, on Windows is `\`). When putting an image or a 3D model inside a formspec,
|
||||
be sure to sanitize it first with `core.formspec_escape(img)`; otherwise,
|
||||
any resource located in a subpath won't be displayed on OSs using `\` as delimiter.
|
||||
|
||||
|
||||
Callbacks
|
||||
---------
|
||||
|
||||
@ -62,6 +71,12 @@ Functions
|
||||
Filesystem
|
||||
----------
|
||||
|
||||
To access specific subpaths, use `DIR_DELIM` as a directory delimiter instead
|
||||
of manually putting one, as different OSs use different delimiters. E.g.
|
||||
```lua
|
||||
"my" .. DIR_DELIM .. "custom" .. DIR_DELIM .. "path" -- and not my/custom/path
|
||||
```
|
||||
|
||||
* `core.get_builtin_path()`
|
||||
* returns path to builtin root
|
||||
* `core.create_dir(absolute_path)` (possible in async calls)
|
||||
|
Loading…
Reference in New Issue
Block a user