Repository navigation
Create 0.1.0
The first release of Create, a creative coding library for the Mojo programming language.
APIs are experimental. Expect breaking changes before 1.0.
Highlights
- A program is one struct. Implement
Program(createdraws frame 1,updateevery later one) and pass it torun. Input is read fromcontext.keyboard,context.mouseandcontext.gamepad(i)with one vocabulary:down,pressed,released. - Two renderers, one API. A CPU rasteriser by default, or OpenGL 3.3 with
backend=RenderBackend.GPU. Both have antialiasing (OFFtoHIGH). - Shapes and curves:
Rectangle(rounded, turnable),Circle,Ellipse,Capsule,Triangle,Sector,Polygon,Line,Arc,BezierandSpline, all drawn withcanvas.draw. A program's own types draw the same way throughDrawable. - Collision built in:
overlaps,containsandintersectsbetween every pair of shapes, rounded corners included. - Styling: fill, stroke (alignment and caps), linear and radial gradients, drop and inset shadows, tint, opacity, blend modes and clipping, scoped with
withblocks. - Text through FreeType, with Noto Sans packaged, plus variable weights, italics and
EditableTextfor input fields. - Images and animation: PNG, JPEG and BMP; sprite
Animation/Animator;Tweenand easing curves; pixel reads withcolor_at/snapshot; offscreen canvases; GIF recording. - Audio: WAV, OGG, FLAC and MP3 playback.
- Camera and autoscale: design-size coordinates (origin centred, y up) mapped onto any window with
FIT,EXTENDorOFF. TheCamerahandles world space, andoverlayhandles the HUD. - Math and data:
Point2D/Vector2D, matrices, seededRandomandNoise, CSV/TSVTables andJSON.
Getting started
See the README for setup and a walkthrough of a first program, and examples/ for one program per feature.
Platforms
- Linux (x86-64): supported, tested on every change.
- Windows via WSL2: supported.
- macOS on Apple silicon: built and tested by an on-demand CI run, with little real-desktop use so far.
Requires Mojo 1.1. Every dependency comes through pixi.