From c7cc1acddc9ca327d9bcc29888e2322e3b60c134 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 27 Mar 2021 13:59:41 +0530 Subject: add basic usage doc --- readme.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 readme.md diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..1e1dccf --- /dev/null +++ b/readme.md @@ -0,0 +1,46 @@ +A experimental mouse based 1-bit pixel art editor, written +in Rust and SDL2. It reads and writes to a homemade image +format, [OBI](https://git.peppe.rs/graphics/obi). + +### Run + +Requires SDL2 and SDL2_ttf. + +``` +# creates a new file if it dosen't exist +cargo run -- .obi +``` + +### Usage + +`z/c`: zoom in/out +`w/a/s/d`: pan up/left/down/right +`Shift-c`: fit iamge to window +`q/e`: increase/decrease brush size +`1/3`: increase/decrease dither level +`x`: flip color +`tab`: show/hide grid +`i`: invert pixmap (breaks undo for now) +`f`: draw line from last point of contact with grid +`v`: cycle symmetry options, horizontal, vertical, radial, none +`u/r`: undo/redo + +### Lisp REPL + +Enter the REPL by pressing `(` on the keyboard. Complete the +lisp expression with a closing parenthesis and hit enter to +execute it. The REPL supports basic readline operations. + +``` +(define (fac n) (if (<= n 1) 1 (* n (fac (- n 1))))) +(fac 5) +``` + +#### Supported commands: + +`(toggle-grid)`: similar to pressing `tab` on the keyboard +`(save )`: saves the current file. optional +argument to save to a different filename than the one opened +from. +`(quit)`: quit the [editor](editor) + -- cgit v1.2.3