Documents and layers
A project is one plain object, the document, with a list of layers.
Both are open: a plugin may keep values of its own on either, and they are saved with the project.
The document
| Key | What it is |
|---|---|
name | The project's name. |
template | What it was started as. 'Blank' is an empty canvas. |
canvas_w, canvas_h | The size of an empty canvas, in pixels. |
pixel | Whether it is pixel art: hard pixels, a pencil, a grid. |
frames, frame_ms | How many frames it has, and how long each shows. |
layers | The layers, bottom to top. |
pages, page | A project with more than one slide: each slide's own settings, and which is on screen. See Slides. |
A feature card
A feature card (template: 'Feature card', 1920 × 1080) is drawn from these settings beside the design's own (name is its title, tagline its description, author the mod's name over it).
| Key | What it is |
|---|---|
layout | 'Right', 'Left', 'Top', 'Center', 'Full' or 'Cover': where the media stands beside the lettering. |
card_style | 'Classic', or 'Gallery': a flat header (the icon, the mod's name, subtitle under it), a huge title from the top, square points, media in an outline of the color with a soft shadow, tiles with an edge of the color. A Gallery cover has a large icon and no mod's name. |
name | The title. A new line in it breaks it there. A Gallery title too wide for its column is made smaller (to seven tenths), not wrapped. |
title_lines | How many lines the title may take, at most (3). |
underline, rule_style | A line under the title; 'Bar' (short) or 'Fading': soft, with round ends, as wide as the title, full of the color at its start and fading out toward its end. |
media | 'Screenshot', 'Code', 'Tiles', 'Items' or 'None'. |
screenshot | One picture, as a data: address. |
shots | Several pictures: [{ picture, label }], each a data: address and the words at its foot (none: no label). When there are any, they are shown in place of screenshot. |
shots_layout | 'Side by side' (each its own frame), 'Strips' (one frame, parted by lines of the color) or 'Stacked' (overlapping, each lower and further left). |
shot_fit | 'Fill': a picture fills its frame, cut to it. 'Whole': the frame takes the picture's shape, and nothing of it is cut. |
code, code_title | The code in its window, and the file's name on its bar. A cover stacks the code's blocks (parted by an empty line) as windows, and code_title names each, parted by commas. |
tiles, tile_style | One per line. 'Grid': Name | what it is, two to a row. 'Branches': Name | what it is | a line of code, in one row, each with an arrow from the media over it. 'Chips': Label | one, another, a row of chips (a label ending in : stands before them; chips that read as code are set in its letters). |
bullets, tags, tag_style | The points (one per line) and the tags (parted by commas), and how tags look: 'Pill' or 'Chip'. |
panel, style | The background. A card has panel: 'Warm' beside 'Dark' and 'Glossy': nearly black at the upper left, warming toward the lower right. style: 'Graph' is a faint flat grid (its cell set by density). |
frame | The icon's frame. 'Rounded': the picture alone, its corners rounded. |
Slides
Any project can hold several slides, as a deck of slides or the pages of a PDF are: a mod's whole gallery of feature cards, the slides of a talk on an empty canvas, a set of banners, in one tab and one file. Image › Slides adds the first; a project of feature cards shows the strip of slides from the start. In the strip they are added, copied and moved, and deleted by the X on each or a click of the middle button. A slide with something on it is asked about first (Don't ask again stops that; Settings › General brings it back), and Undo brings a deleted slide back. Export writes the slide on screen, or every slide: as an image sequence (a picture each, in one zip or written one by one into a folder you choose), a PDF (a page to a slide) or a PowerPoint deck (.pptx, a slide to a slide).
The slides share the project's look and size: its icon, colors, background, fonts and the mod's name. Each has its own layers, and what else its template keeps for each: a feature card its name, tagline, subtitle, layout, card_style, media and tiles, points and tags, title and text sizes (name_size, name_weight, tagline_size), icon_size and shadow; a banner its name, tagline and their sizes; an item slot its name, icon and count; an empty canvas its name. The slide on screen is the document itself; the others wait in pages, and page says which is on screen (the names the file has had since feature cards had pages).
A project with slides is saved as version 2 of the file, with pages (each slide's settings and layers) and page beside the usual parts; its settings are those of the slide on screen, which it opens on. A project of one slide is saved as version 1, as before, and every file of version 1 opens as it did.
A layer
| Key | What it is |
|---|---|
id | What the project knows it as. Given by the program when a layer is added. |
kind | 'paint' (painted on), 'shape', 'text', 'image' (a picture) or 'group'. |
name, visible, locked, opacity | As the layers list shows them. |
x, y | How far its middle is from the image's middle. A painted layer: how far it is shifted. |
pixels, cels | A painted layer's picture as a PNG in base64; with frames, one per frame. |
shape, w, h, color, radius, stroke | A shape: 'Rectangle', 'Ellipse' or 'Line', its size, its color, its corners, its outline (0: filled). |
source, size, rotation | A picture: its address, its height as a part of the image's, its turn. |
made | For a plugin's element: { by: 'plugin:key', ...settings }. |
Adding layers
commands: [{
label: 'Three dots',
run(api) {
const dots = [-120, 0, 120].map((x) => ({ kind: 'shape', name: 'Dot', shape: 'Ellipse', w: 64, h: 64, color: api.project.color, radius: 0, stroke: 0, x, y: 0 }));
api.project.addAll(dots, {}, 'Dots'); // all at once, in a group: one step to undo
},
}],
@plugin.command('Three dots')
def three_dots(app):
dots = [dict(kind='shape', name='Dot', shape='Ellipse', w=64, h=64, color=app.color, radius=0, stroke=0, x=x, y=0) for x in (-120, 0, 120)]
app.add_all(dots, group='Dots') # all at once, in a group: one step to undo