Crates.io | tarmac |
lib.rs | tarmac |
version | 0.5.0 |
source | src |
created_at | 2019-10-15 05:22:43.127159 |
updated_at | 2020-06-01 22:08:26.280627 |
description | Resource compiler and asset manager for Roblox projects |
homepage | https://github.com/rojo-rbx/tarmac |
repository | https://github.com/rojo-rbx/tarmac |
max_upload_size | |
id | 172607 |
size | 303,768 |
Tarmac is a resource compiler and asset manager for Roblox projects. It helps enable hermetic place builds when used with tools like Rojo.
Tarmac is inspired by projects like Webpack that make it easy to reference assets from code.
The recommended way to install Tarmac is with Foreman.
Add an entry to the [tools]
section of your foreman.toml
file:
foreman = { source = "rojo-rbx/tarmac", version = "0.5.0" }
Pre-built binaries are available for 64-bit Windows, macOS, and Linux from the GitHub releases page.
Tarmac requires Rust 1.39.0 or newer to build.
You can build the latest release of Tarmac from crates.io:
cargo install tarmac
or build the latest work from the master branch:
cargo install --git https://github.com/rojo-rbx/tarmac
The examples folder contains small, working projects using different features from Tarmac.
Tarmac is configured by a TOML file in the root of a project named tarmac.toml
. Tarmac uses this file to determine where to look for assets and what to do with them.
To tell Tarmac to manage PNG files in a folder named assets
, you can use:
name = "basic-tarmac-example"
# Most projects will define some 'inputs'.
# This tells Tarmac where to find assets that we'll use in our game.
[[inputs]]
glob = "assets/**/*.png"
codegen = true
codegen-path = "src/assets.lua"
codegen-base-path = "assets"
Run tarmac sync --target roblox
to have Tarmac upload any new or updated assets that your project depends on. You may need to pass a .ROBLOSECURITY
cookie explicitly via the --auth
argument.
Tarmac will generate Lua code in src/assets.lua
that looks something like this:
-- This file was @generated by Tarmac. It is not intended for manual editing.
return {
foo = {
bar = "rbxassetid://238549023",
baz = "rbxassetid://238549024",
}
}
These files will be turned into ModuleScript
instances by tools like Rojo. From there, it's easy to load this module and reference the assets within:
local assets = require(script.Parent.assets)
local decal = Instance.new("Decal")
decal.Texture = assets.foo.bar
For more information, run tarmac --help
.
These options can be specified alongside any subcommands and are all optional.
--help
, -h
--version
, -V
--auth <cookie>
--verbose
, -v
tarmac sync
Detects changes to assets in the local project and attempts to synchronize them with an external service, like the Roblox cloud.
Usage:
tarmac sync [<config-path>] \
--target <roblox|debug|none>
To sync the project in your current working directory with the Roblox cloud, use:
tarmac sync --target roblox
To validate that all inputs are already synced, use the none
target:
tarmac sync --target none
tarmac upload-image
Uploads a single image as a decal and prints the ID of the resulting image asset to stdout.
Usage:
tarmac upload-image <image-path> \
--name <asset-name> \
--description <asset-description>
Example:
tarmac upload-image foo.png --name "Foo" --description "Foo is a placeholder name."
tarmac help
Prints help information about Tarmac itself, or the given subcommand.
Usage:
tarmac help [<subcommand>]
name
, string
max-spritesheet-size
, (int, int), optional
asset-cache-path
, path, optional
asset-list-path
, path, optional
upload-to-group-id
, int, optional
inputs
, list<InputConfig>, optional
includes
, list<path>, optional
tarmac.toml
file is found, Tarmac will include it and its includes and stop traversing that directory.glob
, string
codegen
, bool, optional
codegen-path
, path, optional
codegen
is true, Tarmac will merge all generated Lua code for this input group into a single file.codegen-base-path
, path, optional
codegen-path
is also defined. Defaults to the directory containing tarmac.toml
.Tarmac is available under the MIT license. See LICENSE.txt for details.