Right now, the plan is to imitate the semantics that tools in the JS ecosystem have for dealing with assets, where we can pretend to import asset files like they're modules:
local CancelIcon = require(Assets.CancelIcon)
local ConfirmIcon = require(Assets.ConfirmIcon)
cancelBox.Texture = CancelIcon
confirmBox.Texture = ConfirmIcon
We do this by generating Lua files next to each asset that we want to be able to import:
Another approach would might want to support is grouping together the generated code into one or more batches of files containing assets keyed by name:
local Assets = require(Assets)
cancelBox.Texture = Assets.CancelIcon
confirmBox.Texture = Assets.ConfirmIcon
After trying to take up Tarmac on a particularly large internal Roblox project (UIBlox), I think it's pretty clear that one script per image doesn't scale well at all. When updating images, diffs are huge!
Right now, the plan is to imitate the semantics that tools in the JS ecosystem have for dealing with assets, where we can pretend to import asset files like they're modules:
We do this by generating Lua files next to each asset that we want to be able to import:
Another approach would might want to support is grouping together the generated code into one or more batches of files containing assets keyed by name:
With a corresponding directory structure:
The configuration for a project like this might include this bit in its
tarmac.toml
: