doodle/cmd/doodad
Noah ddcad27485 WIP: Chunker size to uint8 and Rectangular Doodads
Convert the Chunker size to a uint8 so chunk sizes are limited to 255px. This
means that inside of a chunk, uint8's can track the relative pixel coordinates
and result in a great memory savings since all of these uint8's are currently
64-bits wide apiece.

WIP on rectangular shaped doodads:
* You can create such a doodad in the editor and draw it normally.
* It doesn't draw the right size when dragged into your level however:
  - In uix.Actor.Size() it gets a rect of the doodad's square Chunker size,
    instead of getting the proper doodad.Size rect.
  - If you give it the doodad.Size rect, it draws the Canvas size correctly
    instead of a square - the full drawing appears and in gameplay its hitbox
    (assuming the same large rectangle size) works correctly in-game.
  - But, the doodad has scrolling issues when it gets to the top or left edge
    of the screen! This old gnarly bug has come back. For some reason square
    canvas doodads draw correctly but rectangular ones have the drawing scroll
    just a bit - how far it scrolls is proportional to how big the doodad is,
    with the Start Flag only scrolling a few pixels before it stops.
2023-02-16 21:47:18 -08:00
..
commands WIP: Chunker size to uint8 and Rectangular Doodads 2023-02-16 21:47:18 -08:00
README.md Add doodad.exe binary and PNG to Drawing Converter 2018-10-16 12:26:41 -07:00
main.go Rename Go module 2022-09-24 15:17:25 -07:00

README.md

doodad.exe

The doodad tool is a command line interface for interacting with Levels and Doodad files, collectively referred to as "Doodle drawings" or just "drawings" for short.

Commands

doodad convert

Convert between standard image files (bitmap or PNG) and Doodle drawings (levels or doodads).

This command can be used to "export" a Doodle drawing as a PNG (when run against a Level file, it may export a massive PNG image containing the entire level). It may also "import" a new Doodle drawing from an image on disk.

Example:

# Export a full screenshot of your level
$ doodad convert mymap.level screenshot.png

# Create a new level based from a PNG image.
$ doodad convert scanned-drawing.png new-level.level

# Create a new doodad based from a BMP image, and in this image the chroma
# color (transparent) is #FF00FF instead of white as default.
$ doodad convert --key '#FF00FF' button.png button.doodad

Supported image types:

  • PNG (8-bit or 24-bit, with transparent pixels or chroma key)
  • BMP (bitmap image with chroma key)

The chrome key defaults to white (#FFFFFF), so pixels of that color are treated as transparent and ignored. For PNG images, if a pixel is fully transparent (alpha channel 0%) it will also be skipped.

When converting an image into a drawing, the unique colors identified in the drawing are extracted into the palette. You will need to later edit the palette to assign meaning to the colors.