@idosgames/characters 0.1.3 → 0.1.4

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.
@@ -118,6 +118,11 @@ interface CharacterCanvasOptions {
118
118
  side: number;
119
119
  top: number;
120
120
  };
121
+ /**
122
+ * × the art's size its images are rasterized at, live (default 3). A game that draws the same hero passes its own
123
+ * resolution: the pictures it already made are then reused, not made again (art/raster.ts).
124
+ */
125
+ resolution?: number;
121
126
  }
122
127
  declare class CharacterCanvas {
123
128
  private readonly options;
@@ -144,6 +149,13 @@ declare class CharacterCanvas {
144
149
  /** An animation event, "end", or "*". Returns the unsubscribe. */
145
150
  on(event: string, listener: (e: AnimationEvent) => void): () => void;
146
151
  setLook(look: CharacterLook): void;
152
+ /**
153
+ * Puts the canvas into a host (moved out of the one it was in). A screen that closes and opens again keeps one
154
+ * view this way: its WebGL context and its textures stay, and the hero is there at once, not drawn anew.
155
+ */
156
+ attach(host: HTMLElement): void;
157
+ /** Takes the canvas off the page; it stops drawing until `attach`. */
158
+ detach(): void;
147
159
  destroy(): void;
148
160
  private stanceOf;
149
161
  private resize;
@@ -118,6 +118,11 @@ interface CharacterCanvasOptions {
118
118
  side: number;
119
119
  top: number;
120
120
  };
121
+ /**
122
+ * × the art's size its images are rasterized at, live (default 3). A game that draws the same hero passes its own
123
+ * resolution: the pictures it already made are then reused, not made again (art/raster.ts).
124
+ */
125
+ resolution?: number;
121
126
  }
122
127
  declare class CharacterCanvas {
123
128
  private readonly options;
@@ -144,6 +149,13 @@ declare class CharacterCanvas {
144
149
  /** An animation event, "end", or "*". Returns the unsubscribe. */
145
150
  on(event: string, listener: (e: AnimationEvent) => void): () => void;
146
151
  setLook(look: CharacterLook): void;
152
+ /**
153
+ * Puts the canvas into a host (moved out of the one it was in). A screen that closes and opens again keeps one
154
+ * view this way: its WebGL context and its textures stay, and the hero is there at once, not drawn anew.
155
+ */
156
+ attach(host: HTMLElement): void;
157
+ /** Takes the canvas off the page; it stops drawing until `attach`. */
158
+ detach(): void;
147
159
  destroy(): void;
148
160
  private stanceOf;
149
161
  private resize;