From 9377cb7c96a54da21027a2c821e8cfabbe2c696e Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 30 Oct 2021 00:26:42 -0700 Subject: tutorial: point at vocabulary.md --- tutorial/index.md | 3 +++ vocabulary.md | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/tutorial/index.md b/tutorial/index.md index 745737a6..9cea483c 100644 --- a/tutorial/index.md +++ b/tutorial/index.md @@ -497,3 +497,6 @@ to make your programs easier to understand. Another thing to notice in this program is the commas. Commas are entirely optional in Mu, and it can be handy to drop them selectively to group arguments together. + +This is a good time to skim [Mu's vocabulary of functions for pixel graphics](https://github.com/akkartik/mu/blob/main/vocabulary.md#pixel-graphics). +They're fun to play with. diff --git a/vocabulary.md b/vocabulary.md index 9c614a90..f2be5f1e 100644 --- a/vocabulary.md +++ b/vocabulary.md @@ -227,6 +227,17 @@ Assertions for tests: at any screen location. - `check-background-color-in-screen-row-from` +#### pixel graphics + +- `pixel`: draw a single point at (x, y) with a given color between 0 and 255. +- `draw-line`: between two points (x1, y1) and (x2, y2) +- `draw-horizontal-line` +- `draw-vertical-line` +- `draw-circle` +- `draw-disc`: takes an inner and outer radius +- `draw-monotonic-bezier`: draw curved lines with a single control point. + Doesn't support curves with "U-turns". + #### events `read-key` reads a single key from the keyboard and returns it if it exists. @@ -234,7 +245,11 @@ Returns 0 if no key has been pressed. `read-mouse-event` returns a recent change in x and y coordinate. -Mu doesn't currently support interrupt-based mouse events. +`timer-counter` returns a monotonically increasing counter with some +fixed frequency. You can periodically poll it to check for intervals passing, +but can't make assumptions about how much time has passed. + +Mu doesn't currently support interrupt-based events. #### persistent storage -- cgit 1.4.1-2-gfad0