canvasengine 2.0.0-beta.4 → 2.0.0-beta.40

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 (142) hide show
  1. package/dist/DebugRenderer-DgECR3yZ.js +172 -0
  2. package/dist/DebugRenderer-DgECR3yZ.js.map +1 -0
  3. package/dist/components/Button.d.ts +183 -0
  4. package/dist/components/Button.d.ts.map +1 -0
  5. package/dist/components/Canvas.d.ts +18 -0
  6. package/dist/components/Canvas.d.ts.map +1 -0
  7. package/dist/components/DOMElement.d.ts +44 -0
  8. package/dist/components/DOMElement.d.ts.map +1 -0
  9. package/dist/components/Graphic.d.ts +65 -0
  10. package/dist/components/Graphic.d.ts.map +1 -0
  11. package/dist/components/Joystick.d.ts +36 -0
  12. package/dist/components/Joystick.d.ts.map +1 -0
  13. package/dist/components/NineSliceSprite.d.ts +17 -0
  14. package/dist/components/NineSliceSprite.d.ts.map +1 -0
  15. package/dist/components/ParticleEmitter.d.ts +5 -0
  16. package/dist/components/ParticleEmitter.d.ts.map +1 -0
  17. package/dist/components/Scene.d.ts +2 -0
  18. package/dist/components/Scene.d.ts.map +1 -0
  19. package/dist/components/Text.d.ts +26 -0
  20. package/dist/components/Text.d.ts.map +1 -0
  21. package/dist/components/TilingSprite.d.ts +18 -0
  22. package/dist/components/TilingSprite.d.ts.map +1 -0
  23. package/dist/components/Video.d.ts +15 -0
  24. package/dist/components/Video.d.ts.map +1 -0
  25. package/dist/components/index.d.ts +18 -0
  26. package/dist/components/index.d.ts.map +1 -0
  27. package/dist/components/types/DisplayObject.d.ts +110 -0
  28. package/dist/components/types/DisplayObject.d.ts.map +1 -0
  29. package/dist/components/types/MouseEvent.d.ts +4 -0
  30. package/dist/components/types/MouseEvent.d.ts.map +1 -0
  31. package/dist/components/types/Spritesheet.d.ts +248 -0
  32. package/dist/components/types/Spritesheet.d.ts.map +1 -0
  33. package/dist/components/types/index.d.ts +5 -0
  34. package/dist/components/types/index.d.ts.map +1 -0
  35. package/dist/directives/Controls.d.ts +113 -0
  36. package/dist/directives/Controls.d.ts.map +1 -0
  37. package/dist/directives/ControlsBase.d.ts +198 -0
  38. package/dist/directives/ControlsBase.d.ts.map +1 -0
  39. package/dist/directives/Drag.d.ts +70 -0
  40. package/dist/directives/Drag.d.ts.map +1 -0
  41. package/dist/directives/Flash.d.ts +117 -0
  42. package/dist/directives/Flash.d.ts.map +1 -0
  43. package/dist/directives/GamepadControls.d.ts +225 -0
  44. package/dist/directives/GamepadControls.d.ts.map +1 -0
  45. package/dist/directives/JoystickControls.d.ts +172 -0
  46. package/dist/directives/JoystickControls.d.ts.map +1 -0
  47. package/dist/directives/KeyboardControls.d.ts +219 -0
  48. package/dist/directives/KeyboardControls.d.ts.map +1 -0
  49. package/dist/directives/Scheduler.d.ts +36 -0
  50. package/dist/directives/Scheduler.d.ts.map +1 -0
  51. package/dist/directives/Shake.d.ts +98 -0
  52. package/dist/directives/Shake.d.ts.map +1 -0
  53. package/dist/directives/Sound.d.ts +26 -0
  54. package/dist/directives/Sound.d.ts.map +1 -0
  55. package/dist/directives/Transition.d.ts +11 -0
  56. package/dist/directives/Transition.d.ts.map +1 -0
  57. package/dist/directives/ViewportCull.d.ts +12 -0
  58. package/dist/directives/ViewportCull.d.ts.map +1 -0
  59. package/dist/directives/ViewportFollow.d.ts +19 -0
  60. package/dist/directives/ViewportFollow.d.ts.map +1 -0
  61. package/dist/directives/index.d.ts +13 -0
  62. package/dist/directives/index.d.ts.map +1 -0
  63. package/dist/engine/animation.d.ts +73 -0
  64. package/dist/engine/animation.d.ts.map +1 -0
  65. package/dist/engine/bootstrap.d.ts +16 -0
  66. package/dist/engine/bootstrap.d.ts.map +1 -0
  67. package/dist/engine/directive.d.ts +14 -0
  68. package/dist/engine/directive.d.ts.map +1 -0
  69. package/dist/engine/reactive.d.ts +105 -0
  70. package/dist/engine/reactive.d.ts.map +1 -0
  71. package/dist/engine/signal.d.ts +72 -0
  72. package/dist/engine/signal.d.ts.map +1 -0
  73. package/dist/engine/trigger.d.ts +50 -0
  74. package/dist/engine/trigger.d.ts.map +1 -0
  75. package/dist/engine/utils.d.ts +90 -0
  76. package/dist/engine/utils.d.ts.map +1 -0
  77. package/dist/hooks/addContext.d.ts +2 -0
  78. package/dist/hooks/addContext.d.ts.map +1 -0
  79. package/dist/hooks/useProps.d.ts +42 -0
  80. package/dist/hooks/useProps.d.ts.map +1 -0
  81. package/dist/hooks/useRef.d.ts +5 -0
  82. package/dist/hooks/useRef.d.ts.map +1 -0
  83. package/dist/index-gb763Hyx.js +12560 -0
  84. package/dist/index-gb763Hyx.js.map +1 -0
  85. package/dist/index.d.ts +15 -1083
  86. package/dist/index.d.ts.map +1 -0
  87. package/dist/index.global.js +29 -0
  88. package/dist/index.global.js.map +1 -0
  89. package/dist/index.js +81 -3041
  90. package/dist/index.js.map +1 -1
  91. package/dist/utils/Ease.d.ts +17 -0
  92. package/dist/utils/Ease.d.ts.map +1 -0
  93. package/dist/utils/GlobalAssetLoader.d.ts +141 -0
  94. package/dist/utils/GlobalAssetLoader.d.ts.map +1 -0
  95. package/dist/utils/RadialGradient.d.ts +58 -0
  96. package/dist/utils/RadialGradient.d.ts.map +1 -0
  97. package/dist/utils/functions.d.ts +2 -0
  98. package/dist/utils/functions.d.ts.map +1 -0
  99. package/package.json +13 -7
  100. package/src/components/Button.ts +396 -0
  101. package/src/components/Canvas.ts +61 -45
  102. package/src/components/Container.ts +21 -2
  103. package/src/components/DOMContainer.ts +123 -0
  104. package/src/components/DOMElement.ts +421 -0
  105. package/src/components/DisplayObject.ts +350 -197
  106. package/src/components/Graphic.ts +200 -34
  107. package/src/components/Joystick.ts +361 -0
  108. package/src/components/Mesh.ts +222 -0
  109. package/src/components/NineSliceSprite.ts +4 -1
  110. package/src/components/ParticleEmitter.ts +12 -8
  111. package/src/components/Sprite.ts +306 -30
  112. package/src/components/Text.ts +125 -18
  113. package/src/components/Video.ts +110 -0
  114. package/src/components/Viewport.ts +59 -43
  115. package/src/components/index.ts +8 -2
  116. package/src/components/types/DisplayObject.ts +34 -0
  117. package/src/components/types/Spritesheet.ts +0 -118
  118. package/src/directives/Controls.ts +254 -0
  119. package/src/directives/ControlsBase.ts +266 -0
  120. package/src/directives/Drag.ts +357 -52
  121. package/src/directives/Flash.ts +409 -0
  122. package/src/directives/GamepadControls.ts +537 -0
  123. package/src/directives/JoystickControls.ts +396 -0
  124. package/src/directives/KeyboardControls.ts +66 -424
  125. package/src/directives/Shake.ts +282 -0
  126. package/src/directives/Sound.ts +94 -31
  127. package/src/directives/ViewportFollow.ts +35 -7
  128. package/src/directives/index.ts +12 -6
  129. package/src/engine/animation.ts +175 -21
  130. package/src/engine/bootstrap.ts +23 -3
  131. package/src/engine/directive.ts +2 -2
  132. package/src/engine/reactive.ts +780 -177
  133. package/src/engine/signal.ts +35 -4
  134. package/src/engine/trigger.ts +21 -4
  135. package/src/engine/utils.ts +19 -3
  136. package/src/hooks/useProps.ts +1 -1
  137. package/src/index.ts +4 -2
  138. package/src/utils/GlobalAssetLoader.ts +257 -0
  139. package/src/utils/functions.ts +7 -0
  140. package/testing/index.ts +12 -0
  141. package/tsconfig.json +17 -0
  142. package/vite.config.ts +39 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/components/Text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,SAAS,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAsC,OAAO,EAAS,MAAM,oBAAoB,CAAC;AACxF,OAAO,EAAiB,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAS3D,MAAM,WAAW,SAAU,SAAQ,kBAAkB;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE;QACX,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;QACxB,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC;QAClB,KAAK,CAAC,EAAE;YACN,GAAG,EAAE,MAAM,CAAC;YACZ,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,IAAI,CAAC,EAAE,MAAM,CAAC;SACf,CAAC;KACH,CAAC;IACF,OAAO,CAAC,EAAE,GAAG,CAAC;CACf;AA2ND,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,8BAEpC"}
@@ -0,0 +1,18 @@
1
+ import { DisplayObjectProps } from './types/DisplayObject';
2
+
3
+ interface TilingSpriteProps extends DisplayObjectProps {
4
+ image?: string;
5
+ tileScale?: {
6
+ x: number;
7
+ y: number;
8
+ };
9
+ tilePosition?: {
10
+ x: number;
11
+ y: number;
12
+ };
13
+ width?: number;
14
+ height?: number;
15
+ }
16
+ export declare function TilingSprite(props: TilingSpriteProps): import('..').Element<import('./DisplayObject').ComponentInstance>;
17
+ export {};
18
+ //# sourceMappingURL=TilingSprite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TilingSprite.d.ts","sourceRoot":"","sources":["../../src/components/TilingSprite.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,UAAU,iBAAkB,SAAQ,kBAAkB;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,YAAY,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAyBD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qEAEpD"}
@@ -0,0 +1,15 @@
1
+ import { Texture } from 'pixi.js';
2
+
3
+ interface VideoProps {
4
+ src: string;
5
+ paused?: boolean;
6
+ loop?: boolean;
7
+ muted?: boolean;
8
+ loader?: {
9
+ onComplete?: (texture: Texture) => void;
10
+ onProgress?: (progress: number) => void;
11
+ };
12
+ }
13
+ export declare function Video(props: VideoProps): import('..').Element<import('./DisplayObject').ComponentInstance> | Promise<import('..').Element<import('./DisplayObject').ComponentInstance>>;
14
+ export {};
15
+ //# sourceMappingURL=Video.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Video.d.ts","sourceRoot":"","sources":["../../src/components/Video.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAMlC,UAAU,UAAU;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE;QACL,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;QACxC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;KAC3C,CAAC;CACL;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,kJA4FtC"}
@@ -0,0 +1,18 @@
1
+ export { Canvas } from './Canvas';
2
+ export { Container } from './Container';
3
+ export { Graphics, Rect, Circle, Ellipse, Triangle, Svg } from './Graphic';
4
+ export { Mesh } from './Mesh';
5
+ export { Scene } from './Scene';
6
+ export { ParticlesEmitter } from './ParticleEmitter';
7
+ export { Sprite } from './Sprite';
8
+ export { Video } from './Video';
9
+ export { Text } from './Text';
10
+ export { TilingSprite } from './TilingSprite';
11
+ export { Viewport } from './Viewport';
12
+ export { NineSliceSprite } from './NineSliceSprite';
13
+ export { type ComponentInstance } from './DisplayObject';
14
+ export { DOMContainer } from './DOMContainer';
15
+ export { DOMElement } from './DOMElement';
16
+ export { Button, ButtonState, type ButtonProps, type ButtonStyle } from './Button';
17
+ export { Joystick, type JoystickSettings, type JoystickChangeEvent } from './Joystick';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAA;AAClF,OAAO,EAAE,QAAQ,EAAE,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAA"}
@@ -0,0 +1,110 @@
1
+ import { SignalOrPrimitive } from '.';
2
+ import { DragProps } from '../../directives/Drag';
3
+ import { ViewportFollowProps } from '../../directives/ViewportFollow';
4
+ import { ShakeProps } from '../../directives/Shake';
5
+ import { FlashProps } from '../../directives/Flash';
6
+ import * as PIXI from "pixi.js";
7
+ export type FlexDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
8
+ export type JustifyContent = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around';
9
+ export type AlignContent = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around';
10
+ export type Size = number | `${number}%`;
11
+ export type EdgeSize = SignalOrPrimitive<Size | [Size, Size] | [Size, Size, Size, Size]>;
12
+ export type ObjectFit = 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
13
+ export type ObjectPosition = string;
14
+ export type TransformOrigin = string;
15
+ export type PositionType = 'relative' | 'absolute' | 'static';
16
+ export interface DisplayObjectProps {
17
+ attach?: any;
18
+ ref?: string;
19
+ x?: SignalOrPrimitive<number>;
20
+ y?: SignalOrPrimitive<number>;
21
+ width?: SignalOrPrimitive<Size>;
22
+ height?: SignalOrPrimitive<Size>;
23
+ minWidth?: SignalOrPrimitive<Size>;
24
+ minHeight?: SignalOrPrimitive<Size>;
25
+ maxWidth?: SignalOrPrimitive<Size>;
26
+ maxHeight?: SignalOrPrimitive<Size>;
27
+ aspectRatio?: SignalOrPrimitive<number>;
28
+ flexGrow?: SignalOrPrimitive<number>;
29
+ flexShrink?: SignalOrPrimitive<number>;
30
+ flexBasis?: SignalOrPrimitive<Size>;
31
+ rowGap?: SignalOrPrimitive<number>;
32
+ columnGap?: SignalOrPrimitive<number>;
33
+ positionType?: PositionType;
34
+ top?: SignalOrPrimitive<Size>;
35
+ right?: SignalOrPrimitive<Size>;
36
+ bottom?: SignalOrPrimitive<Size>;
37
+ left?: SignalOrPrimitive<Size>;
38
+ objectFit?: ObjectFit;
39
+ objectPosition?: ObjectPosition;
40
+ transformOrigin?: TransformOrigin;
41
+ children?: any[];
42
+ flexDirection?: FlexDirection;
43
+ justifyContent?: JustifyContent;
44
+ alpha?: SignalOrPrimitive<number>;
45
+ margin?: EdgeSize;
46
+ padding?: EdgeSize;
47
+ border?: EdgeSize;
48
+ absolute?: SignalOrPrimitive<boolean>;
49
+ scale?: SignalOrPrimitive<{
50
+ x: number;
51
+ y: number;
52
+ } | number>;
53
+ anchor?: SignalOrPrimitive<{
54
+ x: number;
55
+ y: number;
56
+ }>;
57
+ skew?: SignalOrPrimitive<{
58
+ x: number;
59
+ y: number;
60
+ }>;
61
+ tint?: SignalOrPrimitive<number>;
62
+ rotation?: SignalOrPrimitive<number>;
63
+ angle?: SignalOrPrimitive<number>;
64
+ zIndex?: SignalOrPrimitive<number>;
65
+ roundPixels?: SignalOrPrimitive<boolean>;
66
+ cursor?: SignalOrPrimitive<string>;
67
+ visible?: SignalOrPrimitive<boolean>;
68
+ pivot?: SignalOrPrimitive<{
69
+ x: number;
70
+ y: number;
71
+ }>;
72
+ filters?: any[];
73
+ blendMode?: SignalOrPrimitive<PIXI.BLEND_MODES>;
74
+ blur?: SignalOrPrimitive<number>;
75
+ drag?: DragProps;
76
+ viewportFollow?: ViewportFollowProps;
77
+ shake?: ShakeProps;
78
+ flash?: FlashProps;
79
+ click?: PIXI.FederatedEventHandler;
80
+ mousedown?: PIXI.FederatedEventHandler;
81
+ mouseenter?: PIXI.FederatedEventHandler;
82
+ mouseleave?: PIXI.FederatedEventHandler;
83
+ mousemove?: PIXI.FederatedEventHandler;
84
+ mouseout?: PIXI.FederatedEventHandler;
85
+ mouseover?: PIXI.FederatedEventHandler;
86
+ mouseup?: PIXI.FederatedEventHandler;
87
+ mouseupoutside?: PIXI.FederatedEventHandler;
88
+ pointercancel?: PIXI.FederatedEventHandler;
89
+ pointerdown?: PIXI.FederatedEventHandler;
90
+ pointerenter?: PIXI.FederatedEventHandler;
91
+ pointerleave?: PIXI.FederatedEventHandler;
92
+ pointermove?: PIXI.FederatedEventHandler;
93
+ pointerout?: PIXI.FederatedEventHandler;
94
+ pointerover?: PIXI.FederatedEventHandler;
95
+ pointertap?: PIXI.FederatedEventHandler;
96
+ pointerup?: PIXI.FederatedEventHandler;
97
+ pointerupoutside?: PIXI.FederatedEventHandler;
98
+ rightclick?: PIXI.FederatedEventHandler;
99
+ rightdown?: PIXI.FederatedEventHandler;
100
+ rightup?: PIXI.FederatedEventHandler;
101
+ rightupoutside?: PIXI.FederatedEventHandler;
102
+ tap?: PIXI.FederatedEventHandler;
103
+ touchcancel?: PIXI.FederatedEventHandler;
104
+ touchend?: PIXI.FederatedEventHandler;
105
+ touchendoutside?: PIXI.FederatedEventHandler;
106
+ touchmove?: PIXI.FederatedEventHandler;
107
+ touchstart?: PIXI.FederatedEventHandler;
108
+ wheel?: PIXI.FederatedEventHandler<PIXI.FederatedWheelEvent>;
109
+ }
110
+ //# sourceMappingURL=DisplayObject.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DisplayObject.d.ts","sourceRoot":"","sources":["../../../src/components/types/DisplayObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,GAAG,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,aAAa,GAAG,gBAAgB,CAAC;AAChF,MAAM,MAAM,cAAc,GAAG,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AE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;CAChE"}
@@ -0,0 +1,4 @@
1
+ export interface MouseEvent {
2
+ click?: (e: any) => void;
3
+ }
4
+ //# sourceMappingURL=MouseEvent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MouseEvent.d.ts","sourceRoot":"","sources":["../../../src/components/types/MouseEvent.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACvB,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;CAC3B"}
@@ -0,0 +1,248 @@
1
+ export interface TransformOptions {
2
+ /**
3
+ * The global value of opacity (between 0 and 1)
4
+ *
5
+ * @prop {number} [opacity]
6
+ * @memberof Spritesheet
7
+ * */
8
+ opacity?: number;
9
+ /**
10
+ * The global value of pivot.
11
+ *
12
+ * Invariant under rotation, scaling, and skewing. The projection of into the parent's space of the pivot is equal to position, regardless of the other three transformations. In other words, It is the center of rotation, scaling, and skewing.
13
+ *
14
+ * The array has two elements: [x, y]. If y is omitted, both x and y will be set to x.
15
+ *
16
+ * ```ts
17
+ * pivot: [0.5, 0.8]
18
+ * ```
19
+ *
20
+ * @prop {Array<number>} [pivot]
21
+ * @memberof Spritesheet
22
+ * */
23
+ pivot?: number[];
24
+ /**
25
+ * The global value of anchor.
26
+ *
27
+ * Position of the origin point
28
+ *
29
+ * The array has two elements: [x, y]. If y is omitted, both x and y will be set to x.
30
+ *
31
+ * ```ts
32
+ * anchor: [0.5, 0.8]
33
+ * ```
34
+ *
35
+ * @prop {Array<number>} [anchor]
36
+ * @memberof Spritesheet
37
+ * */
38
+ anchor?: number[];
39
+ /**
40
+ * Defines the actual size of the sprite that is inside a larger rectangle.
41
+ * For example, if the texture rectangle is 192x192 while the character, which is in the center, is only 64x64 then set `spriteRealSize: 64`. This way the character will be well positioned in relation to the animations that have a different rectangle
42
+ *
43
+ * > You can also put `spriteRealSize: { width: 64, height: 64 }` but be aware that the width is not concerned because it will always be centered while the height depends on the hitbox
44
+ *
45
+ * @prop {{ width: number, height: number } | number} [spriteRealSize]
46
+ * @since 3.2.0
47
+ * @memberof Spritesheet
48
+ * */
49
+ spriteRealSize?: {
50
+ width: number;
51
+ height: number;
52
+ } | number;
53
+ /**
54
+ * The global value of rotation
55
+ *
56
+ * Rotation. This will rotate the display object's projection by this angle (in radians).
57
+ *
58
+ * @prop {number} [angle]
59
+ * @memberof Spritesheet
60
+ * */
61
+ angle?: number;
62
+ /**
63
+ * The global value of rotation
64
+ *
65
+ * Rotation. This is an alias for rotation, but in degrees.
66
+ *
67
+ * @prop {number} [rotation]
68
+ * @memberof Spritesheet
69
+ * */
70
+ rotation?: number;
71
+ /**
72
+ * The global value of scale.
73
+ *
74
+ * Scaling. This will stretch (or compress) the display object's projection. The scale factors are along the local coordinate axes. In other words, the display object is scaled before rotated or skewed. The center of scaling is the pivot.
75
+ *
76
+ * The array has two elements: [x, y]. If y is omitted, both x and y will be set to x.
77
+ *
78
+ * ```ts
79
+ * scale: [0.5, 0.8]
80
+ * ```
81
+ *
82
+ * @prop {Array<number>} [scale]
83
+ * @memberof Spritesheet
84
+ * */
85
+ scale?: number[];
86
+ /**
87
+ * The global value of skew.
88
+ *
89
+ * Skewing. This can be used to deform a rectangular display object into a parallelogram.
90
+ *
91
+ * In PixiJS, skew has a slightly different behaviour than the conventional meaning. It can be thought of the net rotation applied to the coordinate axes (separately). For example, if "skew.x" is ⍺ and "skew.y" is β, then the line x = 0 will be rotated by ⍺ (y = -x*cot⍺) and the line y = 0 will be rotated by β (y = x*tanβ). A line y = x*tanϴ (i.e. a line at angle ϴ to the x-axis in local-space) will be rotated by an angle between ⍺ and β.
92
+ *
93
+ * It can be observed that if skew is applied equally to both axes, then it will be equivalent to applying a rotation. Indeed, if "skew.x" = -ϴ and "skew.y" = ϴ, it will produce an equivalent of "rotation" = ϴ.
94
+ *
95
+ * Another quite interesting observation is that "skew.x", "skew.y", rotation are communtative operations. Indeed, because rotation is essentially a careful combination of the two.
96
+ *
97
+ * The array has two elements: [x, y]. If y is omitted, both x and y will be set to x.
98
+ *
99
+ * @prop {Array<number>} [skew]
100
+ * @memberof Spritesheet
101
+ * */
102
+ skew?: number[];
103
+ /**
104
+ * The global value of X translation
105
+ *
106
+ * @prop {number} [x]
107
+ * @memberof Spritesheet
108
+ * */
109
+ x?: number;
110
+ /**
111
+ * The global value of Y translation
112
+ *
113
+ * @prop {number} [y]
114
+ * @memberof Spritesheet
115
+ * */
116
+ y?: number;
117
+ /**
118
+ * The global value of visible
119
+ *
120
+ * @prop {boolean} [visible]
121
+ * @memberof Spritesheet
122
+ * */
123
+ visible?: boolean;
124
+ /**
125
+ * Define the sound that will be played for all animations in the spritesheet. Remember to create the sound before with the @Sound decorator
126
+ *
127
+ * @prop {string} [sound]
128
+ * @memberof Spritesheet
129
+ * */
130
+ sound?: string;
131
+ }
132
+ export interface FrameOptions extends TransformOptions {
133
+ time: number;
134
+ frameX?: number;
135
+ frameY?: number;
136
+ }
137
+ export interface TextureOptions {
138
+ /**
139
+ * The number of frames on the width
140
+ *
141
+ * @prop {number} framesWidth
142
+ * @memberof Spritesheet
143
+ * */
144
+ framesWidth?: number;
145
+ /**
146
+ * The number of frames on the height
147
+ *
148
+ * @prop {number} framesHeight
149
+ * @memberof Spritesheet
150
+ * */
151
+ framesHeight?: number;
152
+ /**
153
+ * The width of the image (in pixels)
154
+ *
155
+ * @prop {number} width
156
+ * @memberof Spritesheet
157
+ * */
158
+ width?: number;
159
+ /**
160
+ * The height of the image (in pixels)
161
+ *
162
+ * @prop {number} height
163
+ * @memberof Spritesheet
164
+ * */
165
+ height?: number;
166
+ /**
167
+ * Takes a width of a rectangle in the image. Equivalent to `width / framesWidth`
168
+ *
169
+ * @prop {number} [rectWidth]
170
+ * @memberof Spritesheet
171
+ * */
172
+ rectWidth?: number;
173
+ /**
174
+ * Takes a height of a rectangle in the image. Equivalent to `height / framesHeight`
175
+ *
176
+ * @prop {number} [rectHeight]
177
+ * @memberof Spritesheet
178
+ * */
179
+ rectHeight?: number;
180
+ /**
181
+ * To take the texture, start at a well defined X and Y position. Otherwise, it starts at 0,0
182
+ *
183
+ * @prop {number} [offset]
184
+ * @memberof Spritesheet
185
+ * */
186
+ offset?: {
187
+ x: number;
188
+ y: number;
189
+ };
190
+ }
191
+ export type AnimationFrames = FrameOptions[][] | ((...args: any) => FrameOptions[][]);
192
+ export interface TexturesOptions extends TextureOptions, TransformOptions {
193
+ animations: AnimationFrames;
194
+ }
195
+ export interface SpritesheetOptions extends TransformOptions, TextureOptions {
196
+ textures?: {
197
+ [animationName: string]: Partial<TexturesOptions> & Pick<TexturesOptions, 'animations'>;
198
+ };
199
+ }
200
+ type SpritesheetImageOptions = SpritesheetOptions & {
201
+ /**
202
+ * The link to the image
203
+ *
204
+ * > Do not use the `images` property
205
+ * > Remember to wrap the link to the image with the `require` function.
206
+ *
207
+ * ```ts
208
+ * image: require('./assets/hero.png')
209
+ * ```
210
+ *
211
+ * @prop {string} [image]
212
+ * @memberof Spritesheet
213
+ * */
214
+ image?: string;
215
+ /**
216
+ * Spritesheet identifier.
217
+ *
218
+ * > Do not use the `images` property
219
+ *
220
+ * @prop {string} [id]
221
+ * @memberof Spritesheet
222
+ * */
223
+ id: string;
224
+ };
225
+ type SpritesheetImagesOptions = SpritesheetOptions & {
226
+ /**
227
+ * Put the different images that are concerned by the properties below.
228
+ * The key of the object is the identifier of the spritesheet and the value and the link to the image.
229
+ *
230
+ * > Remember to wrap the link to the image with the `require` function.
231
+ *
232
+ * ```ts
233
+ * images: {
234
+ * hero: require('./assets/hero.png')
235
+ * }
236
+ * ```
237
+ *
238
+ * @prop { { [id: string]: string } } [images]
239
+ * @memberof Spritesheet
240
+ * */
241
+ images?: {
242
+ [id: string]: string;
243
+ };
244
+ };
245
+ export declare function Spritesheet(options: SpritesheetImageOptions): any;
246
+ export declare function Spritesheet(options: SpritesheetImagesOptions): any;
247
+ export {};
248
+ //# sourceMappingURL=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';
3
+
4
+ export type SignalOrPrimitive<T> = T | Signal<T> | AnimatedSignal<T>;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,113 @@
1
+ import { Directive } from '../engine/directive';
2
+ import { Element } from '../engine/reactive';
3
+ import { Controls } from './ControlsBase';
4
+ import { KeyboardControls } from './KeyboardControls';
5
+ import { GamepadControls } from './GamepadControls';
6
+ import { JoystickControls } from './JoystickControls';
7
+
8
+ /**
9
+ * Controls directive that coordinates keyboard, gamepad, and joystick input systems
10
+ *
11
+ * This directive automatically activates keyboard, gamepad, and joystick controls when available.
12
+ * The gamepad is automatically enabled if joypad.js is detected in the environment.
13
+ *
14
+ * All systems share the same control configuration and can work simultaneously.
15
+ *
16
+ * @example
17
+ * ```html
18
+ * <Sprite
19
+ * image="path/to/image.png"
20
+ * controls={controlsConfig}
21
+ * x={x}
22
+ * y={y}
23
+ * />
24
+ * ```
25
+ */
26
+ export declare class ControlsDirective extends Directive {
27
+ private keyboardControls;
28
+ private gamepadControls;
29
+ private joystickControls;
30
+ private freezeSubscription;
31
+ private element;
32
+ /**
33
+ * Initialize the controls directive
34
+ * Sets up keyboard, gamepad, and joystick controls if available
35
+ */
36
+ onInit(element: Element): void;
37
+ /**
38
+ * Mount hook (no specific action needed)
39
+ */
40
+ onMount(element: Element): void;
41
+ /**
42
+ * Update controls configuration
43
+ * Updates both keyboard and gamepad controls
44
+ */
45
+ onUpdate(props: any, element: Element): void;
46
+ /**
47
+ * Cleanup and destroy all control systems
48
+ */
49
+ onDestroy(element: Element): void;
50
+ /**
51
+ * Get a control by input name
52
+ * Delegates to keyboard controls (primary system)
53
+ *
54
+ * @param inputName - Name of the input/key
55
+ * @returns BoundKey if found, undefined otherwise
56
+ */
57
+ getControl(inputName: string): import('./ControlsBase').BoundKey;
58
+ /**
59
+ * Get all bound controls
60
+ * Delegates to keyboard controls (primary system)
61
+ *
62
+ * @returns Object mapping input names to BoundKey objects
63
+ */
64
+ getControls(): {
65
+ [key: string]: import('./ControlsBase').BoundKey;
66
+ };
67
+ /**
68
+ * Apply a control action programmatically
69
+ * Applies to both keyboard and gamepad if available
70
+ *
71
+ * @param controlName - Name of the control
72
+ * @param isDown - Whether the control is pressed (true) or released (false)
73
+ * @param payload - Optional payload to pass to keyDown/keyUp callbacks (e.g., { power: 0.8 })
74
+ * @returns Promise that resolves when the action is complete
75
+ */
76
+ applyControl(controlName: string | number, isDown?: boolean, payload?: any): Promise<void>;
77
+ /**
78
+ * Stop listening to inputs
79
+ * Stops keyboard, gamepad, and joystick input processing
80
+ */
81
+ stopInputs(): void;
82
+ /**
83
+ * Resume listening to inputs
84
+ * Resumes keyboard, gamepad, and joystick input processing
85
+ */
86
+ listenInputs(): void;
87
+ /**
88
+ * Get the current controls configuration
89
+ * Returns keyboard controls options (both systems share the same config)
90
+ *
91
+ * @returns The controls options object
92
+ */
93
+ get options(): Controls;
94
+ /**
95
+ * Get the keyboard controls instance
96
+ *
97
+ * @returns KeyboardControls instance or null
98
+ */
99
+ get keyboard(): KeyboardControls | null;
100
+ /**
101
+ * Get the gamepad controls instance
102
+ *
103
+ * @returns GamepadControls instance or null
104
+ */
105
+ get gamepad(): GamepadControls | null;
106
+ /**
107
+ * Get the joystick controls instance
108
+ *
109
+ * @returns JoystickControls instance or null
110
+ */
111
+ get joystick(): JoystickControls | null;
112
+ }
113
+ //# sourceMappingURL=Controls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Controls.d.ts","sourceRoot":"","sources":["../../src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