examples/. Each is a Vite project with the same scripts: dev starts the dev server that Drawdy’s development mode hot-reloads from, build packs dist/<driver-id>.drawdyx (dots in the id become dashes, so drawdy.hello builds dist/drawdy-hello.drawdyx), and typecheck runs tsc.
From the repo root:
Drawdy Hello
drawdy-hello
drawdy.hello: says hello to the drawdy main loop. One source file.subscription:scene:elements-added, command:camera:get-info, and command:camera:fly-to-elements.
Math Symbols
drawdy-math-symbols
drawdy.math-symbols: drag Greek letters, operators, and math notation straight onto the canvas.- A webview:
command:webview:create,command:webview:post-message,subscription:webview:message, andacquireDrawdyApi()from the webview API inside it. - An action button:
command:dom:create-action-button,subscription:dom:element-clicked,command:dom:element-rect. - Preview elements during drag and drop:
command:scene:create-drawdy-preview-elements,command:scene:delete-drawdy-preview-elements, thencommand:scene:add-drawdy-elements. - Text editing:
subscription:scene:text-edit,command:scene:update-text-edit. - Also
subscription:dom:theme-changed,subscription:keyboard:control-keys,command:scene:query-tool-state,command:camera:screen-to-canvas, andcommand:camera:get-viewport-rect.
Physics Engine
drawdy-physics-engine
drawdy.physics-engine: simulate selected elements as 2D rigid bodies: gravity, collisions, and impulse response.- Context menus:
command:context-menu:add,command:context-menu:remove,subscription:context-menu:clicked. - Reading the selection:
command:scene:get-selected-ids,command:scene:get-drawdy-elements. - The preview-transform lifecycle:
command:scene:begin-preview,command:scene:preview-transforms,command:scene:end-preview, pluscommand:scene:update-drawdy-elements. - Scene events
elements-added,elements-updated,elements-removed,elements-replaced, andsubscription:camera:moved-rapid. - A physics engine under
src/engine/(broadphase, narrowphase, impulses, frame clock) with Jest tests:pnpm --filter drawdy-physics-engine test.