@blkc-code/render-canvas 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/draw.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /**
2
- * Draws the office. Every piece of art here is original to this project, made of
3
- * rectangles and the character maps below at 16 pixels a tile.
2
+ * Draws the office. Every piece of art here is original to this project, made in code at
3
+ * 16 pixels a tile. The building is drawn once to a layer (drawBuilding); people, screens
4
+ * and anything else that moves are drawn on top each frame (drawWorld).
4
5
  */
5
6
  import { type World } from "./world.js";
6
7
  export declare const TILE = 16;
@@ -11,6 +12,15 @@ export interface Palette {
11
12
  accent: string;
12
13
  }
13
14
  type Ctx = CanvasRenderingContext2D;
14
- export declare function drawWorld(c: Ctx, world: World, time: number, palette: Palette, selected?: string): void;
15
+ export interface Daylight {
16
+ sky: string;
17
+ sun: string;
18
+ night: number;
19
+ }
20
+ export declare function daylightAt(hour: number): Daylight;
21
+ /** Everything that doesn't move. Redrawn only when the building or the hour changes. */
22
+ export declare function drawBuilding(c: Ctx, world: World, palette: Palette, daylight: Daylight): void;
23
+ /** Everything that moves. `building` is the layer from drawBuilding. */
24
+ export declare function drawWorld(c: Ctx, world: World, time: number, palette: Palette, daylight: Daylight, building: CanvasImageSource | undefined, selected?: string): void;
15
25
  export {};
16
26
  //# sourceMappingURL=draw.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"draw.d.ts","sourceRoot":"","sources":["../src/draw.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAyD,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAE/F,eAAO,MAAM,IAAI,KAAK,CAAC;AAEvB,MAAM,WAAW,OAAO;IAAG,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AAE9F,KAAK,GAAG,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