mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 09:15:29 +01:00 
			
		
		
		
	Menu docs: clarify that image paths must be escaped to correctly render on Windows (#15072)
This commit is contained in:
		@@ -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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user