Skip to content

Commit 4d6d77f

Browse files
committed
Add paragraph about custom libraries
1 parent e49da7b commit 4d6d77f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/godot_docs/libraries.md

+12
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ sidebar_position: 11
66

77
Libraries make it easy to use pre-made programs in the sandbox.
88

9+
Here is a complete working example for adding sandboxed LuaJIT to your project:
10+
911
```py
1012
if !FileAccess.file_exists("res://luajit.elf"):
1113
var buffer = Sandbox.download_program("luajit")
@@ -38,3 +40,13 @@ Libraries make it easy to use pre-made programs in the sandbox.
3840
There is [a repository with pre-made programs](https://github.com/libriscv/godot-sandbox-programs).
3941

4042
You can find [the latest release here](https://github.com/libriscv/godot-sandbox-programs/releases/latest). The latest release is used by `Sandbox.download_program(name)`.
43+
44+
## Custom libraries
45+
46+
You can provide your own library, but it must be added to the project in project settings. Under Editor -> Script -> Program Libraries you can add a new Dictionary entry with key `library_name`and value `github_user/repository_name`. Once added, `library_name/artifact` will now refer to `https://github.com/github_user/repository_name/releases/latest/artifact.zip`. That is:
47+
48+
```py
49+
var buffer = Sandbox.download_program("library_name/artifact")
50+
```
51+
52+
Will download the URL mentioned above.

0 commit comments

Comments
 (0)