Repository navigation
Releases
Create 0.3.2
A documentation release: the user guide is reorganised into sections (basics, drawing, interaction, motion, geometry, media, data and maths), several pages are renamed, and gaps in what it covers are filled. Its prose is rewritten to a consistent style, and the maths pages now say what they assume.
For contributors, CONTRIBUTING.md is split into a guide for each part of the repository, with a prose style guide, and the repository has issue forms and a pull request template. The sidescroller example is renamed platformer, and the sketch example is removed.
No change to the library.
pixi add "create>=0.3.2,<0.4"Create 0.3.1
The package now ships the project template that create-cli's create new starts a project from: a main.mojo and the assets/logo.png it draws, installed to share/create/template. New projects can therefore start on the newest Create, with a template written for it, without waiting for a create-cli release.
No change to the library.
pixi add "create>=0.3.1,<0.4"Create 0.3.0
Add it to a project with:
pixi workspace channel add https://prefix.dev/create-framework/create
pixi add "create>=0.3,<0.4"Breaking changes
- Playheads keep time by the run clock.
AnimatorandTweenwork out their position from the run's clock whenever they are asked, soAnimator.updateandTween.updateare removed: nothing needs ticking, and forgetting to can no longer freeze a sprite. A tween's changed duration takes effect at once (#47). time.deltaandtime.elapsedare scaled time, which the new time scale and pause slow and stop. Real time istime.real_deltaandtime.real_elapsed.delta_millisandelapsed_millisare removed (#47).- New
create.timeandcreate.animationpackages.Time,DateTimeandClockmove intocreate.time;Tween,AnimationandAnimatorintocreate.animation.Easingandeasestay inmath. Only code importing these by package path changes;from create import *is unaffected (#53, #54). - Shapes spell out their extents.
rbecomesradiusonCircle,Capsule,Arc,Sector,Polygon.regularandPolygon.star;w,hbecomewidth,heightonRectangleandEllipse. The matching canvas calls andcanvas.image's keywords follow (#49). Voiceis renamedPlayback(#61).overlapsis a method of each region, likecontainsandintersects:overlaps(a, b)becomesa.overlaps(b)(#64).
New
- A time scale and a pause for the run's time:
context.time_scale(s)andcontext.time_paused(True). A playhead built withclock=Clock.REALkeeps moving through them, for a pause menu's own animations (#47). canvas.autoclear(False)works on the GPU backend too (#51).- Recordings with the autoclear off keep what the screen keeps, starting from the picture already on screen (#57).
start_recording(..., transparent=True)records a GIF with a transparent background (#57).
Improvements
- A recording writes only what changed between frames: an 800x500 painting recorded for 90 frames with the autoclear off shrinks from 159 KB to 13 KB (#57).
- The documentation site moved to create-framework.org, with the latest release and
mainside by side (#46, #48). The user guide is reorganised, with new pages for time, animation, installation and coming from Processing, and the API reference gives each type and function a page of its own and is committed underdocs/reference(#50, #52, #53, #54, #60, #65).
Fixes
- A polygon contains itself, its own edges, and rectangles and triangles on its corners (#63).
Create 0.2.0
Create is now published to its own prefix.dev channel, create-framework/create, the one create-cli is on, instead of modular-community. Add it to a project with:
pixi workspace channel add https://prefix.dev/create-framework/create
pixi add "create>=0.2,<0.3"Breaking changes
- Mojo 1.2. Create now builds against Mojo 1.2 only (#31).
- File paths resolve against the calling source file, not the working directory:
Image.load,Font.load,Sound.load,Table/JSONload and save,save_image,start_recordingand the rest. Usesource_path("...")for the standard library'sopen()and friends (#40). Audio.updateis removed. Looping voices are fed on SDL's audio thread, so nothing needs calling each frame (#38).Sound.from_pcmis replaced bySound.from_samples, which takesFloat64samples from -1.0 to 1.0 and raises on a format that can't play (#38).
New
canvas.textbreaks lines at newlines and wraps to a width (#41).- Dashed strokes (#42).
- Audio: a voice's playback speed and start volume,
Audio.pause_all/resume_all,Audio.is_paused, andSound.frame_count,durationandsample(#38). - The packaged Noto fonts are compiled into the library, so text draws from a built program or package moved off the machine (#30).
- A user guide and API reference, published at create-framework.github.io/create.
Fixes
- Every voice is mixed on one audio device, looping voices no longer run dry between frames, and one-shot voices end without waiting (#38).
- Audio plays silently where no audio device opens, rather than failing (#38).
- Loading a sound file with no samples raises; a negative volume is silence (#38).
- Shared libraries are opened by their versioned soname, so a system without
-develpackages works (#30).
Create 0.1.1
Text now works in an installed conda package: Create finds its packaged fonts in the environment's share/create/fonts when they aren't beside its source (#26).
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.