GithubHelp home page GithubHelp logo

bbb651 / aseprite-puzzlescript-export Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pancelor/aseprite-puzzlescript-export

0.0 0.0 0.0 119 KB

aseprite script to export tiles as puzzlescript sprites

Lua 100.00%

aseprite-puzzlescript-export's Introduction

Aseprite PuzzleScript Export

A script for Aseprite that exports images as PuzzleScript sprites.

Video example

pic.twitter.com/0x6qW3dZLq

Example

aseprite screenshot

This exports as:

aseprite1
#e5e5e5 #cccccc
.....
..0..
.000.
.001.
.011.

aseprite2
#ffffff #f7e26b #eb8931 #be2633
.000.
.0102
00003
0000.
.2.2.

aseprite3
#44891a #a3ce27 #2f484e
...0.
.0100
00000
.0102
...0.

aseprite4
#44891a #2f484e
.....
00000
01000
00010
.....

Installation

Save PuzzleScriptExport.lua to your Aseprite scripts folder (File > Scripts > Open Scripts Folder)

Usage

  • Open the exporter from the Aseprite menu: File > Scripts > PuzzleScriptExport
  • Choose your export settings (see below)
  • Press the "Export" button
  • Copy the output text; paste it into your PuzzleScript game
  • Leave the export window open to quickly export again later

If you select a rectangle in your image and then press the "Export" button, only the tiles inside that rectangle will be exported.

Export Settings

  • Source:
    • grid: the exporter will export 5x5 tiles, or whatever size you set. You'll probably also want to set up aseprite's grid overlay. (View > Grid > Grid Settings)
    • slices: the exporter will export the sprite's slices -- this lets you name your sprites in Aseprite, instead of needing to rename them after exporting. Recommended for long-term projects.
  • Subdivide slices (slices only): subdivide each slice according to the grid. This lets you export many tiles from a single slice. e.g. "tree" => "tree0", "tree1", "tree2", ...
  • Name prefix (grid only): name prefix for the exported tiles.
  • Active layer only: whether to export visible pixels or just the pixels from the current layer.

(why would you want non-5x5 sprites? there are PuzzleScript forks out there that allow differently-sized sprites)

Other notes

Slices!

Named slices are supported.

aseprite screenshot

Transparent Sprites

This script will consider any color with alpha value 0 as transparent. Make sure the layer you're exporting from is a "Layer", not a "Background". (Right click on a background layer > Convert To > Layer)

Feature Wishlist

I probably won't get around to adding these, but I'll collect them here:

  • add support for slices
  • add support for indexed/palettized images
  • add ability to export the current layer only
  • add support for tilemap layers
  • deduplicate exported tiles
    • but only in auto-name mode -- identical slices should stay separate
  • add support for tilemaps for level creation (not just sprite drawing)
  • regression tests. {all layers,active layer only}x{2 source types}x{indexed colormode,rgba}x{tilemap,not}
    • commandline conversion support

aseprite-puzzlescript-export's People

Contributors

bbb651 avatar pancelor 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.