@bloopjs/toodle 0.0.100
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.
- package/LICENSE +21 -0
- package/README.md +44 -0
- package/dist/Toodle.d.ts +304 -0
- package/dist/Toodle.d.ts.map +1 -0
- package/dist/colors/mod.d.ts +872 -0
- package/dist/colors/mod.d.ts.map +1 -0
- package/dist/coreTypes/Color.d.ts +7 -0
- package/dist/coreTypes/Color.d.ts.map +1 -0
- package/dist/coreTypes/Point.d.ts +8 -0
- package/dist/coreTypes/Point.d.ts.map +1 -0
- package/dist/coreTypes/Size.d.ts +5 -0
- package/dist/coreTypes/Size.d.ts.map +1 -0
- package/dist/coreTypes/Transform.d.ts +16 -0
- package/dist/coreTypes/Transform.d.ts.map +1 -0
- package/dist/coreTypes/Vec2.d.ts +8 -0
- package/dist/coreTypes/Vec2.d.ts.map +1 -0
- package/dist/coreTypes/mod.d.ts +6 -0
- package/dist/coreTypes/mod.d.ts.map +1 -0
- package/dist/docs/snippets/add-remove-children.d.ts +1 -0
- package/dist/docs/snippets/basic-quad.d.ts +1 -0
- package/dist/docs/snippets/filter-linear.d.ts +1 -0
- package/dist/docs/snippets/filter-nearest.d.ts +1 -0
- package/dist/docs/snippets/flipxy.d.ts +1 -0
- package/dist/docs/snippets/hello-text.d.ts +1 -0
- package/dist/docs/snippets/jumbo-textures.d.ts +1 -0
- package/dist/docs/snippets/layer.d.ts +1 -0
- package/dist/docs/snippets/layout-edges.d.ts +1 -0
- package/dist/docs/snippets/layout-screen-and-world-space.d.ts +1 -0
- package/dist/docs/snippets/postprocess.d.ts +1 -0
- package/dist/docs/snippets/quad-size-scale.d.ts +1 -0
- package/dist/docs/snippets/quickstart.d.ts +1 -0
- package/dist/docs/snippets/repeat-texture-loading.d.ts +1 -0
- package/dist/docs/snippets/screen-shaders.d.ts +1 -0
- package/dist/docs/snippets/shader-color-flash.d.ts +1 -0
- package/dist/docs/snippets/shader-default.d.ts +1 -0
- package/dist/docs/snippets/shader-fill.d.ts +1 -0
- package/dist/docs/snippets/shapes-line.d.ts +1 -0
- package/dist/docs/snippets/sprite-region.d.ts +1 -0
- package/dist/docs/snippets/text-alignment.d.ts +1 -0
- package/dist/docs/snippets/text-shrink-to-fit.d.ts +1 -0
- package/dist/docs/snippets/text-word-wrap.d.ts +1 -0
- package/dist/docs/snippets/texture-bundles-prebaked.d.ts +1 -0
- package/dist/docs/snippets/texture-bundles.d.ts +1 -0
- package/dist/docs/snippets/transforms.d.ts +1 -0
- package/dist/docs/snippets/transparent-cropping.d.ts +1 -0
- package/dist/examples/0-hello.d.ts +1 -0
- package/dist/examples/1-hello.d.ts +1 -0
- package/dist/examples/1-hello.d.ts.map +1 -0
- package/dist/examples/1-quad.d.ts +1 -0
- package/dist/examples/10-resize.d.ts +1 -0
- package/dist/examples/10-resize.d.ts.map +1 -0
- package/dist/examples/11-bundle-test.d.ts +1 -0
- package/dist/examples/11-bundle-test.d.ts.map +1 -0
- package/dist/examples/12-transparent-pixel-cropping.d.ts +1 -0
- package/dist/examples/12-transparent-pixel-cropping.d.ts.map +1 -0
- package/dist/examples/13-crop.d.ts +1 -0
- package/dist/examples/13-crop.d.ts.map +1 -0
- package/dist/examples/14-bundle-bench.d.ts +1 -0
- package/dist/examples/14-bundle-bench.d.ts.map +1 -0
- package/dist/examples/15-text-layer.d.ts +1 -0
- package/dist/examples/15-text-layer.d.ts.map +1 -0
- package/dist/examples/16-jumbo-texture.d.ts +1 -0
- package/dist/examples/16-jumbo-textures.d.ts +1 -0
- package/dist/examples/16-screen-shader.d.ts +1 -0
- package/dist/examples/16-screen-shader.d.ts.map +1 -0
- package/dist/examples/17-lighting.d.ts +1 -0
- package/dist/examples/17-lighting.d.ts.map +1 -0
- package/dist/examples/17-translations.d.ts +1 -0
- package/dist/examples/18-blur.d.ts +1 -0
- package/dist/examples/19-postprocess.d.ts +1 -0
- package/dist/examples/19-screenshader.d.ts +1 -0
- package/dist/examples/2-shapes.d.ts +1 -0
- package/dist/examples/2-shapes.d.ts.map +1 -0
- package/dist/examples/3-shader.d.ts +1 -0
- package/dist/examples/3-shader.d.ts.map +1 -0
- package/dist/examples/4-shader-bench.d.ts +1 -0
- package/dist/examples/4-shader-bench.d.ts.map +1 -0
- package/dist/examples/5-z.d.ts +1 -0
- package/dist/examples/5-z.d.ts.map +1 -0
- package/dist/examples/6-atlas.d.ts +1 -0
- package/dist/examples/6-atlas.d.ts.map +1 -0
- package/dist/examples/7-text.d.ts +1 -0
- package/dist/examples/7-text.d.ts.map +1 -0
- package/dist/examples/8-text-bench.d.ts +1 -0
- package/dist/examples/8-text-bench.d.ts.map +1 -0
- package/dist/examples/9-alignment.d.ts +1 -0
- package/dist/examples/9-alignment.d.ts.map +1 -0
- package/dist/examples/main.d.ts +1 -0
- package/dist/examples/main.d.ts.map +1 -0
- package/dist/examples/util.d.ts +82 -0
- package/dist/examples/util.d.ts.map +1 -0
- package/dist/limits.d.ts +23 -0
- package/dist/limits.d.ts.map +1 -0
- package/dist/math/angle.d.ts +13 -0
- package/dist/math/angle.d.ts.map +1 -0
- package/dist/math/matrix.d.ts +26 -0
- package/dist/math/matrix.d.ts.map +1 -0
- package/dist/math/mod.d.ts +3 -0
- package/dist/math/mod.d.ts.map +1 -0
- package/dist/mod.d.ts +17 -0
- package/dist/mod.d.ts.map +1 -0
- package/dist/mod.js +19665 -0
- package/dist/mod.js.map +41 -0
- package/dist/postprocess.d.ts +10 -0
- package/dist/postprocess.d.ts.map +1 -0
- package/dist/scene/Batcher.d.ts +20 -0
- package/dist/scene/Batcher.d.ts.map +1 -0
- package/dist/scene/Camera.d.ts +16 -0
- package/dist/scene/Camera.d.ts.map +1 -0
- package/dist/scene/JumboQuadNode.d.ts +29 -0
- package/dist/scene/JumboQuadNode.d.ts.map +1 -0
- package/dist/scene/QuadNode.d.ts +159 -0
- package/dist/scene/QuadNode.d.ts.map +1 -0
- package/dist/scene/RenderComponent.d.ts +11 -0
- package/dist/scene/RenderComponent.d.ts.map +1 -0
- package/dist/scene/SceneNode.d.ts +300 -0
- package/dist/scene/SceneNode.d.ts.map +1 -0
- package/dist/scene/mod.d.ts +5 -0
- package/dist/scene/mod.d.ts.map +1 -0
- package/dist/screen/mod.d.ts +2 -0
- package/dist/screen/mod.d.ts.map +1 -0
- package/dist/screen/resolution.d.ts +5 -0
- package/dist/screen/resolution.d.ts.map +1 -0
- package/dist/shaders/EngineUniform.d.ts +9 -0
- package/dist/shaders/EngineUniform.d.ts.map +1 -0
- package/dist/shaders/IShader.d.ts +15 -0
- package/dist/shaders/IShader.d.ts.map +1 -0
- package/dist/shaders/QuadShader.d.ts +18 -0
- package/dist/shaders/QuadShader.d.ts.map +1 -0
- package/dist/shaders/ShaderDescriptor.d.ts +7 -0
- package/dist/shaders/ShaderDescriptor.d.ts.map +1 -0
- package/dist/shaders/mod.d.ts +6 -0
- package/dist/shaders/mod.d.ts.map +1 -0
- package/dist/shaders/parser.d.ts +8 -0
- package/dist/shaders/parser.d.ts.map +1 -0
- package/dist/shaders/postprocess/blur.d.ts +3 -0
- package/dist/shaders/postprocess/blur.d.ts.map +1 -0
- package/dist/shaders/postprocess/mod.d.ts +17 -0
- package/dist/shaders/postprocess/mod.d.ts.map +1 -0
- package/dist/shaders/samplers.d.ts +3 -0
- package/dist/shaders/samplers.d.ts.map +1 -0
- package/dist/shaders/wgsl/example.wgsl.d.ts +3 -0
- package/dist/shaders/wgsl/example.wgsl.d.ts.map +1 -0
- package/dist/shaders/wgsl/hello.wgsl.d.ts +3 -0
- package/dist/shaders/wgsl/hello.wgsl.d.ts.map +1 -0
- package/dist/shaders/wgsl/helloInstanced.wgsl.d.ts +3 -0
- package/dist/shaders/wgsl/helloInstanced.wgsl.d.ts.map +1 -0
- package/dist/shaders/wgsl/quad.wgsl.d.ts +3 -0
- package/dist/shaders/wgsl/quad.wgsl.d.ts.map +1 -0
- package/dist/src/Toodle.d.ts +303 -0
- package/dist/src/Toodle.d.ts.map +1 -0
- package/dist/src/colors/mod.d.ts +871 -0
- package/dist/src/coreTypes/Color.d.ts +6 -0
- package/dist/src/coreTypes/Color.d.ts.map +1 -0
- package/dist/src/coreTypes/Point.d.ts +7 -0
- package/dist/src/coreTypes/Point.d.ts.map +1 -0
- package/dist/src/coreTypes/Size.d.ts +4 -0
- package/dist/src/coreTypes/Size.d.ts.map +1 -0
- package/dist/src/coreTypes/Transform.d.ts +15 -0
- package/dist/src/coreTypes/Transform.d.ts.map +1 -0
- package/dist/src/coreTypes/Vec2.d.ts +7 -0
- package/dist/src/coreTypes/Vec2.d.ts.map +1 -0
- package/dist/src/coreTypes/mod.d.ts +5 -0
- package/dist/src/coreTypes/mod.d.ts.map +1 -0
- package/dist/src/limits.d.ts +22 -0
- package/dist/src/limits.d.ts.map +1 -0
- package/dist/src/math/angle.d.ts +12 -0
- package/dist/src/math/angle.d.ts.map +1 -0
- package/dist/src/math/matrix.d.ts +25 -0
- package/dist/src/math/matrix.d.ts.map +1 -0
- package/dist/src/math/mod.d.ts +2 -0
- package/dist/src/math/mod.d.ts.map +1 -0
- package/dist/src/mod.d.ts +16 -0
- package/dist/src/mod.d.ts.map +1 -0
- package/dist/src/postprocess.d.ts +10 -0
- package/dist/src/postprocess.d.ts.map +1 -0
- package/dist/src/scene/Batcher.d.ts +19 -0
- package/dist/src/scene/Batcher.d.ts.map +1 -0
- package/dist/src/scene/Camera.d.ts +15 -0
- package/dist/src/scene/Camera.d.ts.map +1 -0
- package/dist/src/scene/JumboQuadNode.d.ts +28 -0
- package/dist/src/scene/QuadNode.d.ts +158 -0
- package/dist/src/scene/QuadNode.d.ts.map +1 -0
- package/dist/src/scene/RenderComponent.d.ts +10 -0
- package/dist/src/scene/RenderComponent.d.ts.map +1 -0
- package/dist/src/scene/SceneNode.d.ts +299 -0
- package/dist/src/scene/SceneNode.d.ts.map +1 -0
- package/dist/src/scene/mod.d.ts +4 -0
- package/dist/src/scene/mod.d.ts.map +1 -0
- package/dist/src/screen/mod.d.ts +1 -0
- package/dist/src/screen/mod.d.ts.map +1 -0
- package/dist/src/screen/resolution.d.ts +4 -0
- package/dist/src/screen/resolution.d.ts.map +1 -0
- package/dist/src/shaders/EngineUniform.d.ts +8 -0
- package/dist/src/shaders/EngineUniform.d.ts.map +1 -0
- package/dist/src/shaders/IShader.d.ts +14 -0
- package/dist/src/shaders/IShader.d.ts.map +1 -0
- package/dist/src/shaders/QuadShader.d.ts +17 -0
- package/dist/src/shaders/QuadShader.d.ts.map +1 -0
- package/dist/src/shaders/ShaderDescriptor.d.ts +6 -0
- package/dist/src/shaders/ShaderDescriptor.d.ts.map +1 -0
- package/dist/src/shaders/mod.d.ts +5 -0
- package/dist/src/shaders/mod.d.ts.map +1 -0
- package/dist/src/shaders/parser.d.ts +7 -0
- package/dist/src/shaders/parser.d.ts.map +1 -0
- package/dist/src/shaders/postprocess/blur.d.ts +2 -0
- package/dist/src/shaders/postprocess/mod.d.ts +16 -0
- package/dist/src/shaders/postprocess/postprocess.d.ts +8 -0
- package/dist/src/shaders/postprocess/util.d.ts +2 -0
- package/dist/src/shaders/samplers.d.ts +2 -0
- package/dist/src/shaders/samplers.d.ts.map +1 -0
- package/dist/src/shaders/wgsl/example.wgsl.d.ts +2 -0
- package/dist/src/shaders/wgsl/example.wgsl.d.ts.map +1 -0
- package/dist/src/shaders/wgsl/hello.wgsl.d.ts +2 -0
- package/dist/src/shaders/wgsl/hello.wgsl.d.ts.map +1 -0
- package/dist/src/shaders/wgsl/helloInstanced.wgsl.d.ts +2 -0
- package/dist/src/shaders/wgsl/helloInstanced.wgsl.d.ts.map +1 -0
- package/dist/src/shaders/wgsl/quad.wgsl.d.ts +2 -0
- package/dist/src/shaders/wgsl/quad.wgsl.d.ts.map +1 -0
- package/dist/src/text/FontPipeline.d.ts +13 -0
- package/dist/src/text/FontPipeline.d.ts.map +1 -0
- package/dist/src/text/MsdfFont.d.ts +81 -0
- package/dist/src/text/MsdfFont.d.ts.map +1 -0
- package/dist/src/text/TextFormatting.d.ts +18 -0
- package/dist/src/text/TextFormatting.d.ts.map +1 -0
- package/dist/src/text/TextNode.d.ts +18 -0
- package/dist/src/text/TextNode.d.ts.map +1 -0
- package/dist/src/text/TextShader.d.ts +14 -0
- package/dist/src/text/TextShader.d.ts.map +1 -0
- package/dist/src/text/mod.d.ts +3 -0
- package/dist/src/text/mod.d.ts.map +1 -0
- package/dist/src/text/shaping.d.ts +38 -0
- package/dist/src/text/shaping.d.ts.map +1 -0
- package/dist/src/text/text.wgsl.d.ts +2 -0
- package/dist/src/text/text.wgsl.d.ts.map +1 -0
- package/dist/src/textures/AssetManager.d.ts +181 -0
- package/dist/src/textures/AssetManager.d.ts.map +1 -0
- package/dist/src/textures/NewTextureComputeShader.d.ts +28 -0
- package/dist/src/textures/TextureComputeShader.d.ts +20 -0
- package/dist/src/textures/TextureComputeShader.d.ts.map +1 -0
- package/dist/src/textures/crop.wgsl.d.ts +2 -0
- package/dist/src/textures/mod.d.ts +1 -0
- package/dist/src/textures/mod.d.ts.map +1 -0
- package/dist/src/textures/pixel-scraping.wgsl.d.ts +2 -0
- package/dist/src/textures/pixel-scraping.wgsl.d.ts.map +1 -0
- package/dist/src/textures/texture-processing.wgsl.d.ts +2 -0
- package/dist/src/textures/types.d.ts +176 -0
- package/dist/src/textures/types.d.ts.map +1 -0
- package/dist/src/textures/util.d.ts +7 -0
- package/dist/src/textures/util.d.ts.map +1 -0
- package/dist/src/utils/assert.d.ts +1 -0
- package/dist/src/utils/assert.d.ts.map +1 -0
- package/dist/src/utils/boilerplate.d.ts +10 -0
- package/dist/src/utils/boilerplate.d.ts.map +1 -0
- package/dist/src/utils/error.d.ts +7 -0
- package/dist/src/utils/error.d.ts.map +1 -0
- package/dist/src/utils/mod.d.ts +2 -0
- package/dist/src/utils/mod.d.ts.map +1 -0
- package/dist/src/utils/pool.d.ts +22 -0
- package/dist/src/utils/pool.d.ts.map +1 -0
- package/dist/test/math/matrix.test.d.ts +1 -0
- package/dist/test/scene/Batcher.test.d.ts +1 -0
- package/dist/test/scene/SceneNode.test.d.ts +1 -0
- package/dist/test/shader/parser.test.d.ts +1 -0
- package/dist/text/FontPipeline.d.ts +14 -0
- package/dist/text/FontPipeline.d.ts.map +1 -0
- package/dist/text/MsdfFont.d.ts +82 -0
- package/dist/text/MsdfFont.d.ts.map +1 -0
- package/dist/text/TextFormatting.d.ts +19 -0
- package/dist/text/TextFormatting.d.ts.map +1 -0
- package/dist/text/TextNode.d.ts +19 -0
- package/dist/text/TextNode.d.ts.map +1 -0
- package/dist/text/TextShader.d.ts +15 -0
- package/dist/text/TextShader.d.ts.map +1 -0
- package/dist/text/mod.d.ts +4 -0
- package/dist/text/mod.d.ts.map +1 -0
- package/dist/text/shaping.d.ts +39 -0
- package/dist/text/shaping.d.ts.map +1 -0
- package/dist/text/text.wgsl.d.ts +3 -0
- package/dist/text/text.wgsl.d.ts.map +1 -0
- package/dist/textures/AssetManager.d.ts +182 -0
- package/dist/textures/AssetManager.d.ts.map +1 -0
- package/dist/textures/TextureComputeShader.d.ts +21 -0
- package/dist/textures/TextureComputeShader.d.ts.map +1 -0
- package/dist/textures/mod.d.ts +2 -0
- package/dist/textures/mod.d.ts.map +1 -0
- package/dist/textures/pixel-scraping.wgsl.d.ts +3 -0
- package/dist/textures/pixel-scraping.wgsl.d.ts.map +1 -0
- package/dist/textures/types.d.ts +177 -0
- package/dist/textures/types.d.ts.map +1 -0
- package/dist/textures/util.d.ts +8 -0
- package/dist/textures/util.d.ts.map +1 -0
- package/dist/utils/assert.d.ts +2 -0
- package/dist/utils/assert.d.ts.map +1 -0
- package/dist/utils/boilerplate.d.ts +11 -0
- package/dist/utils/boilerplate.d.ts.map +1 -0
- package/dist/utils/error.d.ts +8 -0
- package/dist/utils/error.d.ts.map +1 -0
- package/dist/utils/mod.d.ts +3 -0
- package/dist/utils/mod.d.ts.map +1 -0
- package/dist/utils/pool.d.ts +23 -0
- package/dist/utils/pool.d.ts.map +1 -0
- package/package.json +47 -0
- package/src/Toodle.ts +853 -0
- package/src/colors/mod.ts +151 -0
- package/src/coreTypes/Color.ts +1 -0
- package/src/coreTypes/Point.ts +7 -0
- package/src/coreTypes/Size.ts +4 -0
- package/src/coreTypes/Transform.ts +16 -0
- package/src/coreTypes/Vec2.ts +7 -0
- package/src/coreTypes/mod.ts +5 -0
- package/src/globals.d.ts +4 -0
- package/src/limits.ts +23 -0
- package/src/math/angle.ts +17 -0
- package/src/math/matrix.ts +99 -0
- package/src/math/mod.ts +2 -0
- package/src/mod.ts +22 -0
- package/src/scene/Batcher.ts +61 -0
- package/src/scene/Camera.ts +69 -0
- package/src/scene/JumboQuadNode.ts +219 -0
- package/src/scene/QuadNode.ts +403 -0
- package/src/scene/RenderComponent.ts +12 -0
- package/src/scene/SceneNode.ts +668 -0
- package/src/scene/mod.ts +4 -0
- package/src/screen/mod.ts +1 -0
- package/src/screen/resolution.ts +1 -0
- package/src/shaders/EngineUniform.ts +11 -0
- package/src/shaders/IShader.ts +20 -0
- package/src/shaders/QuadShader.ts +288 -0
- package/src/shaders/ShaderDescriptor.ts +6 -0
- package/src/shaders/mod.ts +5 -0
- package/src/shaders/parser.ts +221 -0
- package/src/shaders/postprocess/blur.ts +245 -0
- package/src/shaders/postprocess/mod.ts +71 -0
- package/src/shaders/samplers.ts +13 -0
- package/src/shaders/wgsl/example.wgsl.ts +24 -0
- package/src/shaders/wgsl/hello.wgsl.ts +62 -0
- package/src/shaders/wgsl/helloInstanced.wgsl.ts +46 -0
- package/src/shaders/wgsl/quad.wgsl.ts +140 -0
- package/src/text/FontPipeline.ts +212 -0
- package/src/text/MsdfFont.ts +190 -0
- package/src/text/TextFormatting.ts +28 -0
- package/src/text/TextNode.ts +82 -0
- package/src/text/TextShader.ts +223 -0
- package/src/text/mod.ts +8 -0
- package/src/text/shaping.ts +280 -0
- package/src/text/text.wgsl.ts +149 -0
- package/src/textures/AssetManager.ts +746 -0
- package/src/textures/TextureComputeShader.ts +434 -0
- package/src/textures/mod.ts +1 -0
- package/src/textures/pixel-scraping.wgsl.ts +131 -0
- package/src/textures/types.ts +182 -0
- package/src/textures/util.ts +352 -0
- package/src/utils/assert.ts +5 -0
- package/src/utils/boilerplate.ts +110 -0
- package/src/utils/error.ts +14 -0
- package/src/utils/mod.ts +2 -0
- package/src/utils/pool.ts +42 -0
|
@@ -0,0 +1,10 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 {};
|
|
20
|
+
//# sourceMappingURL=Batcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
}
|
|
16
|
+
//# sourceMappingURL=Camera.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
}
|
|
29
|
+
//# sourceMappingURL=JumboQuadNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JumboQuadNode.d.ts","sourceRoot":"","sources":["../../src/scene/JumboQuadNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAQ,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAMxD,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AAEtD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,6BAA6B;IAC7B,SAAS,EAAE,SAAS,CAAC;IACrB,8EAA8E;IAC9E,MAAM,EAAE,IAAI,CAAC;IACb,yGAAyG;IACzG,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,wHAAwH;IACxH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,GAAG;IAChE,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B,CAAC;AAEF,qBAAa,aAAc,SAAQ,QAAQ;;gBAI7B,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC;IA6C7D,IAAI,WAAW,IAAI,WAAW,CAE7B;IAED,IAAI,KAAK,IAAI,YAAY,EAAE,CAE1B;IAED,aAAa,CAAC,IAAI,EAAE,YAAY;CA2CjC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
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
|
+
};
|
|
159
|
+
//# sourceMappingURL=QuadNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuadNode.d.ts","sourceRoot":"","sources":["../../src/scene/QuadNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAQ,MAAM,aAAa,CAAC;AAC9C,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;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACxE,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;;IACrC,YAAY,EAAE,YAAY,CAAC;gBAsBf,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC;IAsExD;;;;;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,aAlIQ,YAAY,UAAU,MAAM,KAAK,IAAI,cAoI7D;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,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B,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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
};
|
|
11
|
+
//# sourceMappingURL=RenderComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,MAAM,CAAC;CAC/E,CAAC"}
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import type { Point } from "../coreTypes/Point";
|
|
2
|
+
import type { Size } from "../coreTypes/Size";
|
|
3
|
+
import type { Transform } from "../coreTypes/Transform";
|
|
4
|
+
import type { Vec2 } from "../coreTypes/Vec2";
|
|
5
|
+
import type { RenderComponent } from "./RenderComponent";
|
|
6
|
+
/**
|
|
7
|
+
* A node in the scene graph.
|
|
8
|
+
*
|
|
9
|
+
* This is a base class and is fairly low level. You will probably want to interact with
|
|
10
|
+
* the wrapper classes {@link Toodle['Node']} or {@link Toodle['Quad']} instead.
|
|
11
|
+
*/
|
|
12
|
+
export declare class SceneNode {
|
|
13
|
+
#private;
|
|
14
|
+
static nextId: number;
|
|
15
|
+
id: number;
|
|
16
|
+
label?: string;
|
|
17
|
+
constructor(opts?: NodeOptions);
|
|
18
|
+
/**
|
|
19
|
+
* Add a child node and return the child node with this node set as its parent.
|
|
20
|
+
*/
|
|
21
|
+
add<T extends SceneNode>(kid: T, index?: number): T;
|
|
22
|
+
/**
|
|
23
|
+
* Returns an array of the node's immediate kids.
|
|
24
|
+
*
|
|
25
|
+
* Note that these will be returned with a `SceneNode` type, but can be narrowed if you know the type of them,
|
|
26
|
+
* for eg:
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* for (const kid of node.kids) {
|
|
30
|
+
* if (kid instanceof Scene.QuadNode) {
|
|
31
|
+
* console.log(kid.color)
|
|
32
|
+
* }
|
|
33
|
+
*
|
|
34
|
+
* if (kid instanceof Text.TextNode) {
|
|
35
|
+
* console.log(kid.text)
|
|
36
|
+
* }
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
get kids(): SceneNode[];
|
|
41
|
+
/**
|
|
42
|
+
* The children of the node. Alias for {@link SceneNode.kids}.
|
|
43
|
+
*/
|
|
44
|
+
get children(): SceneNode[];
|
|
45
|
+
/**
|
|
46
|
+
* Returns a reference to the node's transform.
|
|
47
|
+
*
|
|
48
|
+
* Do not edit this transform directly as it won't invalidate cache's correctly.
|
|
49
|
+
* Instead, use convenience properties {@link SceneNode.position}, {@link SceneNode.scale}, and {@link SceneNode.rotation}.
|
|
50
|
+
*/
|
|
51
|
+
get transform(): Transform;
|
|
52
|
+
/**
|
|
53
|
+
* Returns the key of the node as set when the node was created.
|
|
54
|
+
*
|
|
55
|
+
* This key can be used to reference the node from an external lookup system.
|
|
56
|
+
*/
|
|
57
|
+
get key(): string;
|
|
58
|
+
/**
|
|
59
|
+
* Returns the parent node. See https://toodle.gg/f849595b3ed13fc956fc1459a5cb5f0228f9d259/examples/transforms.html
|
|
60
|
+
*/
|
|
61
|
+
get parent(): SceneNode | null;
|
|
62
|
+
set position(value: Point);
|
|
63
|
+
/**
|
|
64
|
+
* Position of the node in local space. For world space, use {@link SceneNode.bounds}.
|
|
65
|
+
*/
|
|
66
|
+
get position(): Point;
|
|
67
|
+
set x(value: number);
|
|
68
|
+
/**
|
|
69
|
+
* The local x coordinate of the node.
|
|
70
|
+
*/
|
|
71
|
+
get x(): number;
|
|
72
|
+
set y(value: number);
|
|
73
|
+
/**
|
|
74
|
+
* The local y coordinate of the node.
|
|
75
|
+
*/
|
|
76
|
+
get y(): number;
|
|
77
|
+
set rotation(value: number);
|
|
78
|
+
/**
|
|
79
|
+
* The rotation of the node in degrees.
|
|
80
|
+
* For radians, see {@link SceneNode.rotationRadians}.
|
|
81
|
+
*/
|
|
82
|
+
get rotation(): number;
|
|
83
|
+
/**
|
|
84
|
+
* The rotation of the node in radians.
|
|
85
|
+
* For degrees, see {@link SceneNode.rotation}.
|
|
86
|
+
*/
|
|
87
|
+
get rotationRadians(): number;
|
|
88
|
+
set rotationRadians(value: number);
|
|
89
|
+
/**
|
|
90
|
+
* The scale of the node. See https://toodle.gg/f849595b3ed13fc956fc1459a5cb5f0228f9d259/examples/quad-size-scale.html
|
|
91
|
+
*/
|
|
92
|
+
get scale(): Vec2;
|
|
93
|
+
set scale(value: Vec2 | number);
|
|
94
|
+
set idealSize(value: Size | null);
|
|
95
|
+
/**
|
|
96
|
+
* The size of the node. See https://toodle.gg/f849595b3ed13fc956fc1459a5cb5f0228f9d259/examples/quad-size-scale.html
|
|
97
|
+
*/
|
|
98
|
+
get size(): Size | null;
|
|
99
|
+
/**
|
|
100
|
+
* The aspect ratio of the node.
|
|
101
|
+
* If the node has no defined size, the aspect ratio will be 1.
|
|
102
|
+
*/
|
|
103
|
+
get aspectRatio(): number;
|
|
104
|
+
/**
|
|
105
|
+
* isActive is a boolean that determines if the node is active.
|
|
106
|
+
* If a node is not active, it will not be drawn.
|
|
107
|
+
* If any of a node's ancestors are not active, the node will not be active.
|
|
108
|
+
*/
|
|
109
|
+
get isActive(): boolean;
|
|
110
|
+
set isActive(value: boolean);
|
|
111
|
+
/**
|
|
112
|
+
* Nodes are batched for drawing based on their layer. Each layer will submit a separate draw call.
|
|
113
|
+
* Nodes with the same layer will be drawn in the order they are drawn with toodle.Draw
|
|
114
|
+
* Nodes with a higher layer will be drawn on top of nodes with a lower layer.
|
|
115
|
+
*/
|
|
116
|
+
get layer(): number;
|
|
117
|
+
/**
|
|
118
|
+
* Returns true if the node has an explicit layer set.
|
|
119
|
+
*
|
|
120
|
+
* If the node does not have an explicit layer but one of its ancestors does,
|
|
121
|
+
* its layer will be inherited from its parent.
|
|
122
|
+
*/
|
|
123
|
+
get hasExplicitLayer(): boolean;
|
|
124
|
+
set layer(value: number);
|
|
125
|
+
get renderComponent(): RenderComponent | null;
|
|
126
|
+
/**
|
|
127
|
+
* This is the model matrix of the node. See https://webgpufundamentals.org/webgpu/lessons/webgpu-matrix-math.html for more information.
|
|
128
|
+
*
|
|
129
|
+
* Do not edit this matrix directly as it is derived from the node's transform and will be overwritten.
|
|
130
|
+
*/
|
|
131
|
+
get matrix(): Float32Array;
|
|
132
|
+
/**
|
|
133
|
+
* Get the bounds of the node in world space
|
|
134
|
+
*/
|
|
135
|
+
get bounds(): Bounds;
|
|
136
|
+
/**
|
|
137
|
+
* Set the bounds of the node in world space.
|
|
138
|
+
*/
|
|
139
|
+
setBounds(bounds: Partial<Bounds>): this;
|
|
140
|
+
/**
|
|
141
|
+
* Set the left edge of the node in world space.
|
|
142
|
+
*/
|
|
143
|
+
set left(value: number);
|
|
144
|
+
/**
|
|
145
|
+
* Set the bottom edge of the node in world space.
|
|
146
|
+
*/
|
|
147
|
+
set bottom(value: number);
|
|
148
|
+
/**
|
|
149
|
+
* Set the top edge of the node in world space.
|
|
150
|
+
*/
|
|
151
|
+
set top(value: number);
|
|
152
|
+
/**
|
|
153
|
+
* Set the right edge of the node in world space.
|
|
154
|
+
*/
|
|
155
|
+
set right(value: number);
|
|
156
|
+
/**
|
|
157
|
+
* Set the center x of the node in world space.
|
|
158
|
+
*/
|
|
159
|
+
set centerX(value: number);
|
|
160
|
+
/**
|
|
161
|
+
* Set the center y of the node in world space.
|
|
162
|
+
*/
|
|
163
|
+
set centerY(value: number);
|
|
164
|
+
/**
|
|
165
|
+
* Removes references to this node and all of its children.
|
|
166
|
+
*
|
|
167
|
+
* Call this to remove a node from a parent's tree and before garbage collection to prevent a node from being retained.
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
*
|
|
171
|
+
* const parent = toodle.Node();
|
|
172
|
+
* const child = toodle.Quad();
|
|
173
|
+
* const grandchild = toodle.Quad();
|
|
174
|
+
*
|
|
175
|
+
* parent.add(child);
|
|
176
|
+
* child.add(grandchild);
|
|
177
|
+
*
|
|
178
|
+
* // Will delete `child` and `grandchild`
|
|
179
|
+
* child.delete();
|
|
180
|
+
*/
|
|
181
|
+
delete(): void;
|
|
182
|
+
/**
|
|
183
|
+
* Remove any child node from this node. Warns if the child is not found.
|
|
184
|
+
*
|
|
185
|
+
* The node will still exist as an orphaned node and can still be passed to toodle.Draw or added to another parent.
|
|
186
|
+
*
|
|
187
|
+
* Alternatively, calling `node.delete()` on the child will remove it and set it to inactive.
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* const parent = toodle.Node();
|
|
191
|
+
* const child = toodle.Quad();
|
|
192
|
+
* const grandchild = toodle.Quad();
|
|
193
|
+
*
|
|
194
|
+
* parent.add(child);
|
|
195
|
+
* child.add(grandchild);
|
|
196
|
+
*
|
|
197
|
+
* parent.remove(child);
|
|
198
|
+
*/
|
|
199
|
+
remove(kid: SceneNode): void;
|
|
200
|
+
/**
|
|
201
|
+
* This marks the node as dirty, invalidating its cache and causing its matrix to be recalculated.
|
|
202
|
+
* This should not be necessary to call directly, but is available for advanced use cases.
|
|
203
|
+
*/
|
|
204
|
+
setDirty(): void;
|
|
205
|
+
/**
|
|
206
|
+
* Parse a node and its descendants from a JSON string.
|
|
207
|
+
* Can be used for deserialization from a file or other source.
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
*
|
|
211
|
+
* const node = new Node();
|
|
212
|
+
* const json = JSON.stringify(node);
|
|
213
|
+
* const clonedNode = Node.parse(json);
|
|
214
|
+
*/
|
|
215
|
+
static parse(json: string): SceneNode;
|
|
216
|
+
/**
|
|
217
|
+
* This method usually is not called directly. It will be called automatically by `JSON.stringify`,
|
|
218
|
+
* see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#description
|
|
219
|
+
* and {@link SceneNode.parse}.
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
*
|
|
223
|
+
* const node = new Node();
|
|
224
|
+
* const json = JSON.stringify(node); // calls toJSON()
|
|
225
|
+
* console.log(json)
|
|
226
|
+
*/
|
|
227
|
+
toJSON(): {
|
|
228
|
+
id: number;
|
|
229
|
+
label: string | undefined;
|
|
230
|
+
transform: Transform;
|
|
231
|
+
layer: number | null;
|
|
232
|
+
isActive: boolean;
|
|
233
|
+
kids: SceneNode[];
|
|
234
|
+
render: RenderComponent | null;
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
export type NodeOptions = {
|
|
238
|
+
/** The unique identifier for the node. */
|
|
239
|
+
id?: number;
|
|
240
|
+
/** The label for the node. */
|
|
241
|
+
label?: string;
|
|
242
|
+
/** The layer for the node. */
|
|
243
|
+
layer?: number;
|
|
244
|
+
/** The rotation for the node in degrees. Cannot be used with `rotationRadians`. */
|
|
245
|
+
rotation?: number;
|
|
246
|
+
/** The rotation for the node in radians. Cannot be used with `rotation`. */
|
|
247
|
+
rotationRadians?: number;
|
|
248
|
+
/** The position for the node. */
|
|
249
|
+
position?: Point;
|
|
250
|
+
/** The scale for the node. */
|
|
251
|
+
scale?: Vec2 | number;
|
|
252
|
+
/** The desired size for the node. */
|
|
253
|
+
idealSize?: Size;
|
|
254
|
+
/** The active state for the node. */
|
|
255
|
+
isActive?: boolean;
|
|
256
|
+
/** The kids for the node. */
|
|
257
|
+
kids?: SceneNode[];
|
|
258
|
+
/** The render component for the node. */
|
|
259
|
+
render?: RenderComponent;
|
|
260
|
+
/** Flip the node horizontally. */
|
|
261
|
+
flipX?: boolean;
|
|
262
|
+
/** Flip the node vertically. */
|
|
263
|
+
flipY?: boolean;
|
|
264
|
+
/** A string key for the node - can be used to reference the node from an external lookup system */
|
|
265
|
+
key?: string;
|
|
266
|
+
};
|
|
267
|
+
/**
|
|
268
|
+
* Bounds represent a bounding box of a rectangle in world space
|
|
269
|
+
*/
|
|
270
|
+
export type Bounds = {
|
|
271
|
+
/**
|
|
272
|
+
* for an axis-aligned rectangle, top is the top edge.
|
|
273
|
+
* for a rotated rectangle, it is the topmost point
|
|
274
|
+
*/
|
|
275
|
+
top: number;
|
|
276
|
+
/**
|
|
277
|
+
* for an axis-aligned rectangle, left is the left edge.
|
|
278
|
+
* for a rotated rectangle, it is the leftmost point
|
|
279
|
+
*/
|
|
280
|
+
left: number;
|
|
281
|
+
/**
|
|
282
|
+
* for an axis-aligned rectangle, right is the right edge.
|
|
283
|
+
* for a rotated rectangle, it is the rightmost point
|
|
284
|
+
*/
|
|
285
|
+
right: number;
|
|
286
|
+
/**
|
|
287
|
+
* for an axis-aligned rectangle, bottom is the bottom edge.
|
|
288
|
+
* for a rotated rectangle, it is the bottommost point
|
|
289
|
+
*/
|
|
290
|
+
bottom: number;
|
|
291
|
+
/**
|
|
292
|
+
* the center x of the node in world space
|
|
293
|
+
*/
|
|
294
|
+
x: number;
|
|
295
|
+
/**
|
|
296
|
+
* the center y of the node in world space
|
|
297
|
+
*/
|
|
298
|
+
y: number;
|
|
299
|
+
};
|
|
300
|
+
//# sourceMappingURL=SceneNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SceneNode.d.ts","sourceRoot":"","sources":["../../src/scene/SceneNode.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/scene/mod.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/screen/mod.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolution.d.ts","sourceRoot":"","sources":["../../src/screen/resolution.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Mat3 } from "wgpu-matrix";
|
|
2
|
+
import type { Camera } from "../scene/Camera";
|
|
3
|
+
import type { Resolution } from "../screen/resolution";
|
|
4
|
+
export type EngineUniform = {
|
|
5
|
+
resolution: Resolution;
|
|
6
|
+
camera: Camera;
|
|
7
|
+
viewProjectionMatrix: Mat3;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=EngineUniform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EngineUniform.d.ts","sourceRoot":"","sources":["../../src/shaders/EngineUniform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,oBAAoB,EAAE,IAAI,CAAC;CAG5B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SceneNode } from "../scene/SceneNode";
|
|
2
|
+
import type { EngineUniform } from "./EngineUniform";
|
|
3
|
+
export interface IShader {
|
|
4
|
+
startFrame: (device: GPUDevice, uniform: EngineUniform) => void;
|
|
5
|
+
/**
|
|
6
|
+
* Process a batch of nodes.
|
|
7
|
+
*
|
|
8
|
+
* @param renderPass - The render pass to use.
|
|
9
|
+
* @param nodes - The nodes to process.
|
|
10
|
+
* @returns The number of draw calls made.
|
|
11
|
+
*/
|
|
12
|
+
processBatch: (renderPass: GPURenderPassEncoder, nodes: SceneNode[]) => number;
|
|
13
|
+
endFrame: () => void;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=IShader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IShader.d.ts","sourceRoot":"","sources":["../../src/shaders/IShader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,OAAO;IACtB,UAAU,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IAEhE;;;;;;OAMG;IACH,YAAY,EAAE,CACZ,UAAU,EAAE,oBAAoB,EAChC,KAAK,EAAE,SAAS,EAAE,KACf,MAAM,CAAC;IAEZ,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB"}
|