@bloopjs/toodle 0.0.100 → 0.0.102

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 (192) hide show
  1. package/README.md +1 -1
  2. package/package.json +7 -4
  3. package/dist/docs/snippets/add-remove-children.d.ts +0 -1
  4. package/dist/docs/snippets/basic-quad.d.ts +0 -1
  5. package/dist/docs/snippets/filter-linear.d.ts +0 -1
  6. package/dist/docs/snippets/filter-nearest.d.ts +0 -1
  7. package/dist/docs/snippets/flipxy.d.ts +0 -1
  8. package/dist/docs/snippets/hello-text.d.ts +0 -1
  9. package/dist/docs/snippets/jumbo-textures.d.ts +0 -1
  10. package/dist/docs/snippets/layer.d.ts +0 -1
  11. package/dist/docs/snippets/layout-edges.d.ts +0 -1
  12. package/dist/docs/snippets/layout-screen-and-world-space.d.ts +0 -1
  13. package/dist/docs/snippets/postprocess.d.ts +0 -1
  14. package/dist/docs/snippets/quad-size-scale.d.ts +0 -1
  15. package/dist/docs/snippets/quickstart.d.ts +0 -1
  16. package/dist/docs/snippets/repeat-texture-loading.d.ts +0 -1
  17. package/dist/docs/snippets/screen-shaders.d.ts +0 -1
  18. package/dist/docs/snippets/shader-color-flash.d.ts +0 -1
  19. package/dist/docs/snippets/shader-default.d.ts +0 -1
  20. package/dist/docs/snippets/shader-fill.d.ts +0 -1
  21. package/dist/docs/snippets/shapes-line.d.ts +0 -1
  22. package/dist/docs/snippets/sprite-region.d.ts +0 -1
  23. package/dist/docs/snippets/text-alignment.d.ts +0 -1
  24. package/dist/docs/snippets/text-shrink-to-fit.d.ts +0 -1
  25. package/dist/docs/snippets/text-word-wrap.d.ts +0 -1
  26. package/dist/docs/snippets/texture-bundles-prebaked.d.ts +0 -1
  27. package/dist/docs/snippets/texture-bundles.d.ts +0 -1
  28. package/dist/docs/snippets/transforms.d.ts +0 -1
  29. package/dist/docs/snippets/transparent-cropping.d.ts +0 -1
  30. package/dist/examples/0-hello.d.ts +0 -1
  31. package/dist/examples/1-hello.d.ts +0 -1
  32. package/dist/examples/1-hello.d.ts.map +0 -1
  33. package/dist/examples/1-quad.d.ts +0 -1
  34. package/dist/examples/10-resize.d.ts +0 -1
  35. package/dist/examples/10-resize.d.ts.map +0 -1
  36. package/dist/examples/11-bundle-test.d.ts +0 -1
  37. package/dist/examples/11-bundle-test.d.ts.map +0 -1
  38. package/dist/examples/12-transparent-pixel-cropping.d.ts +0 -1
  39. package/dist/examples/12-transparent-pixel-cropping.d.ts.map +0 -1
  40. package/dist/examples/13-crop.d.ts +0 -1
  41. package/dist/examples/13-crop.d.ts.map +0 -1
  42. package/dist/examples/14-bundle-bench.d.ts +0 -1
  43. package/dist/examples/14-bundle-bench.d.ts.map +0 -1
  44. package/dist/examples/15-text-layer.d.ts +0 -1
  45. package/dist/examples/15-text-layer.d.ts.map +0 -1
  46. package/dist/examples/16-jumbo-texture.d.ts +0 -1
  47. package/dist/examples/16-jumbo-textures.d.ts +0 -1
  48. package/dist/examples/16-screen-shader.d.ts +0 -1
  49. package/dist/examples/16-screen-shader.d.ts.map +0 -1
  50. package/dist/examples/17-lighting.d.ts +0 -1
  51. package/dist/examples/17-lighting.d.ts.map +0 -1
  52. package/dist/examples/17-translations.d.ts +0 -1
  53. package/dist/examples/18-blur.d.ts +0 -1
  54. package/dist/examples/19-postprocess.d.ts +0 -1
  55. package/dist/examples/19-screenshader.d.ts +0 -1
  56. package/dist/examples/2-shapes.d.ts +0 -1
  57. package/dist/examples/2-shapes.d.ts.map +0 -1
  58. package/dist/examples/3-shader.d.ts +0 -1
  59. package/dist/examples/3-shader.d.ts.map +0 -1
  60. package/dist/examples/4-shader-bench.d.ts +0 -1
  61. package/dist/examples/4-shader-bench.d.ts.map +0 -1
  62. package/dist/examples/5-z.d.ts +0 -1
  63. package/dist/examples/5-z.d.ts.map +0 -1
  64. package/dist/examples/6-atlas.d.ts +0 -1
  65. package/dist/examples/6-atlas.d.ts.map +0 -1
  66. package/dist/examples/7-text.d.ts +0 -1
  67. package/dist/examples/7-text.d.ts.map +0 -1
  68. package/dist/examples/8-text-bench.d.ts +0 -1
  69. package/dist/examples/8-text-bench.d.ts.map +0 -1
  70. package/dist/examples/9-alignment.d.ts +0 -1
  71. package/dist/examples/9-alignment.d.ts.map +0 -1
  72. package/dist/examples/main.d.ts +0 -1
  73. package/dist/examples/main.d.ts.map +0 -1
  74. package/dist/examples/util.d.ts +0 -82
  75. package/dist/examples/util.d.ts.map +0 -1
  76. package/dist/postprocess.d.ts +0 -10
  77. package/dist/postprocess.d.ts.map +0 -1
  78. package/dist/src/Toodle.d.ts +0 -303
  79. package/dist/src/Toodle.d.ts.map +0 -1
  80. package/dist/src/colors/mod.d.ts +0 -871
  81. package/dist/src/coreTypes/Color.d.ts +0 -6
  82. package/dist/src/coreTypes/Color.d.ts.map +0 -1
  83. package/dist/src/coreTypes/Point.d.ts +0 -7
  84. package/dist/src/coreTypes/Point.d.ts.map +0 -1
  85. package/dist/src/coreTypes/Size.d.ts +0 -4
  86. package/dist/src/coreTypes/Size.d.ts.map +0 -1
  87. package/dist/src/coreTypes/Transform.d.ts +0 -15
  88. package/dist/src/coreTypes/Transform.d.ts.map +0 -1
  89. package/dist/src/coreTypes/Vec2.d.ts +0 -7
  90. package/dist/src/coreTypes/Vec2.d.ts.map +0 -1
  91. package/dist/src/coreTypes/mod.d.ts +0 -5
  92. package/dist/src/coreTypes/mod.d.ts.map +0 -1
  93. package/dist/src/limits.d.ts +0 -22
  94. package/dist/src/limits.d.ts.map +0 -1
  95. package/dist/src/math/angle.d.ts +0 -12
  96. package/dist/src/math/angle.d.ts.map +0 -1
  97. package/dist/src/math/matrix.d.ts +0 -25
  98. package/dist/src/math/matrix.d.ts.map +0 -1
  99. package/dist/src/math/mod.d.ts +0 -2
  100. package/dist/src/math/mod.d.ts.map +0 -1
  101. package/dist/src/mod.d.ts +0 -16
  102. package/dist/src/mod.d.ts.map +0 -1
  103. package/dist/src/postprocess.d.ts +0 -10
  104. package/dist/src/postprocess.d.ts.map +0 -1
  105. package/dist/src/scene/Batcher.d.ts +0 -19
  106. package/dist/src/scene/Batcher.d.ts.map +0 -1
  107. package/dist/src/scene/Camera.d.ts +0 -15
  108. package/dist/src/scene/Camera.d.ts.map +0 -1
  109. package/dist/src/scene/JumboQuadNode.d.ts +0 -28
  110. package/dist/src/scene/QuadNode.d.ts +0 -158
  111. package/dist/src/scene/QuadNode.d.ts.map +0 -1
  112. package/dist/src/scene/RenderComponent.d.ts +0 -10
  113. package/dist/src/scene/RenderComponent.d.ts.map +0 -1
  114. package/dist/src/scene/SceneNode.d.ts +0 -299
  115. package/dist/src/scene/SceneNode.d.ts.map +0 -1
  116. package/dist/src/scene/mod.d.ts +0 -4
  117. package/dist/src/scene/mod.d.ts.map +0 -1
  118. package/dist/src/screen/mod.d.ts +0 -1
  119. package/dist/src/screen/mod.d.ts.map +0 -1
  120. package/dist/src/screen/resolution.d.ts +0 -4
  121. package/dist/src/screen/resolution.d.ts.map +0 -1
  122. package/dist/src/shaders/EngineUniform.d.ts +0 -8
  123. package/dist/src/shaders/EngineUniform.d.ts.map +0 -1
  124. package/dist/src/shaders/IShader.d.ts +0 -14
  125. package/dist/src/shaders/IShader.d.ts.map +0 -1
  126. package/dist/src/shaders/QuadShader.d.ts +0 -17
  127. package/dist/src/shaders/QuadShader.d.ts.map +0 -1
  128. package/dist/src/shaders/ShaderDescriptor.d.ts +0 -6
  129. package/dist/src/shaders/ShaderDescriptor.d.ts.map +0 -1
  130. package/dist/src/shaders/mod.d.ts +0 -5
  131. package/dist/src/shaders/mod.d.ts.map +0 -1
  132. package/dist/src/shaders/parser.d.ts +0 -7
  133. package/dist/src/shaders/parser.d.ts.map +0 -1
  134. package/dist/src/shaders/postprocess/blur.d.ts +0 -2
  135. package/dist/src/shaders/postprocess/mod.d.ts +0 -16
  136. package/dist/src/shaders/postprocess/postprocess.d.ts +0 -8
  137. package/dist/src/shaders/postprocess/util.d.ts +0 -2
  138. package/dist/src/shaders/samplers.d.ts +0 -2
  139. package/dist/src/shaders/samplers.d.ts.map +0 -1
  140. package/dist/src/shaders/wgsl/example.wgsl.d.ts +0 -2
  141. package/dist/src/shaders/wgsl/example.wgsl.d.ts.map +0 -1
  142. package/dist/src/shaders/wgsl/hello.wgsl.d.ts +0 -2
  143. package/dist/src/shaders/wgsl/hello.wgsl.d.ts.map +0 -1
  144. package/dist/src/shaders/wgsl/helloInstanced.wgsl.d.ts +0 -2
  145. package/dist/src/shaders/wgsl/helloInstanced.wgsl.d.ts.map +0 -1
  146. package/dist/src/shaders/wgsl/quad.wgsl.d.ts +0 -2
  147. package/dist/src/shaders/wgsl/quad.wgsl.d.ts.map +0 -1
  148. package/dist/src/text/FontPipeline.d.ts +0 -13
  149. package/dist/src/text/FontPipeline.d.ts.map +0 -1
  150. package/dist/src/text/MsdfFont.d.ts +0 -81
  151. package/dist/src/text/MsdfFont.d.ts.map +0 -1
  152. package/dist/src/text/TextFormatting.d.ts +0 -18
  153. package/dist/src/text/TextFormatting.d.ts.map +0 -1
  154. package/dist/src/text/TextNode.d.ts +0 -18
  155. package/dist/src/text/TextNode.d.ts.map +0 -1
  156. package/dist/src/text/TextShader.d.ts +0 -14
  157. package/dist/src/text/TextShader.d.ts.map +0 -1
  158. package/dist/src/text/mod.d.ts +0 -3
  159. package/dist/src/text/mod.d.ts.map +0 -1
  160. package/dist/src/text/shaping.d.ts +0 -38
  161. package/dist/src/text/shaping.d.ts.map +0 -1
  162. package/dist/src/text/text.wgsl.d.ts +0 -2
  163. package/dist/src/text/text.wgsl.d.ts.map +0 -1
  164. package/dist/src/textures/AssetManager.d.ts +0 -181
  165. package/dist/src/textures/AssetManager.d.ts.map +0 -1
  166. package/dist/src/textures/NewTextureComputeShader.d.ts +0 -28
  167. package/dist/src/textures/TextureComputeShader.d.ts +0 -20
  168. package/dist/src/textures/TextureComputeShader.d.ts.map +0 -1
  169. package/dist/src/textures/crop.wgsl.d.ts +0 -2
  170. package/dist/src/textures/mod.d.ts +0 -1
  171. package/dist/src/textures/mod.d.ts.map +0 -1
  172. package/dist/src/textures/pixel-scraping.wgsl.d.ts +0 -2
  173. package/dist/src/textures/pixel-scraping.wgsl.d.ts.map +0 -1
  174. package/dist/src/textures/texture-processing.wgsl.d.ts +0 -2
  175. package/dist/src/textures/types.d.ts +0 -176
  176. package/dist/src/textures/types.d.ts.map +0 -1
  177. package/dist/src/textures/util.d.ts +0 -7
  178. package/dist/src/textures/util.d.ts.map +0 -1
  179. package/dist/src/utils/assert.d.ts +0 -1
  180. package/dist/src/utils/assert.d.ts.map +0 -1
  181. package/dist/src/utils/boilerplate.d.ts +0 -10
  182. package/dist/src/utils/boilerplate.d.ts.map +0 -1
  183. package/dist/src/utils/error.d.ts +0 -7
  184. package/dist/src/utils/error.d.ts.map +0 -1
  185. package/dist/src/utils/mod.d.ts +0 -2
  186. package/dist/src/utils/mod.d.ts.map +0 -1
  187. package/dist/src/utils/pool.d.ts +0 -22
  188. package/dist/src/utils/pool.d.ts.map +0 -1
  189. package/dist/test/math/matrix.test.d.ts +0 -1
  190. package/dist/test/scene/Batcher.test.d.ts +0 -1
  191. package/dist/test/scene/SceneNode.test.d.ts +0 -1
  192. package/dist/test/shader/parser.test.d.ts +0 -1
@@ -1,6 +0,0 @@
1
- export type Color = {
2
- r: number;
3
- g: number;
4
- b: number;
5
- a: number;
6
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../../src/coreTypes/Color.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC"}
@@ -1,7 +0,0 @@
1
- /**
2
- * A point in 2D space
3
- */
4
- export type Point = {
5
- x: number;
6
- y: number;
7
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"Point.d.ts","sourceRoot":"","sources":["../../../src/coreTypes/Point.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC"}
@@ -1,4 +0,0 @@
1
- export type Size = {
2
- width: number;
3
- height: number;
4
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"Size.d.ts","sourceRoot":"","sources":["../../../src/coreTypes/Size.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
@@ -1,15 +0,0 @@
1
- import type { Point } from "./Point";
2
- import type { Size } from "./Size";
3
- import type { Vec2 } from "./Vec2";
4
- export type Transform = {
5
- position: Point;
6
- scale: Vec2;
7
- rotation: number;
8
- /**
9
- * width and height of the quad
10
- *
11
- * these are multiplied with scale for rendering
12
- * but they are not used to calculate child transforms
13
- */
14
- size: Size;
15
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"Transform.d.ts","sourceRoot":"","sources":["../../../src/coreTypes/Transform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,EAAE,KAAK,CAAC;IAChB,KAAK,EAAE,IAAI,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC"}
@@ -1,7 +0,0 @@
1
- /**
2
- * A vector in 2D space
3
- */
4
- export type Vec2 = {
5
- x: number;
6
- y: number;
7
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"Vec2.d.ts","sourceRoot":"","sources":["../../../src/coreTypes/Vec2.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC"}
@@ -1,5 +0,0 @@
1
- export type * from "./Color";
2
- export type * from "./Point";
3
- export type * from "./Size";
4
- export type * from "./Transform";
5
- export type * from "./Vec2";
@@ -1 +0,0 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/coreTypes/mod.ts"],"names":[],"mappings":"AAAA,mBAAmB,SAAS,CAAC;AAC7B,mBAAmB,QAAQ,CAAC;AAC5B,mBAAmB,aAAa,CAAC;AACjC,mBAAmB,QAAQ,CAAC;AAC5B,mBAAmB,SAAS,CAAC"}
@@ -1,22 +0,0 @@
1
- export declare const DEFAULT_LIMITS: {
2
- /** Maximum number of rendered instances in the scene per frame */
3
- instanceCount: number;
4
- /** Maximum number of unique z-indexes in the scene */
5
- zIndex: number;
6
- /** Maximum number of vfx shaders */
7
- shaderCount: number;
8
- /** Maximum dimensions of a single texture */
9
- textureSize: number;
10
- /** Maximum number of layers in a texture array */
11
- textureArrayLayers: number;
12
- /** Maximum size of uniforms buffer */
13
- uniformBufferSize: number;
14
- /** Maximum number of instance buffer fields - 16 minus the vertex locations used by the engine */
15
- instanceBufferFields: number;
16
- /** Maximum size of instance buffer */
17
- instanceBufferSize: number;
18
- /** Maximum length of a single piece of text */
19
- maxTextLength: number;
20
- };
21
- export type Limits = typeof DEFAULT_LIMITS;
22
- export type LimitsOptions = Partial<Limits>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../src/limits.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;IACzB,kEAAkE;;IAElE,sDAAsD;;IAEtD,oCAAoC;;IAEpC,6CAA6C;;IAE7C,kDAAkD;;IAElD,sCAAsC;;IAEtC,kGAAkG;;IAElG,sCAAsC;;IAEtC,+CAA+C;;CAEhD,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,OAAO,cAAc,CAAC;AAC3C,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Convert degrees to radians
3
- * @param degrees Angle in degrees
4
- * @returns Angle in radians
5
- */
6
- export declare function deg2rad(degrees: number): number;
7
- /**
8
- * Convert radians to degrees
9
- * @param radians Angle in radians
10
- * @returns Angle in degrees
11
- */
12
- export declare function rad2deg(radians: number): number;
@@ -1 +0,0 @@
1
- {"version":3,"file":"angle.d.ts","sourceRoot":"","sources":["../../../src/math/angle.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE/C"}
@@ -1,25 +0,0 @@
1
- import { type Mat3 } from "wgpu-matrix";
2
- import type { Point } from "../coreTypes/Point";
3
- import type { Transform } from "../coreTypes/Transform";
4
- import type { Camera } from "../scene/Camera";
5
- import type { Resolution } from "../screen/resolution";
6
- /**
7
- * Creates a projection matrix for the given resolution.
8
- * The matrix is a 3x3 matrix that converts screen coordinates centered at the origin ranging from:
9
- *
10
- * (-resolution.width / 2, resolution.height / 2) = top left corner to (resolution.width / 2, -resolution.height / 2) = bottom right corner
11
- *
12
- * into clip space centered at the originranging from:
13
- *
14
- * (-1, 1) = top left corner to (1, -1) = bottom right corner
15
- *
16
- * @param resolution - The resolution of the screen in logical pixels.
17
- * @param dst - The destination matrix.
18
- * @returns The projection matrix.
19
- */
20
- export declare function createProjectionMatrix(resolution: Resolution, dst?: Mat3): Float32Array<ArrayBufferLike>;
21
- export declare function createViewMatrix(camera: Camera, target: Mat3): Float32Array<ArrayBufferLike>;
22
- export declare function createModelMatrix(transform: Transform, base: Mat3): Float32Array<ArrayBufferLike>;
23
- export declare function convertScreenToWorld(screenCoordinates: Point, camera: Camera, projectionMatrix: Mat3, resolution: Resolution): Point;
24
- export declare function convertWorldToScreen(worldCoordinates: Point, camera: Camera, projectionMatrix: Mat3, resolution: Resolution): Point;
25
- export declare function transformPoint(point: Point, matrix: Mat3): Point;
@@ -1 +0,0 @@
1
- {"version":3,"file":"matrix.d.ts","sourceRoot":"","sources":["../../../src/math/matrix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,IAAI,iCASxE;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,iCAa5D;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,iCAUjE;AAED,wBAAgB,oBAAoB,CAClC,iBAAiB,EAAE,KAAK,EACxB,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,IAAI,EACtB,UAAU,EAAE,UAAU,GACrB,KAAK,CAaP;AAED,wBAAgB,oBAAoB,CAClC,gBAAgB,EAAE,KAAK,EACvB,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,IAAI,EACtB,UAAU,EAAE,UAAU,GACrB,KAAK,CAOP;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAG,KAAK,CAMhE"}
@@ -1,2 +0,0 @@
1
- export * from "./angle";
2
- export * from "./matrix";
@@ -1 +0,0 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/math/mod.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
package/dist/src/mod.d.ts DELETED
@@ -1,16 +0,0 @@
1
- export type * from "./coreTypes/mod";
2
- export type * from "./scene/QuadNode";
3
- export type * from "./scene/SceneNode";
4
- export type * from "./shaders/QuadShader";
5
- export type * from "./text/TextNode";
6
- export * from "./limits";
7
- export * from "./Toodle";
8
- export * as Colors from "./colors/mod";
9
- export * as GfxMath from "./math/mod";
10
- export * as Scene from "./scene/mod";
11
- export * as Screen from "./screen/mod";
12
- export * as Shaders from "./shaders/mod";
13
- export * as Text from "./text/mod";
14
- export * as Textures from "./textures/mod";
15
- export * as Utils from "./utils/mod";
16
- export { AssetManager } from "./textures/AssetManager";
@@ -1 +0,0 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/mod.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AAEzB,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,OAAO,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,mBAAmB,iBAAiB,CAAC;AAErC,mBAAmB,mBAAmB,CAAC;AACvC,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,sBAAsB,CAAC"}
@@ -1,10 +0,0 @@
1
- import type { Color } from "./coreTypes/Color";
2
- export declare function postProcess(encoder: GPUCommandEncoder, context: GPUCanvasContext, device: GPUDevice, clearColor: Color, presentationFormat: GPUTextureFormat, pingpong: [GPUTexture, GPUTexture]): void;
3
- type PostProcess = {
4
- pipeline: GPURenderPipeline;
5
- bindGroups: GPUBindGroup[];
6
- };
7
- export declare function none(device: GPUDevice, presentationFormat: GPUTextureFormat, pingpong: [GPUTexture, GPUTexture]): PostProcess;
8
- export declare function crtScanLines(device: GPUDevice, presentationFormat: GPUTextureFormat, pingpong: [GPUTexture, GPUTexture]): PostProcess;
9
- export {};
10
- //# sourceMappingURL=postprocess.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"postprocess.d.ts","sourceRoot":"","sources":["../../src/postprocess.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,wBAAgB,WAAW,CACzB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,KAAK,EACjB,kBAAkB,EAAE,gBAAgB,EACpC,QAAQ,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,QAuDnC;AAED,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,UAAU,EAAE,YAAY,EAAE,CAAC;CAC5B,CAAC;AAEF,wBAAgB,IAAI,CAClB,MAAM,EAAE,SAAS,EACjB,kBAAkB,EAAE,gBAAgB,EACpC,QAAQ,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,GACjC,WAAW,CA6Eb;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,SAAS,EACjB,kBAAkB,EAAE,gBAAgB,EACpC,QAAQ,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,GACjC,WAAW,CAoFb"}
@@ -1,19 +0,0 @@
1
- import type { IShader } from "../shaders/IShader";
2
- import type { SceneNode } from "./SceneNode";
3
- type Layer = {
4
- z: number;
5
- pipelines: Pipeline[];
6
- };
7
- export type Pipeline<TNode extends SceneNode = SceneNode> = {
8
- shader: IShader;
9
- nodes: TNode[];
10
- };
11
- export declare class Batcher {
12
- #private;
13
- nodes: SceneNode[];
14
- layers: Layer[];
15
- pipelines: Pipeline[];
16
- enqueue(node: SceneNode): void;
17
- flush(): void;
18
- }
19
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"Batcher.d.ts","sourceRoot":"","sources":["../../../src/scene/Batcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,KAAK,KAAK,GAAG;IACX,CAAC,EAAE,MAAM,CAAC;IACV,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,QAAQ,CAAC,KAAK,SAAS,SAAS,GAAG,SAAS,IAAI;IAC1D,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,KAAK,EAAE,CAAC;CAChB,CAAC;AAEF,qBAAa,OAAO;;IAClB,KAAK,EAAE,SAAS,EAAE,CAAM;IACxB,MAAM,EAAE,KAAK,EAAE,CAAM;IACrB,SAAS,EAAE,QAAQ,EAAE,CAAM;IAE3B,OAAO,CAAC,IAAI,EAAE,SAAS;IAiBvB,KAAK;CAyBN"}
@@ -1,15 +0,0 @@
1
- export declare class Camera {
2
- #private;
3
- get zoom(): number;
4
- set zoom(value: number);
5
- get rotation(): number;
6
- set rotation(value: number);
7
- get rotationRadians(): number;
8
- set rotationRadians(value: number);
9
- get x(): number;
10
- get y(): number;
11
- set x(value: number);
12
- set y(value: number);
13
- get matrix(): Float32Array<ArrayBufferLike>;
14
- setDirty(): void;
15
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"Camera.d.ts","sourceRoot":"","sources":["../../../src/scene/Camera.ts"],"names":[],"mappings":"AAKA,qBAAa,MAAM;;IAOjB,IAAI,IAAI,IAIQ,MAAM,CAFrB;IAED,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAGrB;IAED,IAAI,QAAQ,IAIQ,MAAM,CAFzB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,MAAM,EAGzB;IAED,IAAI,eAAe,IAIQ,MAAM,CAFhC;IAED,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,EAGhC;IAED,IAAI,CAAC,IAQQ,MAAM,CANlB;IAED,IAAI,CAAC,IASQ,MAAM,CAPlB;IAED,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,EAGlB;IAED,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,EAGlB;IAED,IAAI,MAAM,kCAMT;IAED,QAAQ;CAGT"}
@@ -1,28 +0,0 @@
1
- import { type Mat3 } from "wgpu-matrix";
2
- import type { Size } from "../coreTypes/Size";
3
- import type { Vec2 } from "../coreTypes/Vec2";
4
- import type { TextureId } from "../textures/AssetManager";
5
- import type { AtlasCoords } from "../textures/types";
6
- import type { Pool } from "../utils/pool";
7
- import { QuadNode, type QuadOptions } from "./QuadNode";
8
- export type JumboTileDef = Required<JumboTileOptions>;
9
- export type JumboTileOptions = {
10
- /** Texture id of the tile */
11
- textureId: TextureId;
12
- /** The offset of this tile in texels from the top left of the full texture */
13
- offset: Vec2;
14
- /** The size of the tile in texels. If not provided, the size will be inferred from the texture atlas. */
15
- size?: Size;
16
- /** The coordinates of the tile in the texture atlas. If not provided, the size will be read from the loaded texture. */
17
- atlasCoords?: AtlasCoords;
18
- };
19
- export type JumboQuadOptions = Omit<QuadOptions, "atlasCoords"> & {
20
- tiles: JumboTileOptions[];
21
- };
22
- export declare class JumboQuadNode extends QuadNode {
23
- #private;
24
- constructor(options: JumboQuadOptions, matrixPool: Pool<Mat3>);
25
- get atlasCoords(): AtlasCoords;
26
- get tiles(): JumboTileDef[];
27
- getTileMatrix(tile: JumboTileDef): Float32Array<ArrayBufferLike>;
28
- }
@@ -1,158 +0,0 @@
1
- import { type Mat3 } from "wgpu-matrix";
2
- import type { Color } from "../coreTypes/Color";
3
- import type { Size } from "../coreTypes/Size";
4
- import type { Vec2 } from "../coreTypes/Vec2";
5
- import type { IShader } from "../shaders/IShader";
6
- import type { AssetManager, TextureId } from "../textures/AssetManager";
7
- import type { AtlasCoords, TexelRegion } from "../textures/types";
8
- import type { Pool } from "../utils/pool";
9
- import { type NodeOptions, SceneNode } from "./SceneNode";
10
- /**
11
- * A node in the scene graph that renders a textured quad.
12
- *
13
- * This is a base class and is fairly low level. You will probably want to interact with
14
- * the wrapper class {@link Toodle.Quad} instead.
15
- */
16
- export declare class QuadNode extends SceneNode {
17
- #private;
18
- assetManager: AssetManager;
19
- constructor(options: QuadOptions, matrixPool: Pool<Mat3>);
20
- /**
21
- * The tint color of the quad.
22
- * When drawing shapes, this will be the fill color.
23
- * When drawing textures, this will be the color multiplier by default.
24
- * You can also use this value in fragment shaders by referencing `vertex.engine_tint`
25
- */
26
- get color(): Color;
27
- set color(value: Color);
28
- /**
29
- * The size of the quad. See https://toodle.gg/f849595b3ed13fc956fc1459a5cb5f0228f9d259/examples/quad-size-scale.html
30
- */
31
- get size(): Size;
32
- /**
33
- * This is the final model matrix used to render the quad, which
34
- * may differ from the matrix passed down to the node's children.
35
- * Properties like `flipX` and `flipY` or `size` are applied here but not inherited by children.
36
- */
37
- get matrixWithSize(): Float32Array<ArrayBufferLike>;
38
- /**
39
- * The atlas coordinates for the quad. These determine the region in the texture atlas
40
- * that is sampled for rendering in normalized uv space.
41
- */
42
- get atlasCoords(): AtlasCoords;
43
- /**
44
- * A subregion of the texture to render.
45
- * This is useful for rendering a single sprite from a spritesheet for instance.
46
- * It defaults to the full texture.
47
- */
48
- get region(): TexelRegion;
49
- get writeInstance(): ((array: Float32Array, offset: number) => void) | undefined;
50
- /**
51
- * Whether the image is mirrored horizontally.
52
- *
53
- * `true` means the image is mirrored (equivalent to a scale.x of -1),
54
- * `false` means it is not mirrored.
55
- */
56
- get flipX(): boolean;
57
- /**
58
- * Sets whether the image is mirrored horizontally.
59
- *
60
- * `true` mirrors the image (equivalent to a scale.x of -1),
61
- * `false` restores normal orientation.
62
- */
63
- set flipX(value: boolean);
64
- /**
65
- * Whether the image is mirrored vertically.
66
- *
67
- * `true` means the image is mirrored (equivalent to a scale.y of -1),
68
- * `false` means it is not mirrored.
69
- */
70
- get flipY(): boolean;
71
- /**
72
- * Sets whether the image is mirrored vertically.
73
- *
74
- * `true` mirrors the image (equivalent to a scale.y of -1),
75
- * `false` restores normal orientation.
76
- */
77
- set flipY(value: boolean);
78
- /**
79
- * The drawing offset of the texture.
80
- * This can be used to offset the texture from the origin of the quad.
81
- */
82
- get cropOffset(): Vec2;
83
- /**
84
- * The drawing offset of the texture.
85
- * This can be used to offset the texture from the origin of the quad.
86
- */
87
- set cropOffset(value: Vec2);
88
- get textureId(): string;
89
- /**
90
- * Whether this quad is rendering a primitive shape like a line or a circle/rect.
91
- */
92
- get isPrimitive(): boolean;
93
- /**
94
- * Whether this quad is rendering a circle.
95
- */
96
- get isCircle(): boolean;
97
- extra: {
98
- /**
99
- * Sets the atlas coords for the quad. This is for advanced use cases and by default these are
100
- * set automatically to reference the right texture atlas region.
101
- * @param value - The new atlas coords.
102
- */
103
- setAtlasCoords: (value: AtlasCoords) => void;
104
- /**
105
- * Returns the crop ratio for the quad. This is the relative difference in size
106
- * between the cropped and uncropped texture, and will be 1 if the quad has no transparent pixels
107
- * or if it is loaded without cropping..
108
- */
109
- cropRatio: () => Size;
110
- /**
111
- * Returns the size of the texture atlas in texels, by default this is 4096x4096
112
- */
113
- atlasSize: () => Size;
114
- };
115
- }
116
- export type QuadOptions = NodeOptions & {
117
- textureId?: TextureId;
118
- /**
119
- * A subregion of the texture to render.
120
- * This is useful for rendering a single sprite from a spritesheet for instance.
121
- * It defaults to the full texture.
122
- */
123
- region?: TexelRegion;
124
- /**
125
- * Atlas coordinates are almost always set by toodle and the asset manager.
126
- * For advanced use cases, you can set these yourself to control what uvs are sampled
127
- * from the texture atlas.
128
- */
129
- atlasCoords?: AtlasCoords;
130
- assetManager?: AssetManager;
131
- shader?: IShader;
132
- writeInstance?: (array: Float32Array, offset: number) => void;
133
- color?: Color;
134
- /**
135
- * flipX mirrors the image horizontally (equivalent to a scale.x multiplication
136
- * by -1) but allows for independent scaling
137
- */
138
- flipX?: boolean;
139
- /**
140
- * flipY mirrors the image vertically (equivalent to a scale.y multiplication
141
- * by -1) but allows for independent scaling
142
- */
143
- flipY?: boolean;
144
- /**
145
- * The offset of the cropped texture from the original texture
146
- * If uncropped, this will be 0,0
147
- */
148
- cropOffset?: Vec2;
149
- /**
150
- * The size of the texture atlas in texels. This is almost always set by toodle.
151
- */
152
- atlasSize?: Size;
153
- /**
154
- * The matrix pool to use for the quad.
155
- * This is used to avoid creating new matrices for each quad.
156
- */
157
- matrixPool?: Pool<Mat3>;
158
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"QuadNode.d.ts","sourceRoot":"","sources":["../../../src/scene/QuadNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAQ,MAAM,aAAa,CAAC;AAE9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,KAAK,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAe1D;;;;;GAKG;AACH,qBAAa,QAAS,SAAQ,SAAS;;gBAqBzB,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC;IAmExD;;;;;OAKG;IACH,IAAI,KAAK,IAIQ,KAAK,CAFrB;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,KAAK,EAErB;IAED;;OAEG;IACH,IAAI,IAAI,SAMP;IAED;;;;OAIG;IACH,IAAI,cAAc,kCASjB;IAED;;;OAGG;IACH,IAAI,WAAW,gBAEd;IAED;;;;OAIG;IACH,IAAI,MAAM,gBAET;IAED,IAAI,aAAa,aA/HQ,YAAY,UAAU,MAAM,KAAK,IAAI,cAiI7D;IAED;;;;;OAKG;IACH,IAAI,KAAK,IAAI,OAAO,CAEnB;IAED;;;;;OAKG;IACH,IAAI,KAAK,CAAC,KAAK,EAAE,OAAO,EAGvB;IAED;;;;;OAKG;IACH,IAAI,KAAK,IAAI,OAAO,CAEnB;IAED;;;;;OAKG;IACH,IAAI,KAAK,CAAC,KAAK,EAAE,OAAO,EAGvB;IAED;;;OAGG;IACH,IAAI,UAAU,IAAI,IAAI,CAErB;IAED;;;OAGG;IACH,IAAI,UAAU,CAAC,KAAK,EAAE,IAAI,EAEzB;IAED,IAAI,SAAS,WAEZ;IAED;;OAEG;IACH,IAAI,WAAW,YAEd;IAED;;OAEG;IACH,IAAI,QAAQ,YAEX;IAED,KAAK;QACH;;;;WAIG;gCACqB,WAAW;QAInC;;;;WAIG;;QAKH;;WAEG;;MAIH;CACH;AAED,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG;IACtC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9D,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;IAEjB;;;OAGG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;CACzB,CAAC"}
@@ -1,10 +0,0 @@
1
- import type { IShader } from "../shaders/IShader";
2
- import type { SceneNode } from "./SceneNode";
3
- export type RenderComponent = {
4
- shader: IShader;
5
- data?: Float32Array;
6
- /**
7
- * Write cpu instance data to the buffer. Returns number of instances written
8
- */
9
- writeInstance: (node: SceneNode, dst: Float32Array, offset: number) => number;
10
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"RenderComponent.d.ts","sourceRoot":"","sources":["../../../src/scene/RenderComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,YAAY,CAAC;IAEpB;;OAEG;IACH,aAAa,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7E,CAAC"}