Giter VIP home page Giter VIP logo

asphalt's Introduction

Asphalt

Asphalt is a simple CLI tool used to upload assets to Roblox and easily reference them in code.

Features

  • Upload images, audio, and even SVGs!
  • Generate Luau code to reference the uploaded assets
  • Generate Typescript definitions for roblox-ts users
  • Uses the Open Cloud API
  • Supports uploading to groups
  • Define existing uploaded assets, so all of your stuff can be referenced in one place
  • Alpha bleeds images for crisp edges when scaled

Installation

Aftman

aftman add jacktabscode/asphalt

Cargo

cargo install asphalt

Configuration

Asphalt is configured with a project file called asphalt.toml. It is required for the program to run.

Example
asset_dir = "test/"
write_dir = "output/"

[codegen]
typescript = true
luau = true
style = "flat"
output_name = "assets"

[creator]
type = "user"
id = 9670971

[existing]
"test/some_sound_on_roblox.ogg" = { id = 123456789 }
"test/some_image_on_roblox.png" = { id = 987654321 }

Format

  • asset_dir: path
    • The directory of assets to upload to Roblox.
  • write_dir: path
    • The directory to output the generated code to. This should probably be somewhere in your game's source folder.
  • creator: Creator
    • The Roblox creator to upload the assets under.
  • codegen: Codegen
    • Code generation options.
  • existing: map<string, ExistingAsset> (optional)

Creator

  • type: "user" or "group"
  • id: number

Codegen

  • typescript: boolean (optional)
    • Generate a Typescript definition file.
  • luau: boolean (optional)
    • Use the luau file extension.
  • style: "flat" | "nested" (optional)
    • The code-generation style to use. Defaults to flat. If you would like to have an experience similar to Tarmac, use nested.
  • output_name: string (optional)
    • The name for the generated files. Defaults to assets.
  • strip_extension: boolean (optional)
    • Whether to strip the file extension. Defaults to false. If you would like to have an experience similar to Tarmac, use true.

ExistingAsset

  • id: number

Usage

Just run asphalt and make sure you have a config file as specified above. When complete, it will generate a asphalt.lock.toml file which you should have committed to source control.

API Key

You will need an API key to run Asphalt. You can specify this using the --api-key argument, or the ASPHALT_API_KEY environment variable.

You can get one from the Creator Dashboard. Make sure you select the correct group and Asset-related permissions.

Attributions

Thank you to Tarmac for the alpha bleeding and nested codegen implementations, which were used in this project.

asphalt's People

Contributors

jacktabscode avatar dependabot[bot] avatar bibi-reden avatar paradoxuum avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.