Onceworlds
Engine · Posters

Store art: posters

Store art made by the game's own code (game.poster), and pictures to look at (shot).

game.poster(name, setup) registers a staged scene for the game page. Opening the game with ?poster=cover draws that scene instead of the game, at an exact size and a pixel ratio of 1, frozen and deterministic. npx @onceworlds/cli posters opens your latest draft that way and saves a picture of each into store/<name>.png, naming icon and the 16:9 pictures in onceworlds.json when it has none.

game.poster('cover', (p) => {                  // 1920 x 1080 by default; 'icon' is 512 x 512, 'badge-*' 256 x 256
  p.camera({ height: 10, clear: '#203040' });
  p.world.spawn([Transform(), Shape2D({ shape: 'circle', radius: 2, fill: '#ffd23f' })]);
  feelOf(p.world).particles.burst('confetti', { x: 0, y: -4 });
  p.settle(0.8);                               // simulate a little first, with the seed fixed
});

Pictures to look at: shot

npx @onceworlds/cli shot saves a PNG of the game for you to look at (the MCP tool screenshot returns it to the model directly):