Skip to content

Commit f7628a6

Browse files
committed
📝 clarify docs
1 parent eddb369 commit f7628a6

File tree

3 files changed

+30
-13
lines changed

3 files changed

+30
-13
lines changed

docs/user-manual.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,19 @@ It can also mean that you forgot to put `runtime.js` and `runtime.wasm` in the s
839839

840840
You put these files in a zip and upload it to [itch.io](https://itch.io) if you want.
841841

842+
# 🧩 Extending Vectarine with Plugins
843+
844+
Plugins are a way to add features to the vectarine editor and to your game. Plugins can add new interfaces in the editor, new luau functions, and do basically anything.
845+
Because of this, running requires that you trust the author.
846+
847+
Plugins exist in the form of files with the `.vectaplugin` extension. Vectarine stores a list of trusted plugin that you can use in your games to a `plugin` folder that
848+
you can open using the "Open plugin folder" in the "Plugin manager". When you download a plugin, you should add it to this folder.
849+
850+
Games have their own list of plugins in their `plugins` folder which should be next to the `game.vecta` file. For security reasons,
851+
**the vectarine editor will only load plugins from a game if they are also in the `plugins` folder of the editor** and are thus trusted plugins!
852+
853+
If you want to make your own plugins, check the [README](https://github.com/vanyle/vectarine/tree/main/vectarine-plugin-template) of the vectarine plugin template on Github.
854+
842855
# 👥 Collaborating on a project
843856

844857
Working on a game with other people is more fun!

vectarine-plugin-template/README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,25 @@ Run it using `uv run bundle.py`.
1111

1212
You'll need to have [uv](https://github.com/astral-sh/uv) installed.
1313

14-
## Using your plugin
14+
This will produce a `plugin.vectaplugin` file that you can copy to the `plugins` folder of the editor to use it.
1515

16-
Vectarine comes bundled with a runtime that is precompiled for all the major platforms.
17-
For your plugins, you will need to manually compile them for the platforms you want to support.
16+
## Distributing your plugin
1817

19-
If you don't have a Mac, you won't be able to support MacOS users for example.
18+
To share your plugin, simply share the `your_plugin_name.vectaplugin` file.
2019

21-
## Distributing your plugin
20+
## Platform support
21+
22+
Vectarine comes bundled with a runtime that is precompiled for all the major platforms.
23+
However, as plugins contain native code, you will need to manually compile them for the platforms you want to support.
24+
25+
If you don't compile a Mac version of your plugin, games using it won't be able to run on Mac.
2226

23-
Vectarine can load plugins in 2 ways:
27+
## Lua API
2428

25-
- From a local file
26-
- From the plugin registry
29+
If your plugin extends the Lua, you should provide inside `plugin.luau` a list of the function you define, with documentation comments and proper types.
2730

28-
Plugins can have 2 formats:
31+
## Plugin capabilities
2932

30-
- Unpackage plugins are the main format for plugin developpers, it is just the path to the shared library with the plugin
31-
- Package plugins are the format for end users, a zip file with the shared libraries with the different platforms an documentation.
33+
As vectarine plugins are written in Rust, they can do pretty much anything, as long as the platform they are compiled for supports it.
3234

33-
If your plugin extends the Lua, you should provide a `luau-api` folder to document the APIs you provide as well as a `README.md` file
34-
for a description of your plugin, an **examples** on how to use it.
35+
Moreover, plugins use the SDK as a dependency to be able to access and create Luau functions for users.

vectarine-plugin-template/plugin.luau

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
local module = {}
22

3+
--- Returns the square of a number
4+
--- @param n number
5+
--- @return number
36
function module.square(n: number): number
47
return n * n
58
end

0 commit comments

Comments
 (0)