merge ws/bundle
This commit is contained in:
commit
c95a081127
16 files changed
+399611
-210
No files matched your search
+13
-18
@@ -41,34 +41,29 @@ as `F`, and its input files as variables such as `pngBytes` (a buffer) or `srtTe
|
||||
|
||||
## Installing
|
||||
|
||||
**Roblox (Rojo).** Build the Roblox tree, then let Rojo turn it into a model or sync it into Studio:
|
||||
|
||||
```sh
|
||||
python3 -I tools/build.py roblox # writes build/roblox/Rosetta (requires become instance paths)
|
||||
rojo build -o Rosetta.rbxm # default.project.json mounts build/roblox/Rosetta; or: rojo serve
|
||||
```
|
||||
|
||||
Put the `Rosetta` ModuleScript somewhere both client and server can see it, for example ReplicatedStorage:
|
||||
**Roblox.** The library is one ModuleScript, [`build/Rosetta.luau`](../../build/Rosetta.luau) (committed; rebuilt by
|
||||
`python3 -I tools/build.py roblox`). Paste it into a ModuleScript named `Rosetta`, or mount it with Rojo
|
||||
(`"Rosetta": { "$path": "rosetta/build/Rosetta.luau" }`; this repository's `default.project.json` does, so
|
||||
`rojo build -o Rosetta.rbxm` or `rojo serve` works from here). Put it where both client and server can see it, for
|
||||
example ReplicatedStorage:
|
||||
|
||||
<!-- doc:display needs Roblox -->
|
||||
```luau
|
||||
local F = require(game:GetService("ReplicatedStorage").Rosetta)
|
||||
local Mpeg1 = F._internal("codecs/video/Mpeg1") -- an internal module, by its path under src/Rosetta
|
||||
```
|
||||
|
||||
Roblox has no file system: pass buffers or strings, for example from `HttpService:GetAsync` or a `buffer` you built.
|
||||
Requiring it runs only the API and what it needs at load time; every format and codec runs on first use. Roblox has
|
||||
no file system: pass buffers or strings, for example from `HttpService:GetAsync` or a `buffer` you built.
|
||||
|
||||
**LuaJIT and LÖVE.** Build the Lua 5.1 tree:
|
||||
|
||||
```sh
|
||||
python3 -I tools/build.py luajit # writes build/luajit/rosetta/ (plain Lua 5.1 + the LuaJIT FFI)
|
||||
```
|
||||
|
||||
Then either copy `build/luajit/rosetta` into your game, or put the build on `package.path`:
|
||||
**LuaJIT and LÖVE.** The library is one file, [`build/rosetta.lua`](../../build/rosetta.lua) (plain Lua 5.1 + the
|
||||
LuaJIT FFI; rebuilt by `python3 -I tools/build.py luajit`). Copy it into your game and require it from a folder on
|
||||
`package.path`, or load it with `dofile`:
|
||||
|
||||
<!-- doc:display plain LuaJIT code -->
|
||||
```lua
|
||||
package.path = "build/luajit/?.lua;build/luajit/?/init.lua;" .. package.path
|
||||
local F = require("rosetta")
|
||||
package.path = "build/?.lua;" .. package.path
|
||||
local F = require("rosetta") -- or: local F = dofile("build/rosetta.lua")
|
||||
```
|
||||
|
||||
The library carries its own copy of the Luau standard library pieces it uses (`buffer`, `bit32`, `utf8`, ...).
|
||||
|
||||
Reference in new issue
Block a user