like2d 1.0.0 → 2.0.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 (96) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +67 -43
  3. package/dist/adapters/callback/index.d.ts +43 -0
  4. package/dist/adapters/callback/index.d.ts.map +1 -0
  5. package/dist/adapters/callback/index.js +80 -0
  6. package/dist/adapters/scene/index.d.ts +42 -0
  7. package/dist/adapters/scene/index.d.ts.map +1 -0
  8. package/dist/adapters/scene/index.js +112 -0
  9. package/dist/adapters/scene/scene.d.ts +18 -0
  10. package/dist/adapters/scene/scene.d.ts.map +1 -0
  11. package/dist/adapters/scene/startup-scene.d.ts +17 -0
  12. package/dist/adapters/scene/startup-scene.d.ts.map +1 -0
  13. package/dist/adapters/scene/startup-scene.js +41 -0
  14. package/dist/core/audio.d.ts +61 -0
  15. package/dist/core/audio.d.ts.map +1 -0
  16. package/dist/core/audio.js +226 -0
  17. package/dist/core/canvas-config.d.ts +22 -0
  18. package/dist/core/canvas-config.d.ts.map +1 -0
  19. package/dist/core/canvas-config.js +14 -0
  20. package/dist/core/canvas-manager.d.ts +26 -0
  21. package/dist/core/canvas-manager.d.ts.map +1 -0
  22. package/dist/core/canvas-manager.js +197 -0
  23. package/dist/core/events.d.ts +52 -0
  24. package/dist/core/events.d.ts.map +1 -0
  25. package/dist/core/gamepad-button-map.d.ts.map +1 -0
  26. package/dist/core/gamepad-buttons.d.ts +23 -0
  27. package/dist/core/gamepad-buttons.d.ts.map +1 -0
  28. package/dist/core/gamepad-buttons.js +36 -0
  29. package/dist/core/gamepad-db.d.ts.map +1 -0
  30. package/dist/{gamepad-mapping.d.ts → core/gamepad-mapping.d.ts} +3 -15
  31. package/dist/core/gamepad-mapping.d.ts.map +1 -0
  32. package/dist/core/gamepad-mapping.js +223 -0
  33. package/dist/{gamepad.d.ts → core/gamepad.d.ts} +22 -17
  34. package/dist/core/gamepad.d.ts.map +1 -0
  35. package/dist/{gamepad.js → core/gamepad.js} +91 -70
  36. package/dist/{graphics.d.ts → core/graphics.d.ts} +2 -8
  37. package/dist/core/graphics.d.ts.map +1 -0
  38. package/dist/{graphics.js → core/graphics.js} +4 -41
  39. package/dist/core/input-state.d.ts.map +1 -0
  40. package/dist/{input.d.ts → core/input.d.ts} +11 -14
  41. package/dist/core/input.d.ts.map +1 -0
  42. package/dist/{input.js → core/input.js} +31 -41
  43. package/dist/core/keyboard.d.ts +15 -0
  44. package/dist/core/keyboard.d.ts.map +1 -0
  45. package/dist/core/keyboard.js +70 -0
  46. package/dist/core/mouse.d.ts +29 -0
  47. package/dist/core/mouse.d.ts.map +1 -0
  48. package/dist/core/mouse.js +130 -0
  49. package/dist/{rect.d.ts → core/rect.d.ts} +1 -2
  50. package/dist/core/rect.d.ts.map +1 -0
  51. package/dist/{rect.js → core/rect.js} +24 -28
  52. package/dist/{timer.d.ts → core/timer.d.ts} +0 -1
  53. package/dist/core/timer.d.ts.map +1 -0
  54. package/dist/{timer.js → core/timer.js} +0 -1
  55. package/dist/{vector2.d.ts → core/vector2.d.ts} +4 -10
  56. package/dist/core/vector2.d.ts.map +1 -0
  57. package/dist/{vector2.js → core/vector2.js} +40 -40
  58. package/dist/engine.d.ts +42 -0
  59. package/dist/engine.d.ts.map +1 -0
  60. package/dist/engine.js +154 -0
  61. package/dist/index.d.ts +38 -44
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +24 -250
  64. package/package.json +8 -23
  65. package/dist/audio.d.ts +0 -52
  66. package/dist/audio.d.ts.map +0 -1
  67. package/dist/audio.js +0 -250
  68. package/dist/events.d.ts +0 -36
  69. package/dist/events.d.ts.map +0 -1
  70. package/dist/gamepad-button-map.d.ts.map +0 -1
  71. package/dist/gamepad-db.d.ts.map +0 -1
  72. package/dist/gamepad-mapping.d.ts.map +0 -1
  73. package/dist/gamepad-mapping.js +0 -191
  74. package/dist/gamepad.d.ts.map +0 -1
  75. package/dist/graphics.d.ts.map +0 -1
  76. package/dist/input-state.d.ts.map +0 -1
  77. package/dist/input.d.ts.map +0 -1
  78. package/dist/keyboard.d.ts +0 -9
  79. package/dist/keyboard.d.ts.map +0 -1
  80. package/dist/keyboard.js +0 -33
  81. package/dist/mouse.d.ts +0 -20
  82. package/dist/mouse.d.ts.map +0 -1
  83. package/dist/mouse.js +0 -84
  84. package/dist/rect.d.ts.map +0 -1
  85. package/dist/scene.d.ts +0 -10
  86. package/dist/scene.d.ts.map +0 -1
  87. package/dist/timer.d.ts.map +0 -1
  88. package/dist/vector2.d.ts.map +0 -1
  89. /package/dist/{scene.js → adapters/scene/scene.js} +0 -0
  90. /package/dist/{events.js → core/events.js} +0 -0
  91. /package/dist/{gamepad-button-map.d.ts → core/gamepad-button-map.d.ts} +0 -0
  92. /package/dist/{gamepad-button-map.js → core/gamepad-button-map.js} +0 -0
  93. /package/dist/{gamepad-db.d.ts → core/gamepad-db.d.ts} +0 -0
  94. /package/dist/{gamepad-db.js → core/gamepad-db.js} +0 -0
  95. /package/dist/{input-state.d.ts → core/input-state.d.ts} +0 -0
  96. /package/dist/{input-state.js → core/input-state.js} +0 -0
@@ -1,105 +1,105 @@
1
- export var V2;
2
- (function (V2) {
1
+ export var Vec2;
2
+ (function (Vec2) {
3
3
  function add(a, b) {
4
4
  return [a[0] + b[0], a[1] + b[1]];
5
5
  }
6
- V2.add = add;
6
+ Vec2.add = add;
7
7
  function sub(a, b) {
8
8
  return [a[0] - b[0], a[1] - b[1]];
9
9
  }
10
- V2.sub = sub;
11
- function mul(v, s) {
12
- return [v[0] * s, v[1] * s];
13
- }
14
- V2.mul = mul;
15
- function div(v, s) {
16
- return [v[0] / s, v[1] / s];
17
- }
18
- V2.div = div;
10
+ Vec2.sub = sub;
11
+ function mul(v, other) {
12
+ if (typeof other === 'number') {
13
+ return [v[0] * other, v[1] * other];
14
+ }
15
+ return [v[0] * other[0], v[1] * other[1]];
16
+ }
17
+ Vec2.mul = mul;
18
+ function div(v, other) {
19
+ if (typeof other === 'number') {
20
+ return [v[0] / other, v[1] / other];
21
+ }
22
+ return [v[0] / other[0], v[1] / other[1]];
23
+ }
24
+ Vec2.div = div;
19
25
  function dot(a, b) {
20
26
  return a[0] * b[0] + a[1] * b[1];
21
27
  }
22
- V2.dot = dot;
28
+ Vec2.dot = dot;
23
29
  function cross(a, b) {
24
30
  return a[0] * b[1] - a[1] * b[0];
25
31
  }
26
- V2.cross = cross;
32
+ Vec2.cross = cross;
27
33
  function lengthSq(v) {
28
34
  return v[0] * v[0] + v[1] * v[1];
29
35
  }
30
- V2.lengthSq = lengthSq;
36
+ Vec2.lengthSq = lengthSq;
31
37
  function length(v) {
32
38
  return Math.sqrt(lengthSq(v));
33
39
  }
34
- V2.length = length;
40
+ Vec2.length = length;
35
41
  function normalize(v) {
36
42
  const len = length(v);
37
43
  if (len === 0)
38
44
  return [0, 0];
39
45
  return div(v, len);
40
46
  }
41
- V2.normalize = normalize;
47
+ Vec2.normalize = normalize;
42
48
  function distance(a, b) {
43
49
  return length(sub(a, b));
44
50
  }
45
- V2.distance = distance;
51
+ Vec2.distance = distance;
46
52
  function lerp(a, b, t) {
47
53
  return [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t];
48
54
  }
49
- V2.lerp = lerp;
55
+ Vec2.lerp = lerp;
50
56
  function angle(v) {
51
57
  return Math.atan2(v[1], v[0]);
52
58
  }
53
- V2.angle = angle;
59
+ Vec2.angle = angle;
54
60
  function rotate(v, angle) {
55
61
  const cos = Math.cos(angle);
56
62
  const sin = Math.sin(angle);
57
63
  return [v[0] * cos - v[1] * sin, v[0] * sin + v[1] * cos];
58
64
  }
59
- V2.rotate = rotate;
60
- function perpendicular(v) {
61
- return [-v[1], v[0]];
62
- }
63
- V2.perpendicular = perpendicular;
65
+ Vec2.rotate = rotate;
64
66
  function negate(v) {
65
67
  return [-v[0], -v[1]];
66
68
  }
67
- V2.negate = negate;
69
+ Vec2.negate = negate;
68
70
  function floor(v) {
69
71
  return [Math.floor(v[0]), Math.floor(v[1])];
70
72
  }
71
- V2.floor = floor;
73
+ Vec2.floor = floor;
72
74
  function ceil(v) {
73
75
  return [Math.ceil(v[0]), Math.ceil(v[1])];
74
76
  }
75
- V2.ceil = ceil;
77
+ Vec2.ceil = ceil;
76
78
  function round(v) {
77
79
  return [Math.round(v[0]), Math.round(v[1])];
78
80
  }
79
- V2.round = round;
81
+ Vec2.round = round;
80
82
  function min(a, b) {
81
83
  return [Math.min(a[0], b[0]), Math.min(a[1], b[1])];
82
84
  }
83
- V2.min = min;
85
+ Vec2.min = min;
84
86
  function max(a, b) {
85
87
  return [Math.max(a[0], b[0]), Math.max(a[1], b[1])];
86
88
  }
87
- V2.max = max;
89
+ Vec2.max = max;
88
90
  function clamp(v, min, max) {
89
91
  return [
90
92
  Math.max(min[0], Math.min(v[0], max[0])),
91
93
  Math.max(min[1], Math.min(v[1], max[1])),
92
94
  ];
93
95
  }
94
- V2.clamp = clamp;
96
+ Vec2.clamp = clamp;
95
97
  function fromAngle(angle, len = 1) {
96
98
  return [Math.cos(angle) * len, Math.sin(angle) * len];
97
99
  }
98
- V2.fromAngle = fromAngle;
99
- V2.zero = [0, 0];
100
- V2.one = [1, 1];
101
- V2.up = [0, -1];
102
- V2.down = [0, 1];
103
- V2.left = [-1, 0];
104
- V2.right = [1, 0];
105
- })(V2 || (V2 = {}));
100
+ Vec2.fromAngle = fromAngle;
101
+ function zero() {
102
+ return [0, 0];
103
+ }
104
+ Vec2.zero = zero;
105
+ })(Vec2 || (Vec2 = {}));
@@ -0,0 +1,42 @@
1
+ import type { Graphics } from './core/graphics';
2
+ import type { Audio } from './core/audio';
3
+ import type { Input } from './core/input';
4
+ import type { Timer } from './core/timer';
5
+ import type { Keyboard } from './core/keyboard';
6
+ import type { Mouse } from './core/mouse';
7
+ import type { Gamepad } from './core/gamepad';
8
+ import type { Like2DEvent } from './core/events';
9
+ import type { CanvasConfig } from './core/canvas-config';
10
+ export type EngineDeps = {
11
+ graphics: Graphics;
12
+ input: Input;
13
+ timer: Timer;
14
+ audio: Audio;
15
+ keyboard: Keyboard;
16
+ mouse: Mouse;
17
+ gamepad: Gamepad;
18
+ };
19
+ export declare class Engine {
20
+ private canvas;
21
+ private ctx;
22
+ private deps;
23
+ private isRunning;
24
+ private lastTime;
25
+ private container;
26
+ private canvasManager;
27
+ private onEvent;
28
+ constructor(container: HTMLElement);
29
+ setScaling(config: CanvasConfig): void;
30
+ setDeps(deps: EngineDeps): void;
31
+ dispose(): void;
32
+ private dispatchEvent;
33
+ start(onEvent: (event: Like2DEvent) => void): void;
34
+ stop(): void;
35
+ setSize(width: number, height: number): void;
36
+ getTime(): number;
37
+ getCanvas(): HTMLCanvasElement;
38
+ getContext(): CanvasRenderingContext2D;
39
+ transformMousePosition(cssX: number, cssY: number): [number, number];
40
+ toggleFullscreen(): void;
41
+ }
42
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,GAAG,CAA2B;IACtC,OAAO,CAAC,IAAI,CAA2B;IACvC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,OAAO,CAA+C;gBAElD,SAAS,EAAE,WAAW;IAmBlC,UAAU,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAItC,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAI/B,OAAO,IAAI,IAAI;IAWf,OAAO,CAAC,aAAa;IAMrB,KAAK,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI;IA+C3C,IAAI;IAIJ,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAKrC,OAAO,IAAI,MAAM;IAIjB,SAAS,IAAI,iBAAiB;IAI9B,UAAU,IAAI,wBAAwB;IAItC,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAIpE,gBAAgB,IAAI,IAAI;CAOzB"}
package/dist/engine.js ADDED
@@ -0,0 +1,154 @@
1
+ import { CanvasManager } from './core/canvas-manager';
2
+ export class Engine {
3
+ constructor(container) {
4
+ Object.defineProperty(this, "canvas", {
5
+ enumerable: true,
6
+ configurable: true,
7
+ writable: true,
8
+ value: void 0
9
+ });
10
+ Object.defineProperty(this, "ctx", {
11
+ enumerable: true,
12
+ configurable: true,
13
+ writable: true,
14
+ value: void 0
15
+ });
16
+ Object.defineProperty(this, "deps", {
17
+ enumerable: true,
18
+ configurable: true,
19
+ writable: true,
20
+ value: null
21
+ });
22
+ Object.defineProperty(this, "isRunning", {
23
+ enumerable: true,
24
+ configurable: true,
25
+ writable: true,
26
+ value: false
27
+ });
28
+ Object.defineProperty(this, "lastTime", {
29
+ enumerable: true,
30
+ configurable: true,
31
+ writable: true,
32
+ value: 0
33
+ });
34
+ Object.defineProperty(this, "container", {
35
+ enumerable: true,
36
+ configurable: true,
37
+ writable: true,
38
+ value: void 0
39
+ });
40
+ Object.defineProperty(this, "canvasManager", {
41
+ enumerable: true,
42
+ configurable: true,
43
+ writable: true,
44
+ value: void 0
45
+ });
46
+ Object.defineProperty(this, "onEvent", {
47
+ enumerable: true,
48
+ configurable: true,
49
+ writable: true,
50
+ value: null
51
+ });
52
+ this.canvas = document.createElement('canvas');
53
+ this.canvas.style.border = '1px solid #ccc';
54
+ this.canvas.style.display = 'block';
55
+ const ctx = this.canvas.getContext('2d');
56
+ if (!ctx)
57
+ throw new Error('Failed to get 2D context');
58
+ this.ctx = ctx;
59
+ this.container = container;
60
+ this.container.appendChild(this.canvas);
61
+ this.canvasManager = new CanvasManager(this.canvas, this.container, this.ctx, { mode: 'native' });
62
+ // Internal listener to forward to onEvent
63
+ this.canvasManager.onResize = (size, pixelSize, fullscreen) => {
64
+ this.dispatchEvent('resize', [size, pixelSize, fullscreen]);
65
+ };
66
+ }
67
+ setScaling(config) {
68
+ this.canvasManager.setConfig(config);
69
+ }
70
+ setDeps(deps) {
71
+ this.deps = deps;
72
+ }
73
+ dispose() {
74
+ this.isRunning = false;
75
+ this.deps?.keyboard.dispose();
76
+ this.deps?.mouse.dispose();
77
+ this.deps?.gamepad.dispose();
78
+ this.canvasManager.dispose();
79
+ if (this.canvas.parentNode === this.container) {
80
+ this.container.removeChild(this.canvas);
81
+ }
82
+ }
83
+ dispatchEvent(type, args) {
84
+ if (this.onEvent) {
85
+ this.onEvent({ type, args, timestamp: performance.now() });
86
+ }
87
+ }
88
+ start(onEvent) {
89
+ if (!this.deps)
90
+ throw new Error('Engine dependencies not set. Call setDeps() before start().');
91
+ this.onEvent = onEvent;
92
+ this.isRunning = true;
93
+ this.lastTime = performance.now();
94
+ // Listeners for raw input
95
+ this.deps.keyboard.onKeyEvent = (scancode, keycode, type) => {
96
+ this.dispatchEvent(type === 'keydown' ? 'keypressed' : 'keyreleased', [scancode, keycode]);
97
+ };
98
+ this.deps.mouse.onMouseEvent = (clientX, clientY, button, type) => {
99
+ const [x, y] = this.transformMousePosition(clientX, clientY);
100
+ const b = (button ?? 0) + 1;
101
+ this.dispatchEvent(type === 'mousedown' ? 'mousepressed' : 'mousereleased', [x, y, b]);
102
+ };
103
+ this.deps.gamepad.onButtonEvent = (gpIndex, buttonIndex, buttonName, pressed) => {
104
+ this.dispatchEvent(pressed ? 'gamepadpressed' : 'gamepadreleased', [gpIndex, buttonIndex, buttonName]);
105
+ };
106
+ const loop = () => {
107
+ if (!this.isRunning)
108
+ return;
109
+ const currentTime = performance.now();
110
+ const dt = (currentTime - this.lastTime) / 1000;
111
+ this.lastTime = currentTime;
112
+ if (!this.deps.timer.isSleeping()) {
113
+ this.deps.timer.update(dt);
114
+ const inputEvents = this.deps.input.update();
115
+ inputEvents.pressed.forEach(action => this.dispatchEvent('actionpressed', [action]));
116
+ inputEvents.released.forEach(action => this.dispatchEvent('actionreleased', [action]));
117
+ this.dispatchEvent('update', [dt]);
118
+ }
119
+ this.deps.graphics.clear();
120
+ this.dispatchEvent('draw', [this.canvas]);
121
+ this.canvasManager.present();
122
+ requestAnimationFrame(loop);
123
+ };
124
+ this.dispatchEvent('load', []);
125
+ requestAnimationFrame(loop);
126
+ }
127
+ stop() {
128
+ this.isRunning = false;
129
+ }
130
+ setSize(width, height) {
131
+ this.canvas.width = width;
132
+ this.canvas.height = height;
133
+ }
134
+ getTime() {
135
+ return this.deps?.timer.getTime() ?? 0;
136
+ }
137
+ getCanvas() {
138
+ return this.canvas;
139
+ }
140
+ getContext() {
141
+ return this.ctx;
142
+ }
143
+ transformMousePosition(cssX, cssY) {
144
+ return this.canvasManager.transformMousePosition(cssX, cssY);
145
+ }
146
+ toggleFullscreen() {
147
+ if (!document.fullscreenElement) {
148
+ this.container.requestFullscreen().catch(console.error);
149
+ }
150
+ else {
151
+ document.exitFullscreen();
152
+ }
153
+ }
154
+ }
package/dist/index.d.ts CHANGED
@@ -1,45 +1,39 @@
1
- import { Scene } from './scene';
2
- declare class Like {
3
- private canvas;
4
- private ctx;
5
- private currentScene;
6
- private isRunning;
7
- private lastTime;
8
- private currentWidth;
9
- private currentHeight;
10
- graphics: import("./graphics").Graphics;
11
- audio: import("./audio").Audio;
12
- keyboard: import("./keyboard").Keyboard;
13
- mouse: import("./mouse").Mouse;
14
- input: import("./input").Input;
15
- gamepad: import("./gamepad").Gamepad;
16
- timer: import("./timer").Timer;
17
- constructor();
18
- init(container: HTMLElement, width?: number, height?: number): Promise<void>;
19
- toggleFullscreen(): void;
20
- private setupInputHandlers;
21
- setScene(scene: Scene): void;
22
- start(scene: Scene): void;
23
- private loop;
24
- getCanvas(): HTMLCanvasElement | null;
25
- getContext(): CanvasRenderingContext2D | null;
26
- getWidth(): number;
27
- getHeight(): number;
28
- }
29
- export declare const like: Like;
30
- export declare const love: Like;
31
- export { Source } from './audio';
32
- export type { SourceOptions } from './audio';
33
- export { timer } from './timer';
34
- export type { Scene } from './scene';
35
- export { ImageHandle } from './graphics';
36
- export type { Color, Quad, ShapeProps, DrawProps, PrintProps } from './graphics';
37
- export { input } from './input';
38
- export { gamepad, getButtonName } from './gamepad';
39
- export type { StickPosition } from './gamepad';
40
- export type { Vector2 } from './vector2';
41
- export { V2 } from './vector2';
42
- export type { Rect } from './rect';
43
- export { R } from './rect';
44
- export type { Event } from './events';
1
+ /**
2
+ * 2D vector as a tuple: [x, y]
3
+ */
4
+ export type { Vector2 } from './core/vector2';
5
+ /**
6
+ * 2D vector math and utility functions
7
+ */
8
+ export { Vec2 } from './core/vector2';
9
+ /**
10
+ * Rectangle math and utility functions.
11
+ * Rects are represented as [x, y, width, height] tuples.
12
+ */
13
+ export { Rect } from './core/rect';
14
+ /**
15
+ * Common event structure for all engine events.
16
+ */
17
+ export type { Like2DEvent, EventType } from './core/events';
18
+ /**
19
+ * Graphics types for drawing operations.
20
+ */
21
+ export type { Color, Quad, ShapeProps, DrawProps, PrintProps } from './core/graphics';
22
+ /**
23
+ * Handle to an image asset that may be loading in the background.
24
+ */
25
+ export { ImageHandle } from './core/graphics';
26
+ /**
27
+ * Audio source types for sound playback.
28
+ */
29
+ export type { Source, SourceOptions } from './core/audio';
30
+ /**
31
+ * Core Scene interface for class-based game architecture.
32
+ */
33
+ export type { Scene } from './adapters/scene/scene';
34
+ /**
35
+ * Gamepad utility functions and types.
36
+ */
37
+ export { getGPName, GP } from './core/gamepad';
38
+ export type { StickPosition } from './core/gamepad';
45
39
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,cAAM,IAAI;IACR,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,GAAG,CAAyC;IACpD,OAAO,CAAC,YAAY,CAAsB;IAC1C,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,YAAY,CAAO;IAC3B,OAAO,CAAC,aAAa,CAAO;IAE5B,QAAQ,gCAAY;IACpB,KAAK,0BAAS;IACd,QAAQ,gCAAY;IACpB,KAAK,0BAAS;IACd,KAAK,0BAAS;IACd,OAAO,8BAAW;IAClB,KAAK,0BAAS;;IAIR,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,KAAK,GAAE,MAAY,EAAE,MAAM,GAAE,MAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IA0B5F,gBAAgB,IAAI,IAAI;IAYxB,OA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