box

MJS / AC Piece API / graphics / done
box(x, y, w, h, mode)

Draw a box with optional modes: 'fill' (default), 'outline', 'inline'. Add '*center' to draw from center. Use ':N' for thickness.

Parameters

Name Type Required Description
x, y number yes Top-left or center position (depending on mode).
w, h number yes Box width and height.
mode string no fill/outline/inline with optional center and thickness modifiers.

Returns

void

Runtime Notes

No additional runtime notes yet.

Details

box() A random box
box(x, y, size) Square from top left corner
box(x, y, w, h) Rectangle from top left corner
box(x, y, size, mode) Square with mode
box(x, y, w, h, mode) Rectangle with mode


mode
center  - paints a box from the center
outline - paints the outline of a box
inline  - the opposite of outline
(thicken with : like outline:4)
combine modes with * like outline*center or inline:3*center

Live Preview

Embedded AC preview