Skip to content
Back to skills

Draw Shapes

ASecurity

Draw rectangles, lines, and pixels, and clear the screen - all with palette slot numbers, all inside `render()`.

  • 17 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 7, 2026
development

Security analysis

A100/100

Scanned November 24, 2026

npx -y skills add blit386/blit386 --skill draw-shapes --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Draw Shapes?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Draw Shapes
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/blit386-draw-shapes/badge)](https://www.skillsdirectory.com/skills/blit386-draw-shapes)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: draw-shapes
description:
  Draw rectangles, lines, and single pixels and clear the screen using palette slots. Use whenever the user wants boxes,
  outlines, lines, dots, or a background color, or says 'draw a ...'.
---

# Draw shapes

Draw rectangles, lines, and pixels, and clear the screen - all with palette slot numbers, all inside `render()`.

## How to do it

```js
render() {
    BT.clear(2); // fill the whole screen with slot 2

    BT.drawRectFill(new Rect2i(10, 20, 32, 32), 1); // solid box: x, y, width, height
    BT.drawRect(new Rect2i(10, 20, 32, 32), 3); // outline only
    BT.drawLine(new Vector2i(0, 0), new Vector2i(100, 60), 3);
    BT.drawPixel(new Vector2i(50, 50), 4); // one pixel

    BT.clearRect(new Rect2i(0, 0, 64, 16), 2); // repaint just one area
}
```

## Key calls (all methods)

- `BT.clear(slot)` - paint the whole frame. Call it first every frame, or last frame's drawing shows through.
- `BT.drawRectFill(rect, slot)` / `BT.drawRect(rect, slot)` - filled / outlined box.
- `BT.drawLine(p0, p1, slot)` - straight line between two points.
- `BT.drawPixel(pos, slot)` or `BT.drawPixel(x, y, slot)` - one pixel.
- `BT.clearRect(rect, slot)` - clear only a region.

## Notes

- Positions are `Vector2i(x, y)`; boxes are `Rect2i(x, y, width, height)`. Top-left is `(0, 0)` and `y` grows downward.
  Whole numbers only.
- The slot number is a palette index; set up colors first (see the use-palette skill).
- `BT.displaySize` (a property, no parentheses) gives the screen size for centering and edges.

See `docs/drawing.md`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.