@al8b/image 0.1.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.
Files changed (94) hide show
  1. package/README.md +30 -0
  2. package/dist/blending.d.mts +3 -0
  3. package/dist/blending.d.ts +3 -0
  4. package/dist/blending.js +65 -0
  5. package/dist/blending.js.map +1 -0
  6. package/dist/blending.mjs +40 -0
  7. package/dist/blending.mjs.map +1 -0
  8. package/dist/color-DJyRSbpZ.d.mts +16 -0
  9. package/dist/color-DJyRSbpZ.d.ts +16 -0
  10. package/dist/core/color.d.mts +1 -0
  11. package/dist/core/color.d.ts +1 -0
  12. package/dist/core/color.js +61 -0
  13. package/dist/core/color.js.map +1 -0
  14. package/dist/core/color.mjs +36 -0
  15. package/dist/core/color.mjs.map +1 -0
  16. package/dist/core/context.d.mts +25 -0
  17. package/dist/core/context.d.ts +25 -0
  18. package/dist/core/context.js +77 -0
  19. package/dist/core/context.js.map +1 -0
  20. package/dist/core/context.mjs +53 -0
  21. package/dist/core/context.mjs.map +1 -0
  22. package/dist/core/drawing.d.mts +2 -0
  23. package/dist/core/drawing.d.ts +2 -0
  24. package/dist/core/drawing.js +165 -0
  25. package/dist/core/drawing.js.map +1 -0
  26. package/dist/core/drawing.mjs +134 -0
  27. package/dist/core/drawing.mjs.map +1 -0
  28. package/dist/core/font.d.mts +19 -0
  29. package/dist/core/font.d.ts +19 -0
  30. package/dist/core/font.js +80 -0
  31. package/dist/core/font.js.map +1 -0
  32. package/dist/core/font.mjs +55 -0
  33. package/dist/core/font.mjs.map +1 -0
  34. package/dist/core/image.d.mts +84 -0
  35. package/dist/core/image.d.ts +84 -0
  36. package/dist/core/image.js +1018 -0
  37. package/dist/core/image.js.map +1 -0
  38. package/dist/core/image.mjs +993 -0
  39. package/dist/core/image.mjs.map +1 -0
  40. package/dist/core/map-rendering.d.mts +2 -0
  41. package/dist/core/map-rendering.d.ts +2 -0
  42. package/dist/core/map-rendering.js +95 -0
  43. package/dist/core/map-rendering.js.map +1 -0
  44. package/dist/core/map-rendering.mjs +70 -0
  45. package/dist/core/map-rendering.mjs.map +1 -0
  46. package/dist/core/pixel.d.mts +18 -0
  47. package/dist/core/pixel.d.ts +18 -0
  48. package/dist/core/pixel.js +99 -0
  49. package/dist/core/pixel.js.map +1 -0
  50. package/dist/core/pixel.mjs +73 -0
  51. package/dist/core/pixel.mjs.map +1 -0
  52. package/dist/core/shapes.d.mts +2 -0
  53. package/dist/core/shapes.d.ts +2 -0
  54. package/dist/core/shapes.js +218 -0
  55. package/dist/core/shapes.js.map +1 -0
  56. package/dist/core/shapes.mjs +187 -0
  57. package/dist/core/shapes.mjs.map +1 -0
  58. package/dist/core/sprite-rendering.d.mts +2 -0
  59. package/dist/core/sprite-rendering.d.ts +2 -0
  60. package/dist/core/sprite-rendering.js +135 -0
  61. package/dist/core/sprite-rendering.js.map +1 -0
  62. package/dist/core/sprite-rendering.mjs +108 -0
  63. package/dist/core/sprite-rendering.mjs.map +1 -0
  64. package/dist/core/text.d.mts +2 -0
  65. package/dist/core/text.d.ts +2 -0
  66. package/dist/core/text.js +105 -0
  67. package/dist/core/text.js.map +1 -0
  68. package/dist/core/text.mjs +78 -0
  69. package/dist/core/text.mjs.map +1 -0
  70. package/dist/core/transform.d.mts +2 -0
  71. package/dist/core/transform.d.ts +2 -0
  72. package/dist/core/transform.js +101 -0
  73. package/dist/core/transform.js.map +1 -0
  74. package/dist/core/transform.mjs +71 -0
  75. package/dist/core/transform.mjs.map +1 -0
  76. package/dist/drawing-Bo2U4IUE.d.mts +31 -0
  77. package/dist/drawing-e7iVDl14.d.ts +31 -0
  78. package/dist/index.d.mts +12 -0
  79. package/dist/index.d.ts +12 -0
  80. package/dist/index.js +1098 -0
  81. package/dist/index.js.map +1 -0
  82. package/dist/index.mjs +1066 -0
  83. package/dist/index.mjs.map +1 -0
  84. package/dist/map-rendering-CzeC061I.d.mts +20 -0
  85. package/dist/map-rendering-DcldCBtY.d.ts +20 -0
  86. package/dist/shapes-BY37IuhJ.d.ts +27 -0
  87. package/dist/shapes-CpCwX9Rp.d.mts +27 -0
  88. package/dist/sprite-rendering-Dac9FQ2x.d.ts +30 -0
  89. package/dist/sprite-rendering-DfQuLVXT.d.mts +30 -0
  90. package/dist/text-CIoUSRc-.d.mts +19 -0
  91. package/dist/text-HW25Qq3e.d.ts +19 -0
  92. package/dist/transform-Dqo6bY4r.d.mts +25 -0
  93. package/dist/transform-iwq8WdqR.d.ts +25 -0
  94. package/package.json +43 -0
package/dist/index.js ADDED
@@ -0,0 +1,1098 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/index.ts
22
+ var index_exports = {};
23
+ __export(index_exports, {
24
+ BLENDING_MODES: () => BLENDING_MODES,
25
+ ColorOps: () => color_exports,
26
+ DrawingOps: () => drawing_exports,
27
+ Image: () => Image,
28
+ MapRenderingOps: () => map_rendering_exports,
29
+ ShapeOps: () => shapes_exports,
30
+ SpriteRenderingOps: () => sprite_rendering_exports,
31
+ TextOps: () => text_exports,
32
+ TransformOps: () => transform_exports,
33
+ clearFontCache: () => clearFontCache,
34
+ isFontReady: () => isFontReady,
35
+ loadFont: () => loadFont
36
+ });
37
+ module.exports = __toCommonJS(index_exports);
38
+
39
+ // src/blending.ts
40
+ var BLENDING_MODES = {
41
+ normal: "source-over",
42
+ additive: "lighter"
43
+ };
44
+ var MODES = [
45
+ "source-over",
46
+ "source-in",
47
+ "source-out",
48
+ "source-atop",
49
+ "destination-over",
50
+ "destination-in",
51
+ "destination-out",
52
+ "destination-atop",
53
+ "lighter",
54
+ "copy",
55
+ "xor",
56
+ "multiply",
57
+ "screen",
58
+ "overlay",
59
+ "darken",
60
+ "lighten",
61
+ "color-dodge",
62
+ "color-burn",
63
+ "hard-light",
64
+ "soft-light",
65
+ "difference",
66
+ "exclusion",
67
+ "hue",
68
+ "saturation",
69
+ "color",
70
+ "luminosity"
71
+ ];
72
+ for (const mode of MODES) {
73
+ BLENDING_MODES[mode] = mode;
74
+ }
75
+
76
+ // src/core/color.ts
77
+ var color_exports = {};
78
+ __export(color_exports, {
79
+ setColor: () => setColor,
80
+ setLinearGradient: () => setLinearGradient,
81
+ setRadialGradient: () => setRadialGradient
82
+ });
83
+ function setColor(context, color) {
84
+ if (color == null) {
85
+ return;
86
+ }
87
+ if (typeof color === "string") {
88
+ context.fillStyle = color;
89
+ context.strokeStyle = color;
90
+ }
91
+ }
92
+ __name(setColor, "setColor");
93
+ function setLinearGradient(context, x1, y1, x2, y2, c1, c2) {
94
+ const grd = context.createLinearGradient(x1, y1, x2, y2);
95
+ grd.addColorStop(0, c1);
96
+ grd.addColorStop(1, c2);
97
+ context.fillStyle = grd;
98
+ context.strokeStyle = grd;
99
+ }
100
+ __name(setLinearGradient, "setLinearGradient");
101
+ function setRadialGradient(context, x, y, radius, c1, c2) {
102
+ const grd = context.createRadialGradient(x, y, 0, x, y, radius);
103
+ grd.addColorStop(0, c1);
104
+ grd.addColorStop(1, c2);
105
+ context.fillStyle = grd;
106
+ context.strokeStyle = grd;
107
+ }
108
+ __name(setRadialGradient, "setRadialGradient");
109
+
110
+ // src/core/context.ts
111
+ function createDefaultContextState(centered) {
112
+ if (centered) {
113
+ return {
114
+ alpha: 1,
115
+ pixelated: 1,
116
+ line_width: 1,
117
+ translation_x: 0,
118
+ translation_y: 0,
119
+ rotation: 0,
120
+ scale_x: 1,
121
+ scale_y: -1,
122
+ image_transform: true,
123
+ anchor_x: 0,
124
+ anchor_y: 0,
125
+ object_rotation: 0,
126
+ object_scale_x: 1,
127
+ object_scale_y: -1,
128
+ font: "BitCell"
129
+ };
130
+ } else {
131
+ return {
132
+ alpha: 1,
133
+ pixelated: 1,
134
+ line_width: 1,
135
+ translation_x: 0,
136
+ translation_y: 0,
137
+ rotation: 0,
138
+ scale_x: 1,
139
+ scale_y: 1,
140
+ image_transform: false,
141
+ anchor_x: -1,
142
+ anchor_y: 1,
143
+ object_rotation: 0,
144
+ object_scale_x: 1,
145
+ object_scale_y: 1,
146
+ font: "BitCell"
147
+ };
148
+ }
149
+ }
150
+ __name(createDefaultContextState, "createDefaultContextState");
151
+ function updateImageTransform(state) {
152
+ state.image_transform = state.translation_x !== 0 || state.translation_y !== 0 || state.scale_x !== 1 || state.scale_y !== 1 || state.rotation !== 0;
153
+ }
154
+ __name(updateImageTransform, "updateImageTransform");
155
+
156
+ // src/core/drawing.ts
157
+ var drawing_exports = {};
158
+ __export(drawing_exports, {
159
+ closeDrawOp: () => closeDrawOp,
160
+ drawLine: () => drawLine,
161
+ drawRect: () => drawRect,
162
+ drawRound: () => drawRound,
163
+ drawRoundRect: () => drawRoundRect,
164
+ fillRect: () => fillRect,
165
+ fillRound: () => fillRound,
166
+ fillRoundRect: () => fillRoundRect,
167
+ initDrawOp: () => initDrawOp
168
+ });
169
+ function initDrawOp(context, state, x, y, object_transform = true) {
170
+ let res = false;
171
+ if (state.image_transform) {
172
+ context.save();
173
+ res = true;
174
+ context.translate(state.translation_x, state.translation_y);
175
+ context.scale(state.scale_x, state.scale_y);
176
+ context.rotate(state.rotation / 180 * Math.PI);
177
+ context.translate(x, y);
178
+ }
179
+ if (object_transform && (state.object_rotation !== 0 || state.object_scale_x !== 1 || state.object_scale_y !== 1)) {
180
+ if (!res) {
181
+ context.save();
182
+ res = true;
183
+ context.translate(x, y);
184
+ }
185
+ if (state.object_rotation !== 0) {
186
+ context.rotate(state.object_rotation / 180 * Math.PI);
187
+ }
188
+ if (state.object_scale_x !== 1 || state.object_scale_y !== 1) {
189
+ context.scale(state.object_scale_x, state.object_scale_y);
190
+ }
191
+ }
192
+ return res;
193
+ }
194
+ __name(initDrawOp, "initDrawOp");
195
+ function closeDrawOp(context) {
196
+ context.restore();
197
+ }
198
+ __name(closeDrawOp, "closeDrawOp");
199
+ function fillRect(context, state, x, y, w, h) {
200
+ context.globalAlpha = state.alpha;
201
+ if (initDrawOp(context, state, x, y)) {
202
+ context.fillRect(-w / 2 - state.anchor_x * w / 2, -h / 2 + state.anchor_y * h / 2, w, h);
203
+ closeDrawOp(context);
204
+ } else {
205
+ context.fillRect(x - w / 2 - state.anchor_x * w / 2, y - h / 2 + state.anchor_y * h / 2, w, h);
206
+ }
207
+ }
208
+ __name(fillRect, "fillRect");
209
+ function fillRoundRect(context, state, x, y, w, h, round) {
210
+ context.globalAlpha = state.alpha;
211
+ if (initDrawOp(context, state, x, y)) {
212
+ context.fillRoundRect(-w / 2 - state.anchor_x * w / 2, -h / 2 + state.anchor_y * h / 2, w, h, round);
213
+ closeDrawOp(context);
214
+ } else {
215
+ context.fillRoundRect(x - w / 2 - state.anchor_x * w / 2, y - h / 2 + state.anchor_y * h / 2, w, h, round);
216
+ }
217
+ }
218
+ __name(fillRoundRect, "fillRoundRect");
219
+ function fillRound(context, state, x, y, w, h) {
220
+ context.globalAlpha = state.alpha;
221
+ w = Math.abs(w);
222
+ h = Math.abs(h);
223
+ if (initDrawOp(context, state, x, y)) {
224
+ context.beginPath();
225
+ context.ellipse(-state.anchor_x * w / 2, 0 + state.anchor_y * h / 2, w / 2, h / 2, 0, 0, Math.PI * 2, false);
226
+ context.fill();
227
+ closeDrawOp(context);
228
+ } else {
229
+ context.beginPath();
230
+ context.ellipse(x - state.anchor_x * w / 2, y + state.anchor_y * h / 2, w / 2, h / 2, 0, 0, Math.PI * 2, false);
231
+ context.fill();
232
+ }
233
+ }
234
+ __name(fillRound, "fillRound");
235
+ function drawRect(context, state, x, y, w, h) {
236
+ context.globalAlpha = state.alpha;
237
+ context.lineWidth = state.line_width;
238
+ if (initDrawOp(context, state, x, y)) {
239
+ context.strokeRect(-w / 2 - state.anchor_x * w / 2, -h / 2 + state.anchor_y * h / 2, w, h);
240
+ closeDrawOp(context);
241
+ } else {
242
+ context.strokeRect(x - w / 2 - state.anchor_x * w / 2, y - h / 2 + state.anchor_y * h / 2, w, h);
243
+ }
244
+ }
245
+ __name(drawRect, "drawRect");
246
+ function drawRoundRect(context, state, x, y, w, h, round) {
247
+ context.globalAlpha = state.alpha;
248
+ context.lineWidth = state.line_width;
249
+ if (initDrawOp(context, state, x, y)) {
250
+ context.strokeRoundRect(-w / 2 - state.anchor_x * w / 2, -h / 2 + state.anchor_y * h / 2, w, h, round);
251
+ closeDrawOp(context);
252
+ } else {
253
+ context.strokeRoundRect(x - w / 2 - state.anchor_x * w / 2, y - h / 2 + state.anchor_y * h / 2, w, h, round);
254
+ }
255
+ }
256
+ __name(drawRoundRect, "drawRoundRect");
257
+ function drawRound(context, state, x, y, w, h) {
258
+ context.globalAlpha = state.alpha;
259
+ context.lineWidth = state.line_width;
260
+ w = Math.abs(w);
261
+ h = Math.abs(h);
262
+ if (initDrawOp(context, state, x, y)) {
263
+ context.beginPath();
264
+ context.ellipse(0 - state.anchor_x * w / 2, 0 + state.anchor_y * h / 2, w / 2, h / 2, 0, 0, Math.PI * 2, false);
265
+ context.stroke();
266
+ closeDrawOp(context);
267
+ } else {
268
+ context.beginPath();
269
+ context.ellipse(x - state.anchor_x * w / 2, y + state.anchor_y * h / 2, w / 2, h / 2, 0, 0, Math.PI * 2, false);
270
+ context.stroke();
271
+ }
272
+ }
273
+ __name(drawRound, "drawRound");
274
+ function drawLine(context, state, x1, y1, x2, y2) {
275
+ context.globalAlpha = state.alpha;
276
+ context.lineWidth = state.line_width;
277
+ const transform = initDrawOp(context, state, 0, 0, false);
278
+ context.beginPath();
279
+ context.moveTo(x1, y1);
280
+ context.lineTo(x2, y2);
281
+ context.stroke();
282
+ if (transform) {
283
+ closeDrawOp(context);
284
+ }
285
+ }
286
+ __name(drawLine, "drawLine");
287
+
288
+ // src/core/font.ts
289
+ var loadedFonts = /* @__PURE__ */ new Set();
290
+ var loadingFonts = /* @__PURE__ */ new Map();
291
+ function loadFont(font) {
292
+ if (!font) {
293
+ return;
294
+ }
295
+ if (loadedFonts.has(font)) {
296
+ return Promise.resolve();
297
+ }
298
+ if (loadingFonts.has(font)) {
299
+ return loadingFonts.get(font);
300
+ }
301
+ if (typeof document !== "undefined" && "fonts" in document) {
302
+ const promise = document.fonts.load(`12pt ${font}`).then(() => {
303
+ loadedFonts.add(font);
304
+ loadingFonts.delete(font);
305
+ }).catch(() => {
306
+ loadedFonts.add(font);
307
+ loadingFonts.delete(font);
308
+ });
309
+ loadingFonts.set(font, promise);
310
+ return promise;
311
+ }
312
+ loadedFonts.add(font);
313
+ return Promise.resolve();
314
+ }
315
+ __name(loadFont, "loadFont");
316
+ function isFontReady(font) {
317
+ if (!font) {
318
+ return true;
319
+ }
320
+ if (loadedFonts.has(font)) {
321
+ return true;
322
+ }
323
+ if (typeof document !== "undefined" && "fonts" in document) {
324
+ return document.fonts.check(`12pt ${font}`);
325
+ }
326
+ return true;
327
+ }
328
+ __name(isFontReady, "isFontReady");
329
+ function clearFontCache() {
330
+ loadedFonts.clear();
331
+ loadingFonts.clear();
332
+ }
333
+ __name(clearFontCache, "clearFontCache");
334
+
335
+ // src/core/map-rendering.ts
336
+ var map_rendering_exports = {};
337
+ __export(map_rendering_exports, {
338
+ drawMap: () => drawMap
339
+ });
340
+ var resolveStringMap = /* @__PURE__ */ __name((name) => {
341
+ const playerRuntime = globalThis?.player?.runtime;
342
+ if (!playerRuntime) {
343
+ return null;
344
+ }
345
+ const directMaps = playerRuntime.maps;
346
+ if (directMaps && directMaps[name]) {
347
+ return directMaps[name];
348
+ }
349
+ const screenMaps = playerRuntime.screen?.runtime?.maps;
350
+ if (screenMaps && screenMaps[name]) {
351
+ return screenMaps[name];
352
+ }
353
+ return null;
354
+ }, "resolveStringMap");
355
+ function drawMap(context, state, map, x, y, w, h) {
356
+ const resolvedMap = typeof map === "string" ? resolveStringMap(map) : map ?? null;
357
+ if (!resolvedMap || !resolvedMap.ready || !resolvedMap.draw) {
358
+ return;
359
+ }
360
+ context.globalAlpha = state.alpha;
361
+ context.imageSmoothingEnabled = !state.pixelated;
362
+ if (initDrawOp(context, state, x, y)) {
363
+ resolvedMap.draw(context, -w / 2 - state.anchor_x * w / 2, -h / 2 + state.anchor_y * h / 2, w, h);
364
+ closeDrawOp(context);
365
+ } else {
366
+ resolvedMap.draw(context, x - w / 2 - state.anchor_x * w / 2, y - h / 2 + state.anchor_y * h / 2, w, h);
367
+ }
368
+ }
369
+ __name(drawMap, "drawMap");
370
+
371
+ // src/core/pixel.ts
372
+ var pixelDataCache = null;
373
+ function setRGB(context, x, y, r, g, b) {
374
+ if (pixelDataCache == null) {
375
+ pixelDataCache = context.createImageData(1, 1);
376
+ }
377
+ if (typeof r === "object") {
378
+ pixelDataCache.data[0] = r.R;
379
+ pixelDataCache.data[1] = r.G;
380
+ pixelDataCache.data[2] = r.B;
381
+ } else {
382
+ pixelDataCache.data[0] = r;
383
+ pixelDataCache.data[1] = g || 0;
384
+ pixelDataCache.data[2] = b || 0;
385
+ }
386
+ pixelDataCache.data[3] = 255;
387
+ context.putImageData(pixelDataCache, x, y);
388
+ }
389
+ __name(setRGB, "setRGB");
390
+ function setRGBA(context, x, y, r, g, b, a) {
391
+ if (pixelDataCache == null) {
392
+ pixelDataCache = context.createImageData(1, 1);
393
+ }
394
+ if (typeof r === "object") {
395
+ pixelDataCache.data[0] = r.R;
396
+ pixelDataCache.data[1] = r.G;
397
+ pixelDataCache.data[2] = r.B;
398
+ pixelDataCache.data[3] = r.A != null ? r.A : 255;
399
+ } else {
400
+ pixelDataCache.data[0] = r;
401
+ pixelDataCache.data[1] = g || 0;
402
+ pixelDataCache.data[2] = b || 0;
403
+ pixelDataCache.data[3] = a ?? 255;
404
+ }
405
+ context.putImageData(pixelDataCache, x, y);
406
+ }
407
+ __name(setRGBA, "setRGBA");
408
+ function getRGB(context, x, y, result = {
409
+ R: 0,
410
+ G: 0,
411
+ B: 0
412
+ }) {
413
+ const d = context.getImageData(x, y, 1, 1);
414
+ result.R = d.data[0];
415
+ result.G = d.data[1];
416
+ result.B = d.data[2];
417
+ return result;
418
+ }
419
+ __name(getRGB, "getRGB");
420
+ function getRGBA(context, x, y, result = {
421
+ R: 0,
422
+ G: 0,
423
+ B: 0,
424
+ A: 255
425
+ }) {
426
+ const d = context.getImageData(x, y, 1, 1);
427
+ result.R = d.data[0];
428
+ result.G = d.data[1];
429
+ result.B = d.data[2];
430
+ result.A = d.data[3];
431
+ return result;
432
+ }
433
+ __name(getRGBA, "getRGBA");
434
+
435
+ // src/core/shapes.ts
436
+ var shapes_exports = {};
437
+ __export(shapes_exports, {
438
+ drawArc: () => drawArc,
439
+ drawBezierCurve: () => drawBezierCurve,
440
+ drawPolygon: () => drawPolygon,
441
+ drawPolyline: () => drawPolyline,
442
+ drawQuadCurve: () => drawQuadCurve,
443
+ fillArc: () => fillArc,
444
+ fillPolygon: () => fillPolygon
445
+ });
446
+ function drawPolyline(context, state, args) {
447
+ if (Array.isArray(args[0])) {
448
+ args = args[0];
449
+ }
450
+ context.globalAlpha = state.alpha;
451
+ context.lineWidth = state.line_width;
452
+ if (args.length < 4) {
453
+ return;
454
+ }
455
+ const len = Math.floor(args.length / 2);
456
+ const transform = initDrawOp(context, state, 0, 0, false);
457
+ context.beginPath();
458
+ context.moveTo(args[0], args[1]);
459
+ for (let i = 1; i <= len - 1; i++) {
460
+ context.lineTo(args[i * 2], args[i * 2 + 1]);
461
+ }
462
+ context.stroke();
463
+ if (transform) {
464
+ closeDrawOp(context);
465
+ }
466
+ }
467
+ __name(drawPolyline, "drawPolyline");
468
+ function drawPolygon(context, state, args) {
469
+ if (Array.isArray(args[0])) {
470
+ args = args[0];
471
+ }
472
+ context.globalAlpha = state.alpha;
473
+ context.lineWidth = state.line_width;
474
+ if (args.length < 4) {
475
+ return;
476
+ }
477
+ const len = Math.floor(args.length / 2);
478
+ const transform = initDrawOp(context, state, 0, 0, false);
479
+ context.beginPath();
480
+ context.moveTo(args[0], args[1]);
481
+ for (let i = 1; i <= len - 1; i++) {
482
+ context.lineTo(args[i * 2], args[i * 2 + 1]);
483
+ }
484
+ context.closePath();
485
+ context.stroke();
486
+ if (transform) {
487
+ closeDrawOp(context);
488
+ }
489
+ }
490
+ __name(drawPolygon, "drawPolygon");
491
+ function fillPolygon(context, state, args) {
492
+ if (Array.isArray(args[0])) {
493
+ args = args[0];
494
+ }
495
+ context.globalAlpha = state.alpha;
496
+ if (args.length < 4) {
497
+ return;
498
+ }
499
+ const len = Math.floor(args.length / 2);
500
+ const transform = initDrawOp(context, state, 0, 0, false);
501
+ context.beginPath();
502
+ context.moveTo(args[0], args[1]);
503
+ for (let i = 1; i <= len - 1; i++) {
504
+ context.lineTo(args[i * 2], args[i * 2 + 1]);
505
+ }
506
+ context.fill();
507
+ if (transform) {
508
+ closeDrawOp(context);
509
+ }
510
+ }
511
+ __name(fillPolygon, "fillPolygon");
512
+ function drawQuadCurve(context, state, args) {
513
+ if (Array.isArray(args[0])) {
514
+ args = args[0];
515
+ }
516
+ context.globalAlpha = state.alpha;
517
+ context.lineWidth = state.line_width;
518
+ if (args.length < 4) {
519
+ return;
520
+ }
521
+ const transform = initDrawOp(context, state, 0, 0, false);
522
+ context.beginPath();
523
+ context.moveTo(args[0], args[1]);
524
+ let index = 2;
525
+ while (index <= args.length - 4) {
526
+ context.quadraticCurveTo(args[index], args[index + 1], args[index + 2], args[index + 3]);
527
+ index += 4;
528
+ }
529
+ context.stroke();
530
+ if (transform) {
531
+ closeDrawOp(context);
532
+ }
533
+ }
534
+ __name(drawQuadCurve, "drawQuadCurve");
535
+ function drawBezierCurve(context, state, args) {
536
+ if (Array.isArray(args[0])) {
537
+ args = args[0];
538
+ }
539
+ context.globalAlpha = state.alpha;
540
+ context.lineWidth = state.line_width;
541
+ if (args.length < 4) {
542
+ return;
543
+ }
544
+ const transform = initDrawOp(context, state, 0, 0, false);
545
+ context.beginPath();
546
+ context.moveTo(args[0], args[1]);
547
+ let index = 2;
548
+ while (index <= args.length - 6) {
549
+ context.bezierCurveTo(args[index], args[index + 1], args[index + 2], args[index + 3], args[index + 4], args[index + 5]);
550
+ index += 6;
551
+ }
552
+ context.stroke();
553
+ if (transform) {
554
+ closeDrawOp(context);
555
+ }
556
+ }
557
+ __name(drawBezierCurve, "drawBezierCurve");
558
+ function drawArc(context, state, x, y, radius, angle1, angle2, ccw) {
559
+ context.globalAlpha = state.alpha;
560
+ context.lineWidth = state.line_width;
561
+ if (initDrawOp(context, state, x, y)) {
562
+ context.beginPath();
563
+ context.arc(0, 0, radius, angle1 / 180 * Math.PI, angle2 / 180 * Math.PI, ccw);
564
+ context.stroke();
565
+ closeDrawOp(context);
566
+ } else {
567
+ context.beginPath();
568
+ context.arc(x, y, radius, angle1 / 180 * Math.PI, angle2 / 180 * Math.PI, ccw);
569
+ context.stroke();
570
+ }
571
+ }
572
+ __name(drawArc, "drawArc");
573
+ function fillArc(context, state, x, y, radius, angle1, angle2, ccw) {
574
+ context.globalAlpha = state.alpha;
575
+ if (initDrawOp(context, state, x, y)) {
576
+ context.beginPath();
577
+ context.arc(0, 0, radius, angle1 / 180 * Math.PI, angle2 / 180 * Math.PI, ccw);
578
+ context.fill();
579
+ closeDrawOp(context);
580
+ } else {
581
+ context.beginPath();
582
+ context.arc(x, y, radius, angle1 / 180 * Math.PI, angle2 / 180 * Math.PI, ccw);
583
+ context.fill();
584
+ }
585
+ }
586
+ __name(fillArc, "fillArc");
587
+
588
+ // src/core/sprite-rendering.ts
589
+ var sprite_rendering_exports = {};
590
+ __export(sprite_rendering_exports, {
591
+ drawSprite: () => drawSprite,
592
+ drawSpritePart: () => drawSpritePart,
593
+ getSpriteFrame: () => getSpriteFrame
594
+ });
595
+ function getSpriteFrame(sprite) {
596
+ if (typeof sprite === "object" && "canvas" in sprite && !("frames" in sprite)) {
597
+ return sprite.canvas || sprite.image || null;
598
+ }
599
+ if (typeof sprite === "object" && sprite.frames && sprite.frames.length > 0) {
600
+ if (!sprite.ready) {
601
+ return null;
602
+ }
603
+ if (sprite.frames.length > 1) {
604
+ if (!sprite.animation_start || sprite.animation_start === 0) {
605
+ sprite.animation_start = Date.now();
606
+ }
607
+ const dt = 1e3 / (sprite.fps || 5);
608
+ const frame = Math.floor((Date.now() - sprite.animation_start) / dt) % sprite.frames.length;
609
+ if (frame >= 0 && frame < sprite.frames.length) {
610
+ return sprite.frames[frame].canvas;
611
+ }
612
+ return sprite.frames[0].canvas;
613
+ }
614
+ return sprite.frames[0].canvas;
615
+ }
616
+ return null;
617
+ }
618
+ __name(getSpriteFrame, "getSpriteFrame");
619
+ function drawSprite(context, state, sprite, x, y, w, h) {
620
+ const canvas = getSpriteFrame(sprite);
621
+ if (canvas == null) {
622
+ return;
623
+ }
624
+ if (w == null) {
625
+ w = canvas.width;
626
+ }
627
+ if (!h) {
628
+ h = w / canvas.width * canvas.height;
629
+ }
630
+ context.globalAlpha = state.alpha;
631
+ context.imageSmoothingEnabled = !state.pixelated;
632
+ if (initDrawOp(context, state, x, y)) {
633
+ context.drawImage(canvas, -w / 2 - state.anchor_x * w / 2, -h / 2 + state.anchor_y * h / 2, w, h);
634
+ closeDrawOp(context);
635
+ } else {
636
+ context.drawImage(canvas, x - w / 2 - state.anchor_x * w / 2, y - h / 2 + state.anchor_y * h / 2, w, h);
637
+ }
638
+ }
639
+ __name(drawSprite, "drawSprite");
640
+ function drawSpritePart(context, state, sprite, sx, sy, sw, sh, x, y, w, h) {
641
+ const canvas = getSpriteFrame(sprite);
642
+ if (canvas == null) {
643
+ return;
644
+ }
645
+ if (w == null) {
646
+ w = canvas.width;
647
+ }
648
+ if (!h) {
649
+ h = w / sw * sh;
650
+ }
651
+ context.globalAlpha = state.alpha;
652
+ context.imageSmoothingEnabled = !state.pixelated;
653
+ if (initDrawOp(context, state, x, y)) {
654
+ context.drawImage(canvas, sx, sy, sw, sh, -w / 2 - state.anchor_x * w / 2, -h / 2 + state.anchor_y * h / 2, w, h);
655
+ closeDrawOp(context);
656
+ } else {
657
+ context.drawImage(canvas, sx, sy, sw, sh, x - w / 2 - state.anchor_x * w / 2, y - h / 2 + state.anchor_y * h / 2, w, h);
658
+ }
659
+ }
660
+ __name(drawSpritePart, "drawSpritePart");
661
+
662
+ // src/core/text.ts
663
+ var text_exports = {};
664
+ __export(text_exports, {
665
+ drawText: () => drawText,
666
+ drawTextOutline: () => drawTextOutline,
667
+ textWidth: () => textWidth
668
+ });
669
+ function textWidth(context, state, text, size) {
670
+ context.font = `${size}pt ${state.font}`;
671
+ return context.measureText(text).width;
672
+ }
673
+ __name(textWidth, "textWidth");
674
+ function drawText(context, state, text, x, y, size) {
675
+ context.globalAlpha = state.alpha;
676
+ context.font = `${size}pt ${state.font}`;
677
+ context.textAlign = "center";
678
+ context.textBaseline = "middle";
679
+ const w = context.measureText(text).width;
680
+ const h = size;
681
+ if (initDrawOp(context, state, x, y)) {
682
+ context.fillText(text, 0 - state.anchor_x * w / 2, 0 + state.anchor_y * h / 2);
683
+ closeDrawOp(context);
684
+ } else {
685
+ context.fillText(text, x - state.anchor_x * w / 2, y + state.anchor_y * h / 2);
686
+ }
687
+ }
688
+ __name(drawText, "drawText");
689
+ function drawTextOutline(context, state, text, x, y, size) {
690
+ context.globalAlpha = state.alpha;
691
+ context.font = `${size}pt ${state.font}`;
692
+ context.lineWidth = state.line_width;
693
+ context.textAlign = "center";
694
+ context.textBaseline = "middle";
695
+ const w = context.measureText(text).width;
696
+ const h = size;
697
+ if (initDrawOp(context, state, x, y)) {
698
+ context.strokeText(text, 0 - state.anchor_x * w / 2, 0 + state.anchor_y * h / 2);
699
+ closeDrawOp(context);
700
+ } else {
701
+ context.strokeText(text, x - state.anchor_x * w / 2, y + state.anchor_y * h / 2);
702
+ }
703
+ }
704
+ __name(drawTextOutline, "drawTextOutline");
705
+
706
+ // src/core/transform.ts
707
+ var transform_exports = {};
708
+ __export(transform_exports, {
709
+ setDrawAnchor: () => setDrawAnchor,
710
+ setDrawRotation: () => setDrawRotation,
711
+ setDrawScale: () => setDrawScale,
712
+ setRotation: () => setRotation,
713
+ setScale: () => setScale,
714
+ setTranslation: () => setTranslation
715
+ });
716
+ function setTranslation(state, translation_x, translation_y) {
717
+ state.translation_x = translation_x;
718
+ state.translation_y = translation_y;
719
+ if (!isFinite(state.translation_x)) {
720
+ state.translation_x = 0;
721
+ }
722
+ if (!isFinite(state.translation_y)) {
723
+ state.translation_y = 0;
724
+ }
725
+ updateImageTransform(state);
726
+ }
727
+ __name(setTranslation, "setTranslation");
728
+ function setScale(state, scale_x, scale_y) {
729
+ state.scale_x = scale_x;
730
+ state.scale_y = scale_y;
731
+ if (!isFinite(state.scale_x) || state.scale_x === 0) {
732
+ state.scale_x = 1;
733
+ }
734
+ if (!isFinite(state.scale_y) || state.scale_y === 0) {
735
+ state.scale_y = 1;
736
+ }
737
+ updateImageTransform(state);
738
+ }
739
+ __name(setScale, "setScale");
740
+ function setRotation(state, rotation) {
741
+ state.rotation = rotation;
742
+ if (!isFinite(state.rotation)) {
743
+ state.rotation = 0;
744
+ }
745
+ updateImageTransform(state);
746
+ }
747
+ __name(setRotation, "setRotation");
748
+ function setDrawAnchor(state, anchor_x, anchor_y) {
749
+ state.anchor_x = anchor_x;
750
+ state.anchor_y = anchor_y;
751
+ if (typeof state.anchor_x !== "number") {
752
+ state.anchor_x = 0;
753
+ }
754
+ if (typeof state.anchor_y !== "number") {
755
+ state.anchor_y = 0;
756
+ }
757
+ }
758
+ __name(setDrawAnchor, "setDrawAnchor");
759
+ function setDrawRotation(state, object_rotation) {
760
+ state.object_rotation = object_rotation;
761
+ }
762
+ __name(setDrawRotation, "setDrawRotation");
763
+ function setDrawScale(state, object_scale_x, object_scale_y) {
764
+ state.object_scale_x = object_scale_x;
765
+ state.object_scale_y = object_scale_y;
766
+ }
767
+ __name(setDrawScale, "setDrawScale");
768
+
769
+ // src/core/image.ts
770
+ function splitColorArg(args) {
771
+ if (args.length > 0 && args.length % 2 === 1 && typeof args[args.length - 1] === "string") {
772
+ return {
773
+ points: args.slice(0, -1),
774
+ color: args[args.length - 1]
775
+ };
776
+ }
777
+ return {
778
+ points: args,
779
+ color: void 0
780
+ };
781
+ }
782
+ __name(splitColorArg, "splitColorArg");
783
+ var Image = class {
784
+ static {
785
+ __name(this, "Image");
786
+ }
787
+ _canvas;
788
+ _context = null;
789
+ _image = null;
790
+ _state;
791
+ _centered;
792
+ width;
793
+ height;
794
+ constructor(widthOrImage, height, centered = false) {
795
+ this._centered = centered;
796
+ if (typeof widthOrImage === "object" && "naturalWidth" in widthOrImage) {
797
+ this._image = widthOrImage;
798
+ this.width = this._image.width;
799
+ this.height = this._image.height;
800
+ } else if (typeof widthOrImage === "object" && "getContext" in widthOrImage) {
801
+ this._canvas = widthOrImage;
802
+ this.width = this._canvas.width;
803
+ this.height = this._canvas.height;
804
+ } else {
805
+ this._canvas = document.createElement("canvas");
806
+ this.width = Math.round(widthOrImage);
807
+ this.height = Math.round(height || widthOrImage);
808
+ this._canvas.width = this.width;
809
+ this._canvas.height = this.height;
810
+ }
811
+ }
812
+ /**
813
+ * Initialize or get the canvas context
814
+ * Matches msImage initContext behavior exactly
815
+ */
816
+ initContext() {
817
+ if (this._context) {
818
+ return this._context;
819
+ }
820
+ if (!this._canvas && this._image) {
821
+ this._canvas = document.createElement("canvas");
822
+ this._canvas.width = this._image.width;
823
+ this._canvas.height = this._image.height;
824
+ this._context = this._canvas.getContext("2d");
825
+ this._context.drawImage(this._image, 0, 0);
826
+ this._image = null;
827
+ }
828
+ this._context = this._canvas.getContext("2d");
829
+ if (this._context) {
830
+ this._context.lineCap = "round";
831
+ }
832
+ if (!this._state) {
833
+ this._state = createDefaultContextState(this._centered);
834
+ if (this._centered) {
835
+ this._state.translation_x = this.width / 2;
836
+ this._state.translation_y = this.height / 2;
837
+ }
838
+ }
839
+ return this._context;
840
+ }
841
+ /**
842
+ * Get the canvas element
843
+ */
844
+ get canvas() {
845
+ this.initContext();
846
+ return this._canvas;
847
+ }
848
+ /**
849
+ * Get the image element (if still available)
850
+ */
851
+ get image() {
852
+ return this._image;
853
+ }
854
+ /**
855
+ * Get the rendering context
856
+ */
857
+ get context() {
858
+ return this._context;
859
+ }
860
+ // ===== PIXEL OPERATIONS =====
861
+ setRGB(x, y, r, g, b) {
862
+ this.initContext();
863
+ setRGB(this._context, x, y, r, g, b);
864
+ }
865
+ setRGBA(x, y, r, g, b, a) {
866
+ this.initContext();
867
+ setRGBA(this._context, x, y, r, g, b, a);
868
+ }
869
+ getRGB(x, y, result) {
870
+ this.initContext();
871
+ return getRGB(this._context, x, y, result);
872
+ }
873
+ getRGBA(x, y, result) {
874
+ this.initContext();
875
+ return getRGBA(this._context, x, y, result);
876
+ }
877
+ // ===== CANVAS OPERATIONS =====
878
+ clear(color) {
879
+ this.initContext();
880
+ const c = this._context.fillStyle;
881
+ const s = this._context.strokeStyle;
882
+ const blending_save = this._context.globalCompositeOperation;
883
+ this._context.globalAlpha = 1;
884
+ this._context.globalCompositeOperation = "source-over";
885
+ if (color != null) {
886
+ this.setColor(color);
887
+ } else {
888
+ this._context.fillStyle = "#000";
889
+ }
890
+ this._context.fillRect(0, 0, this.width, this.height);
891
+ this._context.fillStyle = c;
892
+ this._context.strokeStyle = s;
893
+ this._context.globalCompositeOperation = blending_save;
894
+ }
895
+ // ===== COLOR OPERATIONS =====
896
+ setColor(color) {
897
+ this.initContext();
898
+ setColor(this._context, color);
899
+ }
900
+ setAlpha(alpha) {
901
+ this.initContext();
902
+ this._state.alpha = alpha;
903
+ }
904
+ setPixelated(pixelated) {
905
+ this.initContext();
906
+ this._state.pixelated = pixelated;
907
+ }
908
+ setBlending(blending) {
909
+ this.initContext();
910
+ const mode = BLENDING_MODES[blending || "normal"] || "source-over";
911
+ this._context.globalCompositeOperation = mode;
912
+ }
913
+ setLineWidth(line_width) {
914
+ this.initContext();
915
+ this._state.line_width = line_width;
916
+ }
917
+ setLineDash(dash) {
918
+ this.initContext();
919
+ if (!Array.isArray(dash)) {
920
+ this._context.setLineDash([]);
921
+ } else {
922
+ this._context.setLineDash(dash);
923
+ }
924
+ }
925
+ setLinearGradient(x1, y1, x2, y2, c1, c2) {
926
+ this.initContext();
927
+ setLinearGradient(this._context, x1, y1, x2, y2, c1, c2);
928
+ }
929
+ setRadialGradient(x, y, radius, c1, c2) {
930
+ this.initContext();
931
+ setRadialGradient(this._context, x, y, radius, c1, c2);
932
+ }
933
+ // ===== FONT OPERATIONS =====
934
+ setFont(font) {
935
+ this.initContext();
936
+ this._state.font = font || "Verdana";
937
+ this.loadFont(this._state.font);
938
+ }
939
+ loadFont(font) {
940
+ return loadFont(font);
941
+ }
942
+ isFontReady(font) {
943
+ return isFontReady(font || this._state?.font || "Verdana");
944
+ }
945
+ // ===== TRANSFORM OPERATIONS =====
946
+ setTranslation(translation_x, translation_y) {
947
+ this.initContext();
948
+ setTranslation(this._state, translation_x, translation_y);
949
+ }
950
+ setScale(scale_x, scale_y) {
951
+ this.initContext();
952
+ setScale(this._state, scale_x, scale_y);
953
+ }
954
+ setRotation(rotation) {
955
+ this.initContext();
956
+ setRotation(this._state, rotation);
957
+ }
958
+ setDrawAnchor(anchor_x, anchor_y) {
959
+ this.initContext();
960
+ setDrawAnchor(this._state, anchor_x, anchor_y);
961
+ }
962
+ setDrawRotation(object_rotation) {
963
+ this.initContext();
964
+ setDrawRotation(this._state, object_rotation);
965
+ }
966
+ setDrawScale(object_scale_x, object_scale_y = object_scale_x) {
967
+ this.initContext();
968
+ setDrawScale(this._state, object_scale_x, object_scale_y);
969
+ }
970
+ // ===== DRAWING OPERATIONS =====
971
+ fillRect(x, y, w, h, color) {
972
+ this.initContext();
973
+ this.setColor(color);
974
+ fillRect(this._context, this._state, x, y, w, h);
975
+ }
976
+ fillRoundRect(x, y, w, h, round = 10, color) {
977
+ this.initContext();
978
+ this.setColor(color);
979
+ fillRoundRect(this._context, this._state, x, y, w, h, round);
980
+ }
981
+ fillRound(x, y, w, h, color) {
982
+ this.initContext();
983
+ this.setColor(color);
984
+ fillRound(this._context, this._state, x, y, w, h);
985
+ }
986
+ drawRect(x, y, w, h, color) {
987
+ this.initContext();
988
+ this.setColor(color);
989
+ drawRect(this._context, this._state, x, y, w, h);
990
+ }
991
+ drawRoundRect(x, y, w, h, round = 10, color) {
992
+ this.initContext();
993
+ this.setColor(color);
994
+ drawRoundRect(this._context, this._state, x, y, w, h, round);
995
+ }
996
+ drawRound(x, y, w, h, color) {
997
+ this.initContext();
998
+ this.setColor(color);
999
+ drawRound(this._context, this._state, x, y, w, h);
1000
+ }
1001
+ drawLine(x1, y1, x2, y2, color) {
1002
+ this.initContext();
1003
+ this.setColor(color);
1004
+ drawLine(this._context, this._state, x1, y1, x2, y2);
1005
+ }
1006
+ // ===== SHAPE OPERATIONS =====
1007
+ drawPolyline(...args) {
1008
+ this.initContext();
1009
+ const { points, color } = splitColorArg(args);
1010
+ this.setColor(color);
1011
+ drawPolyline(this._context, this._state, points);
1012
+ }
1013
+ drawPolygon(...args) {
1014
+ this.initContext();
1015
+ const { points, color } = splitColorArg(args);
1016
+ this.setColor(color);
1017
+ drawPolygon(this._context, this._state, points);
1018
+ }
1019
+ fillPolygon(...args) {
1020
+ this.initContext();
1021
+ const { points, color } = splitColorArg(args);
1022
+ this.setColor(color);
1023
+ fillPolygon(this._context, this._state, points);
1024
+ }
1025
+ drawQuadCurve(...args) {
1026
+ this.initContext();
1027
+ const { points, color } = splitColorArg(args);
1028
+ this.setColor(color);
1029
+ drawQuadCurve(this._context, this._state, points);
1030
+ }
1031
+ drawBezierCurve(...args) {
1032
+ this.initContext();
1033
+ const { points, color } = splitColorArg(args);
1034
+ this.setColor(color);
1035
+ drawBezierCurve(this._context, this._state, points);
1036
+ }
1037
+ drawArc(x, y, radius, angle1, angle2, ccw, color) {
1038
+ this.initContext();
1039
+ this.setColor(color);
1040
+ drawArc(this._context, this._state, x, y, radius, angle1, angle2, ccw);
1041
+ }
1042
+ fillArc(x, y, radius, angle1, angle2, ccw, color) {
1043
+ this.initContext();
1044
+ this.setColor(color);
1045
+ fillArc(this._context, this._state, x, y, radius, angle1, angle2, ccw);
1046
+ }
1047
+ // ===== TEXT OPERATIONS =====
1048
+ textWidth(text, size) {
1049
+ this.initContext();
1050
+ return textWidth(this._context, this._state, text, size);
1051
+ }
1052
+ drawText(text, x, y, size, color) {
1053
+ this.initContext();
1054
+ this.setColor(color);
1055
+ drawText(this._context, this._state, text, x, y, size);
1056
+ }
1057
+ drawTextOutline(text, x, y, size, color) {
1058
+ this.initContext();
1059
+ this.setColor(color);
1060
+ drawTextOutline(this._context, this._state, text, x, y, size);
1061
+ }
1062
+ // ===== SPRITE RENDERING =====
1063
+ drawSprite(sprite, x, y, w, h) {
1064
+ this.initContext();
1065
+ drawSprite(this._context, this._state, sprite, x, y, w, h);
1066
+ }
1067
+ drawImage(sprite, x, y, w, h) {
1068
+ this.drawSprite(sprite, x, y, w, h);
1069
+ }
1070
+ drawSpritePart(sprite, sx, sy, sw, sh, x, y, w, h) {
1071
+ this.initContext();
1072
+ drawSpritePart(this._context, this._state, sprite, sx, sy, sw, sh, x, y, w, h);
1073
+ }
1074
+ drawImagePart(sprite, sx, sy, sw, sh, x, y, w, h) {
1075
+ this.drawSpritePart(sprite, sx, sy, sw, sh, x, y, w, h);
1076
+ }
1077
+ // ===== MAP RENDERING =====
1078
+ drawMap(map, x, y, w, h) {
1079
+ this.initContext();
1080
+ drawMap(this._context, this._state, map, x, y, w, h);
1081
+ }
1082
+ };
1083
+ // Annotate the CommonJS export names for ESM import in node:
1084
+ 0 && (module.exports = {
1085
+ BLENDING_MODES,
1086
+ ColorOps,
1087
+ DrawingOps,
1088
+ Image,
1089
+ MapRenderingOps,
1090
+ ShapeOps,
1091
+ SpriteRenderingOps,
1092
+ TextOps,
1093
+ TransformOps,
1094
+ clearFontCache,
1095
+ isFontReady,
1096
+ loadFont
1097
+ });
1098
+ //# sourceMappingURL=index.js.map