Skip to content

Pixel-art architecture ​

PixelArtState holds the authoritative PixelDocumentState: pixels, UV regions, color palette and normal map settings. The server opens one room per asset; the browser keeps a PixelDocument in sync with it. The shared room and persistence lifecycle is shown in asset workspace architecture.

Edits and conflicts ​

commands.apply is the sole writer of the server state, through PixelDocumentState.apply. The arbiter checks the current buffer; its conflict trackers commit only after the event append succeeds. Event replay uses the same apply function.

Selection edits keep colors aligned with admitted positions. A resize or texture replacement resets the pixel keys to its own version. The arbiter also checks selection lengths, UV data, and allowed buffer sizes. Room presence carries cursors and edit previews; it does not enter the event log or mutate the buffer. See the network API for the client contract.