Paint

Embedded programs

A program from your workspace can run in an artwork, in a frame of its own, drawing on the artwork's pixels in its colours.

Embedding a program

Programs are in Files, under programs: press Embed, or drag one onto the canvas to place it there. To make a program read something you've drawn, select the frames, artboards or sprites and right-click them: Use as data source for program... adds them to the program you choose, or to a new one, and embeds it beside them.

Its settings

The embed's Properties list the program's Parameters, set here for this embed alone; Reset goes back to the program's own values. A place it's given shows as a grip on the canvas while the embed is selected, to drag. Data sources says what fills each slot the program reads: Change picks a frame or an artboard on this artwork's canvas, or one from another artwork. A program draws nothing until every slot it needs is filled.

The program draws at its frame's size and starts again when the frame is resized. Its places go with the frame; hold ⌘ while resizing and they stay where they are on the canvas, so the frame shows more or less round them.

Edit, beside the program's name (or Edit program when you right-click the embed), opens it in the Program window. Run in new tab runs it on a page of its own, full screen.

Playing

A program that moves plays on the artwork's timeline, as a sprite does. A game is played where it is: Play at the frame's top right, then its own keys or a gamepad. While it plays, a notice offers Pause and Stop, and Esc pressed twice stops it.

Prerender draws every frame of the embed once and keeps them beside the artwork, so it plays without drawing them again, until the program, its values or its sources change. Its properties say how much room the frames take.

Flattening

Flatten embed, in its properties or right-click menu, turns it into an ordinary frame holding an image of what it shows now. It no longer runs the program.