A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
feat: add 16 example projects covering core engine features
esengine4039bab2e90e
diff --git a/editor/src/types/ProjectTypes.ts b/editor/src/types/ProjectTypes.tsindex 91544e2f7..326f63952 100644--- a/editor/src/types/ProjectTypes.ts+++ b/editor/src/types/ProjectTypes.ts@@ -119,6 +119,166 @@ export const EXAMPLE_CATEGORY_LABELS: Record<ExampleCategory, string> = {};export const EXAMPLE_PROJECTS: ExampleProjectInfo[] = [+ {+ id: 'hello-world',+ name: 'Hello World',+ description: 'Minimal example: spawn colored sprites, rotate and animate them',+ zipFile: 'examples/hello-world.zip',+ category: 'getting-started',+ difficulty: 'beginner',+ thumbnail: 'examples/thumbnails/hello-world.png',+ tags: ['beginner', 'sprite', 'transform', 'system', 'query'],+ },+ {+ id: 'ecs-basics',+ name: 'ECS Basics',+ description: 'Components, systems, queries, commands, tags, and entity lifecycle',+ zipFile: 'examples/ecs-basics.zip',+ category: 'getting-started',+ difficulty: 'beginner',+ thumbnail: 'examples/thumbnails/ecs-basics.png',+ tags: ['ecs', 'component', 'system', 'query', 'commands', 'tag', 'spawn', 'despawn'],+ },+ {+ id: 'event-system',+ name: 'Event System',+ description: 'Custom events, event readers/writers, and resource-based shared state',+ zipFile: 'examples/event-system.zip',+ category: 'getting-started',+ difficulty: 'beginner',+ thumbnail: 'examples/thumbnails/event-system.png',+ tags: ['event', 'resource', 'eventwriter', 'eventreader', 'defineEvent', 'defineResource'],+ },+ {+ id: 'sprite-rendering',+ name: 'Sprite & Draw API',+ description: 'Sprite layers, colors, flip, orbit, and wave animations',+ zipFile: 'examples/sprite-rendering.zip',+ category: 'rendering',+ difficulty: 'beginner',+ thumbnail: 'examples/thumbnails/sprite-rendering.png',+ tags: ['sprite', 'layer', 'color', 'flip', 'rendering', 'draw'],+ },+ {+ id: 'tween-animation',+ name: 'Tween Animation',+ description: 'Easing functions, position/scale/rotation/color tweens with loop modes',+ zipFile: 'examples/tween-animation.zip',+ category: 'animation',+ difficulty: 'beginner',+ thumbnail: 'examples/thumbnails/tween-animation.png',+ tags: ['tween', 'easing', 'animation', 'loop', 'pingpong'],+ },+ {+ id: 'physics-playground',+ name: 'Physics Playground',+ description: 'Dynamic rigid bodies, box/circle colliders, static platforms, and gravity',+ zipFile: 'examples/physics-playground.zip',+ category: 'physics',+ difficulty: 'beginner',+ thumbnail: 'examples/thumbnails/physics-playground.png',+ tags: ['physics', 'rigidbody', 'collider', 'box2d', 'gravity'],+ },+ {+ id: 'input-demo',+ name: 'Input Handling',+ description: 'Keyboard WASD movement, mouse following, click to spawn, and trail effects',+ zipFile: 'examples/input-demo.zip',+ category: 'input',+ difficulty: 'beginner',+ thumbnail: 'examples/thumbnails/input-demo.png',+ tags: ['input', 'keyboard', 'mouse', 'wasd', 'click'],+ },+ {+ id: 'ui-controls',+ name: 'UI Controls Gallery',+ description: 'Buttons, toggles, sliders, progress bars, and text with Canvas layout',+ zipFile: 'examples/ui-controls.zip',+ category: 'ui',+ difficulty: 'beginner',+ thumbnail: 'examples/thumbnails/ui-controls.png',+ tags: ['ui', 'button', 'toggle', 'slider', 'progressbar', 'canvas', 'text'],+ },+ {+ id: 'ui-layout',+ name: 'UIRect Layout',+ description: 'Anchor-based positioning, stretch panels, and grid layout with UIRect',+ zipFile: 'examples/ui-layout.zip',+ category: 'ui',+ difficulty: 'intermediate',+ thumbnail: 'examples/thumbnails/ui-layout.png',+ tags: ['ui', 'layout', 'uirect', 'anchor', 'stretch', 'grid'],+ },+ {+ id: 'particle-demo',+ name: 'Particle Effects',+ description: 'Fire, sparkles, smoke, and burst particle emitters with various shapes',+ zipFile: 'examples/particle-demo.zip',+ category: 'rendering',+ difficulty: 'beginner',+ thumbnail: 'examples/thumbnails/particle-demo.png',+ tags: ['particle', 'emitter', 'fire', 'smoke', 'burst', 'effects'],+ },+ {+ id: 'postprocess-effects',+ name: 'Post-Processing',+ description: 'Bloom, vignette, and global PostProcessVolume with orbiting sprites',+ zipFile: 'examples/postprocess-effects.zip',+ category: 'rendering',+ difficulty: 'intermediate',+ thumbnail: 'examples/thumbnails/postprocess-effects.png',+ tags: ['postprocess', 'bloom', 'vignette', 'volume', 'effects'],+ },+ {+ id: 'collision-layers',+ name: 'Collision Layers',+ description: 'Physics collision filtering with categoryBits/maskBits per color group',+ zipFile: 'examples/collision-layers.zip',+ category: 'physics',+ difficulty: 'intermediate',+ thumbnail: 'examples/thumbnails/collision-layers.png',+ tags: ['physics', 'collision', 'layers', 'filtering', 'category', 'mask'],+ },+ {+ id: 'ui-interaction',+ name: 'Drag & Focus',+ description: 'Draggable cards, focusable elements, and drop zone with tab navigation',+ zipFile: 'examples/ui-interaction.zip',+ category: 'ui',+ difficulty: 'intermediate',+ thumbnail: 'examples/thumbnails/ui-interaction.png',+ tags: ['ui', 'drag', 'focus', 'interactable', 'draggable', 'focusable'],+ },+ {+ id: 'audio-demo',+ name: 'Audio Playback',+ description: 'SFX trigger buttons, volume control, and animated visualizer bars',+ zipFile: 'examples/audio-demo.zip',+ category: 'audio',+ difficulty: 'beginner',+ thumbnail: 'examples/thumbnails/audio-demo.png',+ tags: ['audio', 'sfx', 'volume', 'mixer', 'visualizer'],+ },+ {+ id: 'sprite-animation',+ name: 'Sprite Animation',+ description: 'Frame-by-frame sprite animation with walk/idle clip switching',+ zipFile: 'examples/sprite-animation.zip',+ category: 'animation',+ difficulty: 'beginner',+ thumbnail: 'examples/thumbnails/sprite-animation.png',+ tags: ['sprite', 'animation', 'frames', 'clip', 'spriteanimator'],+ },+ {+ id: 'platformer',+ name: 'Platformer',+ description: 'Side-scrolling platformer with gravity, jumping, and coin collection',+ zipFile: 'examples/platformer.zip',+ category: 'game',+ difficulty: 'intermediate',+ thumbnail: 'examples/thumbnails/platformer.png',+ tags: ['platformer', 'input', 'game', 'gravity', 'collision'],+ },{id: 'space-shooter',name: 'Space Shooter',diff --git a/examples/audio-demo/.esengine/settings.json b/examples/audio-demo/.esengine/settings.jsonnew file mode 100644index 000000000..4ae0a6dc7--- /dev/null+++ b/examples/audio-demo/.esengine/settings.json@@ -0,0 +1 @@+{ "lastOpenedScene": "assets/scenes/main.esscene" }diff --git a/examples/audio-demo/.gitignore b/examples/audio-demo/.gitignorenew file mode 100644index 000000000..359472ac2--- /dev/null+++ b/examples/audio-demo/.gitignore@@ -0,0 +1,7 @@+node_modules/+dist/+.vscode/+.idea/+.DS_Store+Thumbs.db+.esengine/cache/diff --git a/examples/audio-demo/assets/audio/clap.wav b/examples/audio-demo/assets/audio/clap.wavnew file mode 100644index 000000000..7e83039edBinary files /dev/null and b/examples/audio-demo/assets/audio/clap.wav differdiff --git a/examples/audio-demo/assets/audio/clap.wav.meta b/examples/audio-demo/assets/audio/clap.wav.metanew file mode 100644index 000000000..1e5fa049a--- /dev/null+++ b/examples/audio-demo/assets/audio/clap.wav.meta@@ -0,0 +1,6 @@+{+ "uuid": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f80",+ "version": "2.0",+ "type": "audio",+ "importer": {}+}diff --git a/examples/audio-demo/assets/audio/hihat.wav b/examples/audio-demo/assets/audio/hihat.wavnew file mode 100644index 000000000..c25e599efBinary files /dev/null and b/examples/audio-demo/assets/audio/hihat.wav differdiff --git a/examples/audio-demo/assets/audio/hihat.wav.meta b/examples/audio-demo/assets/audio/hihat.wav.metanew file mode 100644index 000000000..5b6f9b150--- /dev/null+++ b/examples/audio-demo/assets/audio/hihat.wav.meta@@ -0,0 +1,6 @@+{+ "uuid": "c3d4e5f6-a7b8-4c9d-0e1f-2a3b4c5d6e7f",+ "version": "2.0",+ "type": "audio",+ "importer": {}+}diff --git a/examples/audio-demo/assets/audio/kick.wav b/examples/audio-demo/assets/audio/kick.wavnew file mode 100644index 000000000..4acc5b53aBinary files /dev/null and b/examples/audio-demo/assets/audio/kick.wav differdiff --git a/examples/audio-demo/assets/audio/kick.wav.meta b/examples/audio-demo/assets/audio/kick.wav.metanew file mode 100644index 000000000..d3b45be1b--- /dev/null+++ b/examples/audio-demo/assets/audio/kick.wav.meta@@ -0,0 +1,6 @@+{+ "uuid": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",+ "version": "2.0",+ "type": "audio",+ "importer": {}+}diff --git a/examples/audio-demo/assets/audio/snare.wav b/examples/audio-demo/assets/audio/snare.wavnew file mode 100644index 000000000..4f8e55a7aBinary files /dev/null and b/examples/audio-demo/assets/audio/snare.wav differdiff --git a/examples/audio-demo/assets/audio/snare.wav.meta b/examples/audio-demo/assets/audio/snare.wav.metanew file mode 100644index 000000000..dfb5b34bc--- /dev/null+++ b/examples/audio-demo/assets/audio/snare.wav.meta@@ -0,0 +1,6 @@+{+ "uuid": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",+ "version": "2.0",+ "type": "audio",+ "importer": {}+}diff --git a/examples/audio-demo/assets/scenes/main.esscene b/examples/audio-demo/assets/scenes/main.esscenenew file mode 100644index 000000000..8d2c52f5a--- /dev/null+++ b/examples/audio-demo/assets/scenes/main.esscene@@ -0,0 +1,794 @@+{+ "version": "1.0",+ "name": "Main",+ "entities": [+ {+ "id": 0,+ "name": "Camera",+ "parent": null,+ "children": [],+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": { "x": 0, "y": 0, "z": 10 }+ }+ },+ {+ "type": "Camera",+ "data": {+ "projectionType": 1,+ "orthoSize": 300,+ "isActive": true,+ "priority": 0+ }+ }+ ],+ "visible": true+ },+ {+ "id": 1,+ "name": "Canvas",+ "parent": null,+ "children": [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "Canvas",+ "data": {+ "designResolution": { "x": 800, "y": 600 },+ "scaleMode": 2+ }+ },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "size": { "x": 800, "y": 600 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 2,+ "name": "Title",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 1 },+ "anchorMax": { "x": 0.5, "y": 1 },+ "offsetMin": { "x": 0, "y": -45 },+ "size": { "x": 400, "y": 45 },+ "pivot": { "x": 0.5, "y": 1 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Audio Demo",+ "fontSize": 32,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 3,+ "name": "KickBtn",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -280, "y": 80 },+ "size": { "x": 110, "y": 50 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.9, "g": 0.3, "b": 0.3, "a": 1 }+ }+ },+ {+ "type": "Button",+ "data": {+ "state": 0+ }+ },+ { "type": "Interactable", "data": {} },+ {+ "type": "SFXTrigger",+ "data": {+ "cooldown": 0+ }+ }+ ],+ "visible": true+ },+ {+ "id": 4,+ "name": "KickLabel",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -280, "y": 80 },+ "size": { "x": 110, "y": 50 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Kick",+ "fontSize": 20,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 5,+ "name": "SnareBtn",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -130, "y": 80 },+ "size": { "x": 110, "y": 50 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.3, "g": 0.7, "b": 0.9, "a": 1 }+ }+ },+ {+ "type": "Button",+ "data": {+ "state": 0+ }+ },+ { "type": "Interactable", "data": {} },+ {+ "type": "SFXTrigger",+ "data": {+ "cooldown": 0+ }+ }+ ],+ "visible": true+ },+ {+ "id": 6,+ "name": "SnareLabel",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -130, "y": 80 },+ "size": { "x": 110, "y": 50 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Snare",+ "fontSize": 20,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 7,+ "name": "HiHatBtn",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 20, "y": 80 },+ "size": { "x": 110, "y": 50 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.3, "g": 0.9, "b": 0.4, "a": 1 }+ }+ },+ {+ "type": "Button",+ "data": {+ "state": 0+ }+ },+ { "type": "Interactable", "data": {} },+ {+ "type": "SFXTrigger",+ "data": {+ "cooldown": 0+ }+ }+ ],+ "visible": true+ },+ {+ "id": 8,+ "name": "HiHatLabel",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 20, "y": 80 },+ "size": { "x": 110, "y": 50 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Hi-Hat",+ "fontSize": 20,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 9,+ "name": "ClapBtn",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 170, "y": 80 },+ "size": { "x": 110, "y": 50 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.9, "g": 0.7, "b": 0.2, "a": 1 }+ }+ },+ {+ "type": "Button",+ "data": {+ "state": 0+ }+ },+ { "type": "Interactable", "data": {} },+ {+ "type": "SFXTrigger",+ "data": {+ "cooldown": 0+ }+ }+ ],+ "visible": true+ },+ {+ "id": 10,+ "name": "ClapLabel",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 170, "y": 80 },+ "size": { "x": 110, "y": 50 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Clap",+ "fontSize": 20,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 11,+ "name": "VisualizerBar0",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -205, "y": -200 },+ "size": { "x": 20, "y": 20 },+ "pivot": { "x": 0, "y": 0 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.91, "g": 0.19, "b": 0.19, "a": 1 }+ }+ },+ { "type": "Visualizer", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 12,+ "name": "VisualizerBar1",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -179, "y": -200 },+ "size": { "x": 20, "y": 20 },+ "pivot": { "x": 0, "y": 0 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.91, "g": 0.46, "b": 0.19, "a": 1 }+ }+ },+ { "type": "Visualizer", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 13,+ "name": "VisualizerBar2",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -153, "y": -200 },+ "size": { "x": 20, "y": 20 },+ "pivot": { "x": 0, "y": 0 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.91, "g": 0.73, "b": 0.19, "a": 1 }+ }+ },+ { "type": "Visualizer", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 14,+ "name": "VisualizerBar3",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -127, "y": -200 },+ "size": { "x": 20, "y": 20 },+ "pivot": { "x": 0, "y": 0 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.82, "g": 0.91, "b": 0.19, "a": 1 }+ }+ },+ { "type": "Visualizer", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 15,+ "name": "VisualizerBar4",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -101, "y": -200 },+ "size": { "x": 20, "y": 20 },+ "pivot": { "x": 0, "y": 0 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.55, "g": 0.91, "b": 0.19, "a": 1 }+ }+ },+ { "type": "Visualizer", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 16,+ "name": "VisualizerBar5",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -75, "y": -200 },+ "size": { "x": 20, "y": 20 },+ "pivot": { "x": 0, "y": 0 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.28, "g": 0.91, "b": 0.19, "a": 1 }+ }+ },+ { "type": "Visualizer", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 17,+ "name": "VisualizerBar6",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -49, "y": -200 },+ "size": { "x": 20, "y": 20 },+ "pivot": { "x": 0, "y": 0 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.19, "g": 0.91, "b": 0.37, "a": 1 }+ }+ },+ { "type": "Visualizer", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 18,+ "name": "VisualizerBar7",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -23, "y": -200 },+ "size": { "x": 20, "y": 20 },+ "pivot": { "x": 0, "y": 0 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.19, "g": 0.91, "b": 0.64, "a": 1 }+ }+ },+ { "type": "Visualizer", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 19,+ "name": "VisualizerBar8",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 3, "y": -200 },+ "size": { "x": 20, "y": 20 },+ "pivot": { "x": 0, "y": 0 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.19, "g": 0.91, "b": 0.91, "a": 1 }+ }+ },+ { "type": "Visualizer", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 20,+ "name": "VisualizerBar9",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 29, "y": -200 },+ "size": { "x": 20, "y": 20 },+ "pivot": { "x": 0, "y": 0 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.19, "g": 0.64, "b": 0.91, "a": 1 }+ }+ },+ { "type": "Visualizer", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 21,+ "name": "VisualizerBar10",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 55, "y": -200 },+ "size": { "x": 20, "y": 20 },+ "pivot": { "x": 0, "y": 0 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.19, "g": 0.37, "b": 0.91, "a": 1 }+ }+ },+ { "type": "Visualizer", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 22,+ "name": "VisualizerBar11",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 81, "y": -200 },+ "size": { "x": 20, "y": 20 },+ "pivot": { "x": 0, "y": 0 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.28, "g": 0.19, "b": 0.91, "a": 1 }+ }+ },+ { "type": "Visualizer", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 23,+ "name": "VisualizerBar12",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 107, "y": -200 },+ "size": { "x": 20, "y": 20 },+ "pivot": { "x": 0, "y": 0 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.55, "g": 0.19, "b": 0.91, "a": 1 }+ }+ },+ { "type": "Visualizer", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 24,+ "name": "VisualizerBar13",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 133, "y": -200 },+ "size": { "x": 20, "y": 20 },+ "pivot": { "x": 0, "y": 0 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.82, "g": 0.19, "b": 0.91, "a": 1 }+ }+ },+ { "type": "Visualizer", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 25,+ "name": "VisualizerBar14",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 159, "y": -200 },+ "size": { "x": 20, "y": 20 },+ "pivot": { "x": 0, "y": 0 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.91, "g": 0.19, "b": 0.73, "a": 1 }+ }+ },+ { "type": "Visualizer", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 26,+ "name": "VisualizerBar15",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 185, "y": -200 },+ "size": { "x": 20, "y": 20 },+ "pivot": { "x": 0, "y": 0 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.91, "g": 0.19, "b": 0.46, "a": 1 }+ }+ },+ { "type": "Visualizer", "data": {} }+ ],+ "visible": true+ }+ ]+}diff --git a/examples/audio-demo/project.esproject b/examples/audio-demo/project.esprojectnew file mode 100644index 000000000..d08fe5339--- /dev/null+++ b/examples/audio-demo/project.esproject@@ -0,0 +1,10 @@+{+ "name": "Audio Demo",+ "version": "0.1.0",+ "engine": "0.1.0",+ "defaultScene": "assets/scenes/main.esscene",+ "created": "2026-03-02T00:00:00.000Z",+ "modified": "2026-03-02T00:00:00.000Z",+ "spineVersion": "none",+ "designResolution": { "width": 800, "height": 600 }+}diff --git a/examples/audio-demo/src/components.ts b/examples/audio-demo/src/components.tsnew file mode 100644index 000000000..d394accd6--- /dev/null+++ b/examples/audio-demo/src/components.ts@@ -0,0 +1,11 @@+import { defineComponent, defineTag } from 'esengine';++export const SFXTrigger = defineComponent('SFXTrigger', {+ cooldown: 0,+});++export const VolumeKnob = defineComponent('VolumeKnob', {+ volume: 1.0,+});++export const Visualizer = defineTag('Visualizer');diff --git a/examples/audio-demo/src/main.ts b/examples/audio-demo/src/main.tsnew file mode 100644index 000000000..fc7d9a5a2--- /dev/null+++ b/examples/audio-demo/src/main.ts@@ -0,0 +1,8 @@+import { addSystemToSchedule, Schedule } from 'esengine';++import './components';+import { sfxTriggerSystem } from './systems/sfx';+import { visualizerSystem } from './systems/visualizer';++addSystemToSchedule(Schedule.Update, sfxTriggerSystem);+addSystemToSchedule(Schedule.Update, visualizerSystem);diff --git a/examples/audio-demo/src/systems/sfx.ts b/examples/audio-demo/src/systems/sfx.tsnew file mode 100644index 000000000..8ea83e415--- /dev/null+++ b/examples/audio-demo/src/systems/sfx.ts@@ -0,0 +1,34 @@+import {+ defineSystem, Query, Mut, Res, Time, Input, Audio,+} from 'esengine';+import { SFXTrigger } from '../components';++const SFX_URLS = [+ 'assets/audio/kick.wav',+ 'assets/audio/snare.wav',+ 'assets/audio/hihat.wav',+ 'assets/audio/clap.wav',+];++let triggerIndex = 0;++export const sfxTriggerSystem = defineSystem(+ [Query([Mut(SFXTrigger)]), Res(Time), Res(Input)],+ (query, time, input) => {+ triggerIndex = 0;+ for (const [_entity, trigger] of query) {+ trigger.cooldown = Math.max(0, trigger.cooldown - time.delta);++ const key = `Digit${triggerIndex + 1}`;+ if (input.isKeyPressed(key) && trigger.cooldown <= 0) {+ const url = SFX_URLS[triggerIndex];+ if (url) {+ Audio.playSFX(url);+ }+ trigger.cooldown = 0.1;+ }+ triggerIndex++;+ }+ },+ { name: 'SFXTriggerSystem' }+);diff --git a/examples/audio-demo/src/systems/visualizer.ts b/examples/audio-demo/src/systems/visualizer.tsnew file mode 100644index 000000000..c587e3b95--- /dev/null+++ b/examples/audio-demo/src/systems/visualizer.ts@@ -0,0 +1,19 @@+import {+ defineSystem, Query, Mut, Res, Time, UIRect,+} from 'esengine';+import { Visualizer } from '../components';++let barIndex = 0;++export const visualizerSystem = defineSystem(+ [Query([Mut(UIRect), Visualizer]), Res(Time)],+ (query, time) => {+ barIndex = 0;+ for (const [_entity, rect] of query) {+ const height = 20 + Math.abs(Math.sin(time.elapsed * 3 + barIndex * 0.5)) * 100;+ rect.size = { x: rect.size.x, y: height };+ barIndex++;+ }+ },+ { name: 'VisualizerSystem' }+);diff --git a/examples/audio-demo/thumbnail.png b/examples/audio-demo/thumbnail.pngnew file mode 100644index 000000000..a91fd3a09Binary files /dev/null and b/examples/audio-demo/thumbnail.png differdiff --git a/examples/audio-demo/tsconfig.json b/examples/audio-demo/tsconfig.jsonnew file mode 100644index 000000000..0a8528b29--- /dev/null+++ b/examples/audio-demo/tsconfig.json@@ -0,0 +1,22 @@+{+ "compilerOptions": {+ "target": "ES2020",+ "module": "ESNext",+ "moduleResolution": "bundler",+ "strict": true,+ "esModuleInterop": true,+ "skipLibCheck": true,+ "forceConsistentCasingInFileNames": true,+ "declaration": false,+ "outDir": "./dist",+ "rootDir": ".",+ "baseUrl": ".",+ "paths": {+ "esengine": ["./.esengine/sdk/index.d.ts"],+ "esengine/wasm": ["./.esengine/sdk/wasm.d.ts"],+ "@esengine/editor": ["./.esengine/editor/index.d.ts"]+ }+ },+ "include": ["src/**/*"],+ "exclude": ["node_modules"]+}diff --git a/examples/collision-layers/.esengine/settings.json b/examples/collision-layers/.esengine/settings.jsonnew file mode 100644index 000000000..4ae0a6dc7--- /dev/null+++ b/examples/collision-layers/.esengine/settings.json@@ -0,0 +1 @@+{ "lastOpenedScene": "assets/scenes/main.esscene" }diff --git a/examples/collision-layers/.gitignore b/examples/collision-layers/.gitignorenew file mode 100644index 000000000..359472ac2--- /dev/null+++ b/examples/collision-layers/.gitignore@@ -0,0 +1,7 @@+node_modules/+dist/+.vscode/+.idea/+.DS_Store+Thumbs.db+.esengine/cache/diff --git a/examples/collision-layers/assets/scenes/main.esscene b/examples/collision-layers/assets/scenes/main.esscenenew file mode 100644index 000000000..05bda05c7--- /dev/null+++ b/examples/collision-layers/assets/scenes/main.esscene@@ -0,0 +1,119 @@+{+ "version": "1.0",+ "name": "Main",+ "entities": [+ {+ "id": 0,+ "name": "Camera",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 10 } } },+ { "type": "Camera", "data": { "projectionType": 1, "orthoSize": 300, "isActive": true, "priority": 0 } }+ ],+ "visible": true+ },+ {+ "id": 1,+ "name": "Ground",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": -250, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 700, "y": 20 }, "color": { "r": 0.5, "g": 0.5, "b": 0.55, "a": 1 } } },+ { "type": "RigidBody", "data": { "bodyType": 0 } },+ { "type": "BoxCollider", "data": { "halfExtents": { "x": 3.5, "y": 0.1 }, "categoryBits": 8, "maskBits": 15 } }+ ],+ "visible": true+ },+ {+ "id": 2,+ "name": "RedPlatform1",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -200, "y": -100, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 130, "y": 12 }, "color": { "r": 1, "g": 0.3, "b": 0.3, "a": 0.6 } } },+ { "type": "RigidBody", "data": { "bodyType": 0 } },+ { "type": "BoxCollider", "data": { "halfExtents": { "x": 0.65, "y": 0.06 }, "categoryBits": 1, "maskBits": 9 } }+ ],+ "visible": true+ },+ {+ "id": 3,+ "name": "RedPlatform2",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -200, "y": 50, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 130, "y": 12 }, "color": { "r": 1, "g": 0.3, "b": 0.3, "a": 0.6 } } },+ { "type": "RigidBody", "data": { "bodyType": 0 } },+ { "type": "BoxCollider", "data": { "halfExtents": { "x": 0.65, "y": 0.06 }, "categoryBits": 1, "maskBits": 9 } }+ ],+ "visible": true+ },+ {+ "id": 4,+ "name": "GreenPlatform1",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": -100, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 130, "y": 12 }, "color": { "r": 0.3, "g": 1, "b": 0.3, "a": 0.6 } } },+ { "type": "RigidBody", "data": { "bodyType": 0 } },+ { "type": "BoxCollider", "data": { "halfExtents": { "x": 0.65, "y": 0.06 }, "categoryBits": 2, "maskBits": 10 } }+ ],+ "visible": true+ },+ {+ "id": 5,+ "name": "GreenPlatform2",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": 50, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 130, "y": 12 }, "color": { "r": 0.3, "g": 1, "b": 0.3, "a": 0.6 } } },+ { "type": "RigidBody", "data": { "bodyType": 0 } },+ { "type": "BoxCollider", "data": { "halfExtents": { "x": 0.65, "y": 0.06 }, "categoryBits": 2, "maskBits": 10 } }+ ],+ "visible": true+ },+ {+ "id": 6,+ "name": "BluePlatform1",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 200, "y": -100, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 130, "y": 12 }, "color": { "r": 0.3, "g": 0.5, "b": 1, "a": 0.6 } } },+ { "type": "RigidBody", "data": { "bodyType": 0 } },+ { "type": "BoxCollider", "data": { "halfExtents": { "x": 0.65, "y": 0.06 }, "categoryBits": 4, "maskBits": 12 } }+ ],+ "visible": true+ },+ {+ "id": 7,+ "name": "BluePlatform2",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 200, "y": 50, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 130, "y": 12 }, "color": { "r": 0.3, "g": 0.5, "b": 1, "a": 0.6 } } },+ { "type": "RigidBody", "data": { "bodyType": 0 } },+ { "type": "BoxCollider", "data": { "halfExtents": { "x": 0.65, "y": 0.06 }, "categoryBits": 4, "maskBits": 12 } }+ ],+ "visible": true+ },+ {+ "id": 8,+ "name": "SpawnTimer",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ { "type": "SpawnTimer", "data": { "interval": 0.6, "timer": 0 } }+ ],+ "visible": true+ }+ ]+}diff --git a/examples/collision-layers/project.esproject b/examples/collision-layers/project.esprojectnew file mode 100644index 000000000..4e0e78c9a--- /dev/null+++ b/examples/collision-layers/project.esproject@@ -0,0 +1,14 @@+{+ "name": "Collision Layers",+ "version": "0.1.0",+ "engine": "0.1.0",+ "defaultScene": "assets/scenes/main.esscene",+ "created": "2026-03-02T00:00:00.000Z",+ "modified": "2026-03-02T00:00:00.000Z",+ "spineVersion": "none",+ "enablePhysics": true,+ "physicsGravityX": 0,+ "physicsGravityY": -9.8,+ "collisionLayerNames": ["Red", "Green", "Blue"],+ "designResolution": { "width": 800, "height": 600 }+}diff --git a/examples/collision-layers/src/components.ts b/examples/collision-layers/src/components.tsnew file mode 100644index 000000000..3c3d2ff87--- /dev/null+++ b/examples/collision-layers/src/components.ts@@ -0,0 +1,6 @@+import { defineComponent } from 'esengine';++export const SpawnTimer = defineComponent('SpawnTimer', {+ interval: 0.6,+ timer: 0,+});diff --git a/examples/collision-layers/src/main.ts b/examples/collision-layers/src/main.tsnew file mode 100644index 000000000..b021f4937--- /dev/null+++ b/examples/collision-layers/src/main.ts@@ -0,0 +1,6 @@+import { addSystemToSchedule, Schedule } from 'esengine';++import './components';+import { spawnSystem } from './systems/spawn';++addSystemToSchedule(Schedule.Update, spawnSystem);diff --git a/examples/collision-layers/src/systems/spawn.ts b/examples/collision-layers/src/systems/spawn.tsnew file mode 100644index 000000000..b105675be--- /dev/null+++ b/examples/collision-layers/src/systems/spawn.ts@@ -0,0 +1,57 @@+import {+ defineSystem, Query, Mut, Res, Time, Commands,+ Transform, Sprite, RigidBody, CircleCollider, BodyType,+} from 'esengine';+import { SpawnTimer } from '../components';++const LAYER_RED = 0x0001;+const LAYER_GREEN = 0x0002;+const LAYER_BLUE = 0x0004;+const LAYER_GROUND = 0x0008;++const MAX_BODIES = 50;+const SPAWN_Y = 260;+const PPU = 100;++const LAYERS = [+ { category: LAYER_RED, mask: LAYER_RED | LAYER_GROUND, color: { r: 1, g: 0.3, b: 0.3 }, x: -200 },+ { category: LAYER_GREEN, mask: LAYER_GREEN | LAYER_GROUND, color: { r: 0.3, g: 1, b: 0.3 }, x: 0 },+ { category: LAYER_BLUE, mask: LAYER_BLUE | LAYER_GROUND, color: { r: 0.3, g: 0.5, b: 1 }, x: 200 },+];++let bodyCount = 0;++export const spawnSystem = defineSystem(+ [Query([Mut(SpawnTimer)]), Res(Time), Commands()],+ (query, time, cmds) => {+ for (const [_entity, timer] of query) {+ timer.timer += time.delta;+ if (timer.timer < timer.interval || bodyCount >= MAX_BODIES) continue;+ timer.timer = 0;++ const layerIdx = bodyCount % 3;+ const layer = LAYERS[layerIdx];+ const radius = 10 + Math.random() * 10;+ const xOffset = (Math.random() - 0.5) * 80;++ cmds.spawn()+ .insert(Transform, { position: { x: layer.x + xOffset, y: SPAWN_Y, z: 0 } })+ .insert(Sprite, {+ size: { x: radius * 2, y: radius * 2 },+ color: { ...layer.color, a: 1 },+ })+ .insert(RigidBody, {+ bodyType: BodyType.Dynamic,+ })+ .insert(CircleCollider, {+ radius: radius / PPU,+ restitution: 0.4,+ categoryBits: layer.category,+ maskBits: layer.mask,+ });++ bodyCount++;+ }+ },+ { name: 'SpawnSystem' }+);diff --git a/examples/collision-layers/thumbnail.png b/examples/collision-layers/thumbnail.pngnew file mode 100644index 000000000..4e785b021Binary files /dev/null and b/examples/collision-layers/thumbnail.png differdiff --git a/examples/collision-layers/tsconfig.json b/examples/collision-layers/tsconfig.jsonnew file mode 100644index 000000000..0a8528b29--- /dev/null+++ b/examples/collision-layers/tsconfig.json@@ -0,0 +1,22 @@+{+ "compilerOptions": {+ "target": "ES2020",+ "module": "ESNext",+ "moduleResolution": "bundler",+ "strict": true,+ "esModuleInterop": true,+ "skipLibCheck": true,+ "forceConsistentCasingInFileNames": true,+ "declaration": false,+ "outDir": "./dist",+ "rootDir": ".",+ "baseUrl": ".",+ "paths": {+ "esengine": ["./.esengine/sdk/index.d.ts"],+ "esengine/wasm": ["./.esengine/sdk/wasm.d.ts"],+ "@esengine/editor": ["./.esengine/editor/index.d.ts"]+ }+ },+ "include": ["src/**/*"],+ "exclude": ["node_modules"]+}diff --git a/examples/ecs-basics/.esengine/settings.json b/examples/ecs-basics/.esengine/settings.jsonnew file mode 100644index 000000000..4ae0a6dc7--- /dev/null+++ b/examples/ecs-basics/.esengine/settings.json@@ -0,0 +1 @@+{ "lastOpenedScene": "assets/scenes/main.esscene" }diff --git a/examples/ecs-basics/.gitignore b/examples/ecs-basics/.gitignorenew file mode 100644index 000000000..359472ac2--- /dev/null+++ b/examples/ecs-basics/.gitignore@@ -0,0 +1,7 @@+node_modules/+dist/+.vscode/+.idea/+.DS_Store+Thumbs.db+.esengine/cache/diff --git a/examples/ecs-basics/assets/scenes/main.esscene b/examples/ecs-basics/assets/scenes/main.esscenenew file mode 100644index 000000000..6d374d4ff--- /dev/null+++ b/examples/ecs-basics/assets/scenes/main.esscene@@ -0,0 +1,30 @@+{+ "version": "1.0",+ "name": "Main",+ "entities": [+ {+ "id": 0,+ "name": "Camera",+ "parent": null,+ "children": [],+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": { "x": 0, "y": 0, "z": 10 }+ }+ },+ {+ "type": "Camera",+ "data": {+ "projectionType": 1,+ "orthoSize": 300,+ "isActive": true,+ "priority": 0+ }+ }+ ],+ "visible": true+ }+ ]+}diff --git a/examples/ecs-basics/project.esproject b/examples/ecs-basics/project.esprojectnew file mode 100644index 000000000..c91f9a09b--- /dev/null+++ b/examples/ecs-basics/project.esproject@@ -0,0 +1,10 @@+{+ "name": "ECS Basics",+ "version": "0.1.0",+ "engine": "0.1.0",+ "defaultScene": "assets/scenes/main.esscene",+ "created": "2026-03-02T00:00:00.000Z",+ "modified": "2026-03-02T00:00:00.000Z",+ "spineVersion": "none",+ "designResolution": { "width": 800, "height": 600 }+}diff --git a/examples/ecs-basics/src/components.ts b/examples/ecs-basics/src/components.tsnew file mode 100644index 000000000..1ffa0f47b--- /dev/null+++ b/examples/ecs-basics/src/components.ts@@ -0,0 +1,18 @@+import { defineComponent, defineTag } from 'esengine';++export const Mover = defineComponent('Mover', {+ speed: 100,+ directionX: 1,+ directionY: 0,+});++export const Lifetime = defineComponent('Lifetime', {+ remaining: 5,+});++export const Spawner = defineComponent('Spawner', {+ interval: 0.8,+ timer: 0,+});++export const Bouncer = defineTag('Bouncer');diff --git a/examples/ecs-basics/src/main.ts b/examples/ecs-basics/src/main.tsnew file mode 100644index 000000000..cdbde179e--- /dev/null+++ b/examples/ecs-basics/src/main.ts@@ -0,0 +1,14 @@+import { addStartupSystem, addSystemToSchedule, Schedule } from 'esengine';++import './components';+import { setupSystem } from './systems/setup';+import { moveSystem } from './systems/move';+import { bounceSystem } from './systems/bounce';+import { lifetimeSystem } from './systems/lifetime';+import { spawnerSystem } from './systems/spawner';++addStartupSystem(setupSystem);+addSystemToSchedule(Schedule.Update, spawnerSystem);+addSystemToSchedule(Schedule.Update, moveSystem);+addSystemToSchedule(Schedule.Update, bounceSystem);+addSystemToSchedule(Schedule.Update, lifetimeSystem);diff --git a/examples/ecs-basics/src/systems/bounce.ts b/examples/ecs-basics/src/systems/bounce.tsnew file mode 100644index 000000000..43b486bb3--- /dev/null+++ b/examples/ecs-basics/src/systems/bounce.ts@@ -0,0 +1,22 @@+import {+ defineSystem, Query, Mut, Transform,+} from 'esengine';+import { Mover, Bouncer } from '../components';++const HALF_WIDTH = 400;+const HALF_HEIGHT = 300;++export const bounceSystem = defineSystem(+ [Query([Transform, Mut(Mover), Bouncer])],+ (query) => {+ for (const [_entity, transform, mover] of query) {+ if (transform.position.x > HALF_WIDTH || transform.position.x < -HALF_WIDTH) {+ mover.directionX *= -1;+ }+ if (transform.position.y > HALF_HEIGHT || transform.position.y < -HALF_HEIGHT) {+ mover.directionY *= -1;+ }+ }+ },+ { name: 'BounceSystem' }+);diff --git a/examples/ecs-basics/src/systems/lifetime.ts b/examples/ecs-basics/src/systems/lifetime.tsnew file mode 100644index 000000000..e2ddc26b1--- /dev/null+++ b/examples/ecs-basics/src/systems/lifetime.ts@@ -0,0 +1,22 @@+import {+ defineSystem, Query, Mut, Res, Time, Commands, Sprite,+} from 'esengine';+import { Lifetime } from '../components';++export const lifetimeSystem = defineSystem(+ [Query([Mut(Lifetime), Mut(Sprite)]), Res(Time), Commands()],+ (query, time, cmds) => {+ for (const [entity, lifetime, sprite] of query) {+ lifetime.remaining -= time.delta;++ if (lifetime.remaining < 1) {+ sprite.color.a = Math.max(0, lifetime.remaining);+ }++ if (lifetime.remaining <= 0) {+ cmds.despawn(entity);+ }+ }+ },+ { name: 'LifetimeSystem' }+);diff --git a/examples/ecs-basics/src/systems/move.ts b/examples/ecs-basics/src/systems/move.tsnew file mode 100644index 000000000..a73f53797--- /dev/null+++ b/examples/ecs-basics/src/systems/move.ts@@ -0,0 +1,15 @@+import {+ defineSystem, Query, Mut, Res, Time, Transform,+} from 'esengine';+import { Mover } from '../components';++export const moveSystem = defineSystem(+ [Query([Mut(Transform), Mover]), Res(Time)],+ (query, time) => {+ for (const [_entity, transform, mover] of query) {+ transform.position.x += mover.directionX * mover.speed * time.delta;+ transform.position.y += mover.directionY * mover.speed * time.delta;+ }+ },+ { name: 'MoveSystem' }+);diff --git a/examples/ecs-basics/src/systems/setup.ts b/examples/ecs-basics/src/systems/setup.tsnew file mode 100644index 000000000..5e470f330--- /dev/null+++ b/examples/ecs-basics/src/systems/setup.ts@@ -0,0 +1,18 @@+import {+ defineSystem, Commands, Transform, Sprite,+} from 'esengine';+import { Spawner } from '../components';++export const setupSystem = defineSystem(+ [Commands()],+ (cmds) => {+ cmds.spawn()+ .insert(Transform, { position: { x: 0, y: 0, z: 0 } })+ .insert(Sprite, {+ size: { x: 40, y: 40 },+ color: { r: 1, g: 1, b: 1, a: 1 },+ })+ .insert(Spawner, { interval: 0.8, timer: 0 });+ },+ { name: 'SetupSystem' }+);diff --git a/examples/ecs-basics/src/systems/spawner.ts b/examples/ecs-basics/src/systems/spawner.tsnew file mode 100644index 000000000..1650d4436--- /dev/null+++ b/examples/ecs-basics/src/systems/spawner.ts@@ -0,0 +1,56 @@+import {+ defineSystem, Query, Mut, Res, Time, Commands,+ Transform, Sprite,+} from 'esengine';+import { Spawner, Mover, Lifetime, Bouncer } from '../components';++const MAX_ENTITIES = 60;+let entityCount = 0;++export const spawnerSystem = defineSystem(+ [Query([Mut(Spawner), Transform]), Res(Time), Commands()],+ (query, time, cmds) => {+ for (const [_entity, spawner, transform] of query) {+ spawner.timer += time.delta;+ if (spawner.timer < spawner.interval || entityCount >= MAX_ENTITIES) continue;+ spawner.timer = 0;++ const angle = Math.random() * Math.PI * 2;+ const speed = 80 + Math.random() * 120;+ const hue = Math.random();+ const rgb = hslToRgb(hue, 0.9, 0.6);+ const size = 10 + Math.random() * 20;++ const ec = cmds.spawn()+ .insert(Transform, {+ position: { ...transform.position, z: 0 },+ })+ .insert(Sprite, {+ size: { x: size, y: size },+ color: { r: rgb.r, g: rgb.g, b: rgb.b, a: 1 },+ })+ .insert(Mover, {+ speed,+ directionX: Math.cos(angle),+ directionY: Math.sin(angle),+ })+ .insert(Lifetime, { remaining: 4 + Math.random() * 4 });++ if (Math.random() > 0.5) {+ ec.insert(Bouncer);+ }++ entityCount++;+ }+ },+ { name: 'SpawnerSystem' }+);++function hslToRgb(h: number, s: number, l: number) {+ const a = s * Math.min(l, 1 - l);+ const f = (n: number) => {+ const k = (n + h * 12) % 12;+ return l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);+ };+ return { r: f(0), g: f(8), b: f(4) };+}diff --git a/examples/ecs-basics/thumbnail.png b/examples/ecs-basics/thumbnail.pngnew file mode 100644index 000000000..649a2d622Binary files /dev/null and b/examples/ecs-basics/thumbnail.png differdiff --git a/examples/ecs-basics/tsconfig.json b/examples/ecs-basics/tsconfig.jsonnew file mode 100644index 000000000..0a8528b29--- /dev/null+++ b/examples/ecs-basics/tsconfig.json@@ -0,0 +1,22 @@+{+ "compilerOptions": {+ "target": "ES2020",+ "module": "ESNext",+ "moduleResolution": "bundler",+ "strict": true,+ "esModuleInterop": true,+ "skipLibCheck": true,+ "forceConsistentCasingInFileNames": true,+ "declaration": false,+ "outDir": "./dist",+ "rootDir": ".",+ "baseUrl": ".",+ "paths": {+ "esengine": ["./.esengine/sdk/index.d.ts"],+ "esengine/wasm": ["./.esengine/sdk/wasm.d.ts"],+ "@esengine/editor": ["./.esengine/editor/index.d.ts"]+ }+ },+ "include": ["src/**/*"],+ "exclude": ["node_modules"]+}diff --git a/examples/event-system/.esengine/settings.json b/examples/event-system/.esengine/settings.jsonnew file mode 100644index 000000000..4ae0a6dc7--- /dev/null+++ b/examples/event-system/.esengine/settings.json@@ -0,0 +1 @@+{ "lastOpenedScene": "assets/scenes/main.esscene" }diff --git a/examples/event-system/.gitignore b/examples/event-system/.gitignorenew file mode 100644index 000000000..359472ac2--- /dev/null+++ b/examples/event-system/.gitignore@@ -0,0 +1,7 @@+node_modules/+dist/+.vscode/+.idea/+.DS_Store+Thumbs.db+.esengine/cache/diff --git a/examples/event-system/assets/scenes/main.esscene b/examples/event-system/assets/scenes/main.esscenenew file mode 100644index 000000000..6d374d4ff--- /dev/null+++ b/examples/event-system/assets/scenes/main.esscene@@ -0,0 +1,30 @@+{+ "version": "1.0",+ "name": "Main",+ "entities": [+ {+ "id": 0,+ "name": "Camera",+ "parent": null,+ "children": [],+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": { "x": 0, "y": 0, "z": 10 }+ }+ },+ {+ "type": "Camera",+ "data": {+ "projectionType": 1,+ "orthoSize": 300,+ "isActive": true,+ "priority": 0+ }+ }+ ],+ "visible": true+ }+ ]+}diff --git a/examples/event-system/project.esproject b/examples/event-system/project.esprojectnew file mode 100644index 000000000..3ebf05993--- /dev/null+++ b/examples/event-system/project.esproject@@ -0,0 +1,10 @@+{+ "name": "Event System",+ "version": "0.1.0",+ "engine": "0.1.0",+ "defaultScene": "assets/scenes/main.esscene",+ "created": "2026-03-02T00:00:00.000Z",+ "modified": "2026-03-02T00:00:00.000Z",+ "spineVersion": "none",+ "designResolution": { "width": 800, "height": 600 }+}diff --git a/examples/event-system/src/components.ts b/examples/event-system/src/components.tsnew file mode 100644index 000000000..1859e32e4--- /dev/null+++ b/examples/event-system/src/components.ts@@ -0,0 +1,10 @@+import { defineComponent } from 'esengine';++export const Collectible = defineComponent('Collectible', {+ points: 10,+ pulseSpeed: 3,+});++export const ScoreLabel = defineComponent('ScoreLabel', {+ dummy: 0,+});diff --git a/examples/event-system/src/events.ts b/examples/event-system/src/events.tsnew file mode 100644index 000000000..043034a19--- /dev/null+++ b/examples/event-system/src/events.ts@@ -0,0 +1,20 @@+import { defineEvent, defineResource } from 'esengine';++export interface SpawnRequest {+ x: number;+ y: number;+ color: { r: number; g: number; b: number };+}++export interface CollectEvent {+ points: number;+}++export const SpawnRequestEvent = defineEvent<SpawnRequest>('SpawnRequest');+export const CollectEventDef = defineEvent<CollectEvent>('CollectEvent');++export interface ScoreData {+ value: number;+}++export const Score = defineResource<ScoreData>({ value: 0 }, 'Score');diff --git a/examples/event-system/src/main.ts b/examples/event-system/src/main.tsnew file mode 100644index 000000000..442780400--- /dev/null+++ b/examples/event-system/src/main.ts@@ -0,0 +1,16 @@+import { addStartupSystem, addSystemToSchedule, Schedule } from 'esengine';++import './components';+import { setupSystem } from './systems/setup';+import { timerSystem } from './systems/timer';+import { spawnSystem } from './systems/spawn';+import { collectSystem } from './systems/collect';+import { scoreSystem } from './systems/score';+import { animateSystem } from './systems/animate';++addStartupSystem(setupSystem);+addSystemToSchedule(Schedule.Update, timerSystem);+addSystemToSchedule(Schedule.Update, spawnSystem);+addSystemToSchedule(Schedule.Update, collectSystem);+addSystemToSchedule(Schedule.Update, scoreSystem);+addSystemToSchedule(Schedule.Update, animateSystem);diff --git a/examples/event-system/src/systems/animate.ts b/examples/event-system/src/systems/animate.tsnew file mode 100644index 000000000..01a0b6cbe--- /dev/null+++ b/examples/event-system/src/systems/animate.ts@@ -0,0 +1,16 @@+import {+ defineSystem, Query, Mut, Res, Time,+ Transform, Sprite,+} from 'esengine';+import { Collectible } from '../components';++export const animateSystem = defineSystem(+ [Query([Mut(Transform), Mut(Sprite), Collectible]), Res(Time)],+ (query, time) => {+ for (const [_entity, transform, sprite, collectible] of query) {+ const scale = 1 + 0.2 * Math.sin(time.elapsed * collectible.pulseSpeed);+ transform.scale = { x: scale, y: scale, z: 1 };+ }+ },+ { name: 'AnimateSystem' }+);diff --git a/examples/event-system/src/systems/collect.ts b/examples/event-system/src/systems/collect.tsnew file mode 100644index 000000000..6c1062e13--- /dev/null+++ b/examples/event-system/src/systems/collect.ts@@ -0,0 +1,25 @@+import {+ defineSystem, Query, Res, Time, Commands, EventWriter,+ Transform, Sprite,+} from 'esengine';+import { Collectible } from '../components';+import { CollectEventDef } from '../events';++const COLLECT_LIFETIME = 5;++export const collectSystem = defineSystem(+ [Query([Transform, Sprite, Collectible]), Res(Time), Commands(), EventWriter(CollectEventDef)],+ (query, time, cmds, writer) => {+ for (const [entity, _transform, sprite, collectible] of query) {+ const age = COLLECT_LIFETIME - (sprite.color.a > 0.1 ? COLLECT_LIFETIME : 0);++ sprite.color.a -= time.delta * 0.2;++ if (sprite.color.a <= 0) {+ writer.send({ points: collectible.points });+ cmds.despawn(entity);+ }+ }+ },+ { name: 'CollectSystem' }+);diff --git a/examples/event-system/src/systems/score.ts b/examples/event-system/src/systems/score.tsnew file mode 100644index 000000000..0b964f819--- /dev/null+++ b/examples/event-system/src/systems/score.ts@@ -0,0 +1,14 @@+import {+ defineSystem, EventReader, ResMut,+} from 'esengine';+import { CollectEventDef, Score } from '../events';++export const scoreSystem = defineSystem(+ [EventReader(CollectEventDef), ResMut(Score)],+ (reader, score) => {+ for (const event of reader) {+ score.value += event.points;+ }+ },+ { name: 'ScoreSystem' }+);diff --git a/examples/event-system/src/systems/setup.ts b/examples/event-system/src/systems/setup.tsnew file mode 100644index 000000000..658827af3--- /dev/null+++ b/examples/event-system/src/systems/setup.ts@@ -0,0 +1,10 @@+import { defineSystem, Commands } from 'esengine';+import { Score } from '../events';++export const setupSystem = defineSystem(+ [Commands()],+ (cmds) => {+ cmds.insertResource(Score, { value: 0 });+ },+ { name: 'SetupSystem' }+);diff --git a/examples/event-system/src/systems/spawn.ts b/examples/event-system/src/systems/spawn.tsnew file mode 100644index 000000000..46ddb1430--- /dev/null+++ b/examples/event-system/src/systems/spawn.ts@@ -0,0 +1,27 @@+import {+ defineSystem, Commands, EventReader,+ Transform, Sprite,+} from 'esengine';+import { SpawnRequestEvent } from '../events';+import { Collectible } from '../components';++export const spawnSystem = defineSystem(+ [EventReader(SpawnRequestEvent), Commands()],+ (reader, cmds) => {+ for (const event of reader) {+ cmds.spawn()+ .insert(Transform, {+ position: { x: event.x, y: event.y, z: 0 },+ })+ .insert(Sprite, {+ size: { x: 30, y: 30 },+ color: { r: event.color.r, g: event.color.g, b: event.color.b, a: 1 },+ })+ .insert(Collectible, {+ points: 10 + Math.floor(Math.random() * 20),+ pulseSpeed: 2 + Math.random() * 3,+ });+ }+ },+ { name: 'SpawnSystem' }+);diff --git a/examples/event-system/src/systems/timer.ts b/examples/event-system/src/systems/timer.tsnew file mode 100644index 000000000..ad96f3567--- /dev/null+++ b/examples/event-system/src/systems/timer.ts@@ -0,0 +1,30 @@+import {+ defineSystem, Res, Time, EventWriter,+} from 'esengine';+import { SpawnRequestEvent } from '../events';++const SPAWN_INTERVAL = 1.5;+let timer = 0;++const COLORS = [+ { r: 1, g: 0.3, b: 0.3 },+ { r: 0.3, g: 1, b: 0.3 },+ { r: 0.3, g: 0.5, b: 1 },+ { r: 1, g: 0.8, b: 0.2 },+ { r: 0.8, g: 0.3, b: 1 },+];++export const timerSystem = defineSystem(+ [Res(Time), EventWriter(SpawnRequestEvent)],+ (time, writer) => {+ timer += time.delta;+ if (timer < SPAWN_INTERVAL) return;+ timer = 0;++ const x = (Math.random() - 0.5) * 600;+ const y = (Math.random() - 0.5) * 400;+ const color = COLORS[Math.floor(Math.random() * COLORS.length)];+ writer.send({ x, y, color });+ },+ { name: 'TimerSystem' }+);diff --git a/examples/event-system/thumbnail.png b/examples/event-system/thumbnail.pngnew file mode 100644index 000000000..e9b989681Binary files /dev/null and b/examples/event-system/thumbnail.png differdiff --git a/examples/event-system/tsconfig.json b/examples/event-system/tsconfig.jsonnew file mode 100644index 000000000..0a8528b29--- /dev/null+++ b/examples/event-system/tsconfig.json@@ -0,0 +1,22 @@+{+ "compilerOptions": {+ "target": "ES2020",+ "module": "ESNext",+ "moduleResolution": "bundler",+ "strict": true,+ "esModuleInterop": true,+ "skipLibCheck": true,+ "forceConsistentCasingInFileNames": true,+ "declaration": false,+ "outDir": "./dist",+ "rootDir": ".",+ "baseUrl": ".",+ "paths": {+ "esengine": ["./.esengine/sdk/index.d.ts"],+ "esengine/wasm": ["./.esengine/sdk/wasm.d.ts"],+ "@esengine/editor": ["./.esengine/editor/index.d.ts"]+ }+ },+ "include": ["src/**/*"],+ "exclude": ["node_modules"]+}diff --git a/examples/hello-world/.esengine/settings.json b/examples/hello-world/.esengine/settings.jsonnew file mode 100644index 000000000..4ae0a6dc7--- /dev/null+++ b/examples/hello-world/.esengine/settings.json@@ -0,0 +1 @@+{ "lastOpenedScene": "assets/scenes/main.esscene" }diff --git a/examples/hello-world/.gitignore b/examples/hello-world/.gitignorenew file mode 100644index 000000000..359472ac2--- /dev/null+++ b/examples/hello-world/.gitignore@@ -0,0 +1,7 @@+node_modules/+dist/+.vscode/+.idea/+.DS_Store+Thumbs.db+.esengine/cache/diff --git a/examples/hello-world/assets/scenes/main.esscene b/examples/hello-world/assets/scenes/main.esscenenew file mode 100644index 000000000..5d33848e4--- /dev/null+++ b/examples/hello-world/assets/scenes/main.esscene@@ -0,0 +1,90 @@+{+ "version": "1.0",+ "name": "Main",+ "entities": [+ {+ "id": 0,+ "name": "Camera",+ "parent": null,+ "children": [],+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": { "x": 0, "y": 0, "z": 10 }+ }+ },+ {+ "type": "Camera",+ "data": {+ "projectionType": 1,+ "orthoSize": 300,+ "isActive": true,+ "priority": 0+ }+ }+ ],+ "visible": true+ },+ {+ "id": 1,+ "name": "Sprite0",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -200, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 60, "y": 60 }, "color": { "r": 0.92, "g": 0.28, "b": 0.28, "a": 1 }, "texture": "de747ef6-544b-4fde-8e83-a533f91eeaa5" } },+ { "type": "Rotator", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 2,+ "name": "Sprite1",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -100, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 60, "y": 60 }, "color": { "r": 0.79, "g": 0.92, "b": 0.28, "a": 1 }, "texture": "de747ef6-544b-4fde-8e83-a533f91eeaa5" } },+ { "type": "Rotator", "data": { "speed": 135, "bobSpeed": 2.3, "bobAmount": 40 } }+ ],+ "visible": true+ },+ {+ "id": 3,+ "name": "Sprite2",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 60, "y": 60 }, "color": { "r": 0.28, "g": 0.92, "b": 0.54, "a": 1 }, "texture": "de747ef6-544b-4fde-8e83-a533f91eeaa5" } },+ { "type": "Rotator", "data": { "speed": 180, "bobSpeed": 2.6, "bobAmount": 50 } }+ ],+ "visible": true+ },+ {+ "id": 4,+ "name": "Sprite3",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 100, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 60, "y": 60 }, "color": { "r": 0.28, "g": 0.54, "b": 0.92, "a": 1 }, "texture": "de747ef6-544b-4fde-8e83-a533f91eeaa5" } },+ { "type": "Rotator", "data": { "speed": 225, "bobSpeed": 2.9, "bobAmount": 60 } }+ ],+ "visible": true+ },+ {+ "id": 5,+ "name": "Sprite4",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 200, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 60, "y": 60 }, "color": { "r": 0.79, "g": 0.28, "b": 0.92, "a": 1 }, "texture": "de747ef6-544b-4fde-8e83-a533f91eeaa5" } },+ { "type": "Rotator", "data": { "speed": 270, "bobSpeed": 3.2, "bobAmount": 70 } }+ ],+ "visible": true+ }+ ]+}diff --git a/examples/hello-world/assets/textures/logo.png b/examples/hello-world/assets/textures/logo.pngnew file mode 100644index 000000000..3855998d0Binary files /dev/null and b/examples/hello-world/assets/textures/logo.png differdiff --git a/examples/hello-world/assets/textures/logo.png.meta b/examples/hello-world/assets/textures/logo.png.metanew file mode 100644index 000000000..5e6652978--- /dev/null+++ b/examples/hello-world/assets/textures/logo.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "de747ef6-544b-4fde-8e83-a533f91eeaa5",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}\ No newline at end of filediff --git a/examples/hello-world/project.esproject b/examples/hello-world/project.esprojectnew file mode 100644index 000000000..49afe581e--- /dev/null+++ b/examples/hello-world/project.esproject@@ -0,0 +1,10 @@+{+ "name": "Hello World",+ "version": "0.1.0",+ "engine": "0.1.0",+ "defaultScene": "assets/scenes/main.esscene",+ "created": "2026-03-02T00:00:00.000Z",+ "modified": "2026-03-02T00:00:00.000Z",+ "spineVersion": "none",+ "designResolution": { "width": 800, "height": 600 }+}diff --git a/examples/hello-world/src/components.ts b/examples/hello-world/src/components.tsnew file mode 100644index 000000000..c798456d8--- /dev/null+++ b/examples/hello-world/src/components.ts@@ -0,0 +1,8 @@+import { defineComponent } from 'esengine';++export const Rotator = defineComponent('Rotator', {+ speed: 90,+ baseY: 0,+ bobSpeed: 2,+ bobAmount: 30,+});diff --git a/examples/hello-world/src/main.ts b/examples/hello-world/src/main.tsnew file mode 100644index 000000000..e893da9c5--- /dev/null+++ b/examples/hello-world/src/main.ts@@ -0,0 +1,7 @@+import { addSystemToSchedule, Schedule } from 'esengine';++import './components';+import { rotateSystem, colorPulseSystem } from './systems/animate';++addSystemToSchedule(Schedule.Update, rotateSystem);+addSystemToSchedule(Schedule.Update, colorPulseSystem);diff --git a/examples/hello-world/src/systems/animate.ts b/examples/hello-world/src/systems/animate.tsnew file mode 100644index 000000000..6390f20ff--- /dev/null+++ b/examples/hello-world/src/systems/animate.ts@@ -0,0 +1,32 @@+import {+ defineSystem, Query, Mut, Res, Time,+ Transform, Sprite,+} from 'esengine';+import { Rotator } from '../components';++export const rotateSystem = defineSystem(+ [Query([Mut(Transform), Rotator]), Res(Time)],+ (query, time) => {+ for (const [_entity, transform, rotator] of query) {+ const angle = rotator.speed * time.elapsed * (Math.PI / 180);+ const cos = Math.cos(angle);+ const sin = Math.sin(angle);+ transform.rotation = { w: cos, x: 0, y: 0, z: sin };++ transform.position.y =+ rotator.baseY + Math.sin(time.elapsed * rotator.bobSpeed) * rotator.bobAmount;+ }+ },+ { name: 'RotateSystem' }+);++export const colorPulseSystem = defineSystem(+ [Query([Mut(Sprite), Rotator]), Res(Time)],+ (query, time) => {+ for (const [_entity, sprite, rotator] of query) {+ const pulse = 0.7 + 0.3 * Math.sin(time.elapsed * rotator.bobSpeed * 1.5);+ sprite.color.a = pulse;+ }+ },+ { name: 'ColorPulseSystem' }+);diff --git a/examples/hello-world/thumbnail.png b/examples/hello-world/thumbnail.pngnew file mode 100644index 000000000..aa1b2decbBinary files /dev/null and b/examples/hello-world/thumbnail.png differdiff --git a/examples/hello-world/tsconfig.json b/examples/hello-world/tsconfig.jsonnew file mode 100644index 000000000..0a8528b29--- /dev/null+++ b/examples/hello-world/tsconfig.json@@ -0,0 +1,22 @@+{+ "compilerOptions": {+ "target": "ES2020",+ "module": "ESNext",+ "moduleResolution": "bundler",+ "strict": true,+ "esModuleInterop": true,+ "skipLibCheck": true,+ "forceConsistentCasingInFileNames": true,+ "declaration": false,+ "outDir": "./dist",+ "rootDir": ".",+ "baseUrl": ".",+ "paths": {+ "esengine": ["./.esengine/sdk/index.d.ts"],+ "esengine/wasm": ["./.esengine/sdk/wasm.d.ts"],+ "@esengine/editor": ["./.esengine/editor/index.d.ts"]+ }+ },+ "include": ["src/**/*"],+ "exclude": ["node_modules"]+}diff --git a/examples/input-demo/.esengine/settings.json b/examples/input-demo/.esengine/settings.jsonnew file mode 100644index 000000000..4ae0a6dc7--- /dev/null+++ b/examples/input-demo/.esengine/settings.json@@ -0,0 +1 @@+{ "lastOpenedScene": "assets/scenes/main.esscene" }diff --git a/examples/input-demo/.gitignore b/examples/input-demo/.gitignorenew file mode 100644index 000000000..359472ac2--- /dev/null+++ b/examples/input-demo/.gitignore@@ -0,0 +1,7 @@+node_modules/+dist/+.vscode/+.idea/+.DS_Store+Thumbs.db+.esengine/cache/diff --git a/examples/input-demo/assets/scenes/main.esscene b/examples/input-demo/assets/scenes/main.esscenenew file mode 100644index 000000000..91571a493--- /dev/null+++ b/examples/input-demo/assets/scenes/main.esscene@@ -0,0 +1,41 @@+{+ "version": "1.0",+ "name": "Main",+ "entities": [+ {+ "id": 0,+ "name": "Camera",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 10 } } },+ { "type": "Camera", "data": { "projectionType": 1, "orthoSize": 300, "isActive": true, "priority": 0 } }+ ],+ "visible": true+ },+ {+ "id": 1,+ "name": "Player",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -150, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 40, "y": 40 }, "color": { "r": 0.3, "g": 0.8, "b": 1, "a": 1 }, "layer": 2, "texture": "52b02713-c5ba-4b97-a9ae-311511dd26ec" } },+ { "type": "PlayerControl", "data": { "speed": 250 } }+ ],+ "visible": true+ },+ {+ "id": 2,+ "name": "MouseFollower",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 150, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 30, "y": 30 }, "color": { "r": 1, "g": 0.5, "b": 0.3, "a": 1 }, "layer": 2, "texture": "625449a9-8566-4af6-b8d1-4c762cb47f1e" } },+ { "type": "MouseFollower", "data": {} }+ ],+ "visible": true+ }+ ]+}diff --git a/examples/input-demo/assets/textures/cursor.png b/examples/input-demo/assets/textures/cursor.pngnew file mode 100644index 000000000..6ebca04d2Binary files /dev/null and b/examples/input-demo/assets/textures/cursor.png differdiff --git a/examples/input-demo/assets/textures/cursor.png.meta b/examples/input-demo/assets/textures/cursor.png.metanew file mode 100644index 000000000..1f03aec9e--- /dev/null+++ b/examples/input-demo/assets/textures/cursor.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "625449a9-8566-4af6-b8d1-4c762cb47f1e",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}\ No newline at end of filediff --git a/examples/input-demo/assets/textures/player.png b/examples/input-demo/assets/textures/player.pngnew file mode 100644index 000000000..763889178Binary files /dev/null and b/examples/input-demo/assets/textures/player.png differdiff --git a/examples/input-demo/assets/textures/player.png.meta b/examples/input-demo/assets/textures/player.png.metanew file mode 100644index 000000000..15eb9fcfc--- /dev/null+++ b/examples/input-demo/assets/textures/player.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "52b02713-c5ba-4b97-a9ae-311511dd26ec",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}\ No newline at end of filediff --git a/examples/input-demo/project.esproject b/examples/input-demo/project.esprojectnew file mode 100644index 000000000..e17d10aa1--- /dev/null+++ b/examples/input-demo/project.esproject@@ -0,0 +1,10 @@+{+ "name": "Input Demo",+ "version": "0.1.0",+ "engine": "0.1.0",+ "defaultScene": "assets/scenes/main.esscene",+ "created": "2026-03-02T00:00:00.000Z",+ "modified": "2026-03-02T00:00:00.000Z",+ "spineVersion": "none",+ "designResolution": { "width": 800, "height": 600 }+}diff --git a/examples/input-demo/src/components.ts b/examples/input-demo/src/components.tsnew file mode 100644index 000000000..11ab7455e--- /dev/null+++ b/examples/input-demo/src/components.ts@@ -0,0 +1,11 @@+import { defineComponent, defineTag } from 'esengine';++export const PlayerControl = defineComponent('PlayerControl', {+ speed: 250,+});++export const MouseFollower = defineTag('MouseFollower');++export const Trail = defineComponent('Trail', {+ lifetime: 0.6,+});diff --git a/examples/input-demo/src/main.ts b/examples/input-demo/src/main.tsnew file mode 100644index 000000000..99fd7caed--- /dev/null+++ b/examples/input-demo/src/main.ts@@ -0,0 +1,11 @@+import { addSystemToSchedule, Schedule } from 'esengine';++import './components';+import { keyboardMoveSystem } from './systems/keyboard';+import { mouseFollowSystem, mouseClickSystem } from './systems/mouse';+import { trailSystem } from './systems/trail';++addSystemToSchedule(Schedule.Update, keyboardMoveSystem);+addSystemToSchedule(Schedule.Update, mouseFollowSystem);+addSystemToSchedule(Schedule.Update, mouseClickSystem);+addSystemToSchedule(Schedule.Update, trailSystem);diff --git a/examples/input-demo/src/systems/keyboard.ts b/examples/input-demo/src/systems/keyboard.tsnew file mode 100644index 000000000..3494c1820--- /dev/null+++ b/examples/input-demo/src/systems/keyboard.ts@@ -0,0 +1,29 @@+import {+ defineSystem, Query, Mut, Res, Time, Input, Transform,+} from 'esengine';+import { PlayerControl } from '../components';++export const keyboardMoveSystem = defineSystem(+ [Query([Mut(Transform), PlayerControl]), Res(Input), Res(Time)],+ (query, input, time) => {+ for (const [_entity, transform, player] of query) {+ let dx = 0;+ let dy = 0;++ if (input.isKeyDown('KeyW') || input.isKeyDown('ArrowUp')) dy += 1;+ if (input.isKeyDown('KeyS') || input.isKeyDown('ArrowDown')) dy -= 1;+ if (input.isKeyDown('KeyA') || input.isKeyDown('ArrowLeft')) dx -= 1;+ if (input.isKeyDown('KeyD') || input.isKeyDown('ArrowRight')) dx += 1;++ if (dx !== 0 || dy !== 0) {+ const len = Math.sqrt(dx * dx + dy * dy);+ transform.position.x += (dx / len) * player.speed * time.delta;+ transform.position.y += (dy / len) * player.speed * time.delta;+ }++ const scale = input.isKeyDown('Space') ? 1.5 : 1;+ transform.scale = { x: scale, y: scale, z: 1 };+ }+ },+ { name: 'KeyboardMoveSystem' }+);diff --git a/examples/input-demo/src/systems/mouse.ts b/examples/input-demo/src/systems/mouse.tsnew file mode 100644index 000000000..2a1d3f8f7--- /dev/null+++ b/examples/input-demo/src/systems/mouse.ts@@ -0,0 +1,52 @@+import {+ defineSystem, Query, Mut, Res, Input, Commands,+ Transform, Sprite,+} from 'esengine';+import { MouseFollower, Trail } from '../components';++const FOLLOW_SPEED = 8;++export const mouseFollowSystem = defineSystem(+ [Query([Mut(Transform), MouseFollower]), Res(Input)],+ (query, input) => {+ const mouse = input.getMousePosition();+ const worldX = mouse.x;+ const worldY = mouse.y;++ for (const [_entity, transform] of query) {+ transform.position.x += (worldX - transform.position.x) * FOLLOW_SPEED * 0.016;+ transform.position.y += (worldY - transform.position.y) * FOLLOW_SPEED * 0.016;+ }+ },+ { name: 'MouseFollowSystem' }+);++export const mouseClickSystem = defineSystem(+ [Res(Input), Commands()],+ (input, cmds) => {+ if (input.isMouseButtonPressed(0)) {+ const pos = input.getMousePosition();+ cmds.spawn()+ .insert(Transform, { position: { x: pos.x, y: pos.y, z: 0 } })+ .insert(Sprite, {+ size: { x: 20, y: 20 },+ color: { r: 1, g: 1, b: 0.3, a: 1 },+ layer: 1,+ })+ .insert(Trail, { lifetime: 0.6 });+ }++ if (input.isMouseButtonPressed(2)) {+ const pos = input.getMousePosition();+ cmds.spawn()+ .insert(Transform, { position: { x: pos.x, y: pos.y, z: 0 } })+ .insert(Sprite, {+ size: { x: 16, y: 16 },+ color: { r: 0.8, g: 0.3, b: 1, a: 1 },+ layer: 1,+ })+ .insert(Trail, { lifetime: 1.0 });+ }+ },+ { name: 'MouseClickSystem' }+);diff --git a/examples/input-demo/src/systems/trail.ts b/examples/input-demo/src/systems/trail.tsnew file mode 100644index 000000000..810bc8b12--- /dev/null+++ b/examples/input-demo/src/systems/trail.ts@@ -0,0 +1,25 @@+import {+ defineSystem, Query, Mut, Res, Time, Commands,+ Transform, Sprite,+} from 'esengine';+import { Trail } from '../components';++export const trailSystem = defineSystem(+ [Query([Mut(Transform), Mut(Sprite), Mut(Trail)]), Res(Time), Commands()],+ (query, time, cmds) => {+ for (const [entity, transform, sprite, trail] of query) {+ trail.lifetime -= time.delta;+ sprite.color.a = Math.max(0, trail.lifetime);+ transform.scale = {+ x: trail.lifetime * 1.5,+ y: trail.lifetime * 1.5,+ z: 1,+ };++ if (trail.lifetime <= 0) {+ cmds.despawn(entity);+ }+ }+ },+ { name: 'TrailSystem' }+);diff --git a/examples/input-demo/thumbnail.png b/examples/input-demo/thumbnail.pngnew file mode 100644index 000000000..8606fd765Binary files /dev/null and b/examples/input-demo/thumbnail.png differdiff --git a/examples/input-demo/tsconfig.json b/examples/input-demo/tsconfig.jsonnew file mode 100644index 000000000..0a8528b29--- /dev/null+++ b/examples/input-demo/tsconfig.json@@ -0,0 +1,22 @@+{+ "compilerOptions": {+ "target": "ES2020",+ "module": "ESNext",+ "moduleResolution": "bundler",+ "strict": true,+ "esModuleInterop": true,+ "skipLibCheck": true,+ "forceConsistentCasingInFileNames": true,+ "declaration": false,+ "outDir": "./dist",+ "rootDir": ".",+ "baseUrl": ".",+ "paths": {+ "esengine": ["./.esengine/sdk/index.d.ts"],+ "esengine/wasm": ["./.esengine/sdk/wasm.d.ts"],+ "@esengine/editor": ["./.esengine/editor/index.d.ts"]+ }+ },+ "include": ["src/**/*"],+ "exclude": ["node_modules"]+}diff --git a/examples/particle-demo/.esengine/settings.json b/examples/particle-demo/.esengine/settings.jsonnew file mode 100644index 000000000..4ae0a6dc7--- /dev/null+++ b/examples/particle-demo/.esengine/settings.json@@ -0,0 +1 @@+{ "lastOpenedScene": "assets/scenes/main.esscene" }diff --git a/examples/particle-demo/.gitignore b/examples/particle-demo/.gitignorenew file mode 100644index 000000000..359472ac2--- /dev/null+++ b/examples/particle-demo/.gitignore@@ -0,0 +1,7 @@+node_modules/+dist/+.vscode/+.idea/+.DS_Store+Thumbs.db+.esengine/cache/diff --git a/examples/particle-demo/assets/scenes/main.esscene b/examples/particle-demo/assets/scenes/main.esscenenew file mode 100644index 000000000..4b35b2ed2--- /dev/null+++ b/examples/particle-demo/assets/scenes/main.esscene@@ -0,0 +1,169 @@+{+ "version": "1.0",+ "name": "Main",+ "entities": [+ {+ "id": 0,+ "name": "Camera",+ "parent": null,+ "children": [],+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": { "x": 0, "y": 0, "z": 10 }+ }+ },+ {+ "type": "Camera",+ "data": {+ "projectionType": 1,+ "orthoSize": 300,+ "isActive": true,+ "priority": 0+ }+ }+ ],+ "visible": true+ },+ {+ "id": 1,+ "name": "Fire",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -250, "y": -100, "z": 0 } } },+ { "type": "ParticleEmitter", "data": {+ "rate": 40,+ "maxParticles": 200,+ "lifetimeMin": 0.8,+ "lifetimeMax": 1.5,+ "shape": 1,+ "shapeRadius": 20,+ "speedMin": 80,+ "speedMax": 180,+ "angleSpreadMin": 70,+ "angleSpreadMax": 110,+ "startSizeMin": 15,+ "startSizeMax": 25,+ "endSizeMin": 2,+ "endSizeMax": 5,+ "sizeEasing": 2,+ "startColor": { "r": 1, "g": 0.6, "b": 0.1, "a": 1 },+ "endColor": { "r": 1, "g": 0.1, "b": 0, "a": 0 },+ "colorEasing": 1,+ "gravity": { "x": 0, "y": 50 },+ "simulationSpace": 0,+ "looping": true,+ "playOnStart": true,+ "texture": "24cb4e0f-7c75-4df4-9a4d-58480ee405c0"+ }}+ ],+ "visible": true+ },+ {+ "id": 2,+ "name": "Sparkle",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ { "type": "ParticleEmitter", "data": {+ "rate": 25,+ "maxParticles": 150,+ "lifetimeMin": 1,+ "lifetimeMax": 2,+ "shape": 0,+ "speedMin": 100,+ "speedMax": 250,+ "angleSpreadMin": 0,+ "angleSpreadMax": 360,+ "startSizeMin": 8,+ "startSizeMax": 14,+ "endSizeMin": 0,+ "endSizeMax": 0,+ "sizeEasing": 2,+ "startColor": { "r": 0.5, "g": 0.8, "b": 1, "a": 1 },+ "endColor": { "r": 0.2, "g": 0.4, "b": 1, "a": 0 },+ "colorEasing": 0,+ "angularVelocityMin": -180,+ "angularVelocityMax": 180,+ "damping": 0.5,+ "looping": true,+ "playOnStart": true,+ "texture": "24cb4e0f-7c75-4df4-9a4d-58480ee405c0"+ }}+ ],+ "visible": true+ },+ {+ "id": 3,+ "name": "Smoke",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 250, "y": -100, "z": 0 } } },+ { "type": "ParticleEmitter", "data": {+ "rate": 15,+ "maxParticles": 100,+ "lifetimeMin": 2,+ "lifetimeMax": 4,+ "shape": 1,+ "shapeRadius": 10,+ "speedMin": 30,+ "speedMax": 60,+ "angleSpreadMin": 60,+ "angleSpreadMax": 120,+ "startSizeMin": 20,+ "startSizeMax": 30,+ "endSizeMin": 80,+ "endSizeMax": 120,+ "sizeEasing": 2,+ "startColor": { "r": 0.5, "g": 0.5, "b": 0.5, "a": 0.6 },+ "endColor": { "r": 0.3, "g": 0.3, "b": 0.3, "a": 0 },+ "colorEasing": 1,+ "gravity": { "x": 0, "y": 20 },+ "damping": 0.3,+ "looping": true,+ "playOnStart": true,+ "texture": "24cb4e0f-7c75-4df4-9a4d-58480ee405c0"+ }}+ ],+ "visible": true+ },+ {+ "id": 4,+ "name": "Burst",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": 180, "z": 0 } } },+ { "type": "ParticleEmitter", "data": {+ "rate": 0,+ "burstCount": 30,+ "burstInterval": 2,+ "maxParticles": 200,+ "lifetimeMin": 0.5,+ "lifetimeMax": 1.2,+ "shape": 0,+ "speedMin": 200,+ "speedMax": 400,+ "angleSpreadMin": 0,+ "angleSpreadMax": 360,+ "startSizeMin": 6,+ "startSizeMax": 12,+ "endSizeMin": 0,+ "endSizeMax": 0,+ "sizeEasing": 0,+ "startColor": { "r": 1, "g": 0.9, "b": 0.2, "a": 1 },+ "endColor": { "r": 1, "g": 0.3, "b": 0.1, "a": 0 },+ "gravity": { "x": 0, "y": -200 },+ "looping": true,+ "playOnStart": true,+ "texture": "24cb4e0f-7c75-4df4-9a4d-58480ee405c0"+ }}+ ],+ "visible": true+ }+ ]+}diff --git a/examples/particle-demo/assets/textures/particle.png b/examples/particle-demo/assets/textures/particle.pngnew file mode 100644index 000000000..a8962624fBinary files /dev/null and b/examples/particle-demo/assets/textures/particle.png differdiff --git a/examples/particle-demo/assets/textures/particle.png.meta b/examples/particle-demo/assets/textures/particle.png.metanew file mode 100644index 000000000..112809f71--- /dev/null+++ b/examples/particle-demo/assets/textures/particle.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "24cb4e0f-7c75-4df4-9a4d-58480ee405c0",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}\ No newline at end of filediff --git a/examples/particle-demo/project.esproject b/examples/particle-demo/project.esprojectnew file mode 100644index 000000000..bdb9e661a--- /dev/null+++ b/examples/particle-demo/project.esproject@@ -0,0 +1,10 @@+{+ "name": "Particle Effects",+ "version": "0.1.0",+ "engine": "0.1.0",+ "defaultScene": "assets/scenes/main.esscene",+ "created": "2026-03-02T00:00:00.000Z",+ "modified": "2026-03-02T00:00:00.000Z",+ "spineVersion": "none",+ "designResolution": { "width": 800, "height": 600 }+}diff --git a/examples/particle-demo/src/main.ts b/examples/particle-demo/src/main.tsnew file mode 100644index 000000000..9f0253242--- /dev/null+++ b/examples/particle-demo/src/main.ts@@ -0,0 +1 @@+// Scene handles all entitiesdiff --git a/examples/particle-demo/thumbnail.png b/examples/particle-demo/thumbnail.pngnew file mode 100644index 000000000..4abc36b6fBinary files /dev/null and b/examples/particle-demo/thumbnail.png differdiff --git a/examples/particle-demo/tsconfig.json b/examples/particle-demo/tsconfig.jsonnew file mode 100644index 000000000..0a8528b29--- /dev/null+++ b/examples/particle-demo/tsconfig.json@@ -0,0 +1,22 @@+{+ "compilerOptions": {+ "target": "ES2020",+ "module": "ESNext",+ "moduleResolution": "bundler",+ "strict": true,+ "esModuleInterop": true,+ "skipLibCheck": true,+ "forceConsistentCasingInFileNames": true,+ "declaration": false,+ "outDir": "./dist",+ "rootDir": ".",+ "baseUrl": ".",+ "paths": {+ "esengine": ["./.esengine/sdk/index.d.ts"],+ "esengine/wasm": ["./.esengine/sdk/wasm.d.ts"],+ "@esengine/editor": ["./.esengine/editor/index.d.ts"]+ }+ },+ "include": ["src/**/*"],+ "exclude": ["node_modules"]+}diff --git a/examples/physics-playground/.esengine/settings.json b/examples/physics-playground/.esengine/settings.jsonnew file mode 100644index 000000000..4ae0a6dc7--- /dev/null+++ b/examples/physics-playground/.esengine/settings.json@@ -0,0 +1 @@+{ "lastOpenedScene": "assets/scenes/main.esscene" }diff --git a/examples/physics-playground/.gitignore b/examples/physics-playground/.gitignorenew file mode 100644index 000000000..359472ac2--- /dev/null+++ b/examples/physics-playground/.gitignore@@ -0,0 +1,7 @@+node_modules/+dist/+.vscode/+.idea/+.DS_Store+Thumbs.db+.esengine/cache/diff --git a/examples/physics-playground/assets/scenes/main.esscene b/examples/physics-playground/assets/scenes/main.esscenenew file mode 100644index 000000000..7a941b894--- /dev/null+++ b/examples/physics-playground/assets/scenes/main.esscene@@ -0,0 +1,80 @@+{+ "version": "1.0",+ "name": "Main",+ "entities": [+ {+ "id": 0,+ "name": "Camera",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 10 } } },+ { "type": "Camera", "data": { "projectionType": 1, "orthoSize": 300, "isActive": true, "priority": 0 } }+ ],+ "visible": true+ },+ {+ "id": 1,+ "name": "Ground",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": -250, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 700, "y": 20 }, "color": { "r": 0.4, "g": 0.4, "b": 0.45, "a": 1 } } },+ { "type": "RigidBody", "data": { "bodyType": 0 } },+ { "type": "BoxCollider", "data": { "halfExtents": { "x": 3.5, "y": 0.1 } } }+ ],+ "visible": true+ },+ {+ "id": 2,+ "name": "LeftWall",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -350, "y": -50, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 20, "y": 400 }, "color": { "r": 0.4, "g": 0.4, "b": 0.45, "a": 1 } } },+ { "type": "RigidBody", "data": { "bodyType": 0 } },+ { "type": "BoxCollider", "data": { "halfExtents": { "x": 0.1, "y": 2.0 } } }+ ],+ "visible": true+ },+ {+ "id": 3,+ "name": "RightWall",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 350, "y": -50, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 20, "y": 400 }, "color": { "r": 0.4, "g": 0.4, "b": 0.45, "a": 1 } } },+ { "type": "RigidBody", "data": { "bodyType": 0 } },+ { "type": "BoxCollider", "data": { "halfExtents": { "x": 0.1, "y": 2.0 } } }+ ],+ "visible": true+ },+ {+ "id": 4,+ "name": "Platform",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -80, "y": -100, "z": 0 }, "rotation": { "w": 0.966, "x": 0, "y": 0, "z": 0.259 } } },+ { "type": "Sprite", "data": { "size": { "x": 250, "y": 14 }, "color": { "r": 0.5, "g": 0.5, "b": 0.55, "a": 1 } } },+ { "type": "RigidBody", "data": { "bodyType": 0 } },+ { "type": "BoxCollider", "data": { "halfExtents": { "x": 1.25, "y": 0.07 } } }+ ],+ "visible": true+ },+ {+ "id": 5,+ "name": "SpawnTimer",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ { "type": "SpawnTimer", "data": { "interval": 1.2, "timer": 0 } }+ ],+ "visible": true+ }+ ]+}diff --git a/examples/physics-playground/assets/textures/ball.png b/examples/physics-playground/assets/textures/ball.pngnew file mode 100644index 000000000..6c55f15c5Binary files /dev/null and b/examples/physics-playground/assets/textures/ball.png differdiff --git a/examples/physics-playground/assets/textures/ball.png.meta b/examples/physics-playground/assets/textures/ball.png.metanew file mode 100644index 000000000..243c063e0--- /dev/null+++ b/examples/physics-playground/assets/textures/ball.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "0477f2e4-d640-4a8e-b696-36f52b7583df",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}\ No newline at end of filediff --git a/examples/physics-playground/assets/textures/crate.png b/examples/physics-playground/assets/textures/crate.pngnew file mode 100644index 000000000..b742a0eafBinary files /dev/null and b/examples/physics-playground/assets/textures/crate.png differdiff --git a/examples/physics-playground/assets/textures/crate.png.meta b/examples/physics-playground/assets/textures/crate.png.metanew file mode 100644index 000000000..41dbc122c--- /dev/null+++ b/examples/physics-playground/assets/textures/crate.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "88be0710-ab45-4377-ac76-166aecfbd56f",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}\ No newline at end of filediff --git a/examples/physics-playground/project.esproject b/examples/physics-playground/project.esprojectnew file mode 100644index 000000000..71be39381--- /dev/null+++ b/examples/physics-playground/project.esproject@@ -0,0 +1,13 @@+{+ "name": "Physics Playground",+ "version": "0.1.0",+ "engine": "0.1.0",+ "defaultScene": "assets/scenes/main.esscene",+ "created": "2026-03-02T00:00:00.000Z",+ "modified": "2026-03-02T00:00:00.000Z",+ "spineVersion": "none",+ "enablePhysics": true,+ "physicsGravityX": 0,+ "physicsGravityY": -9.8,+ "designResolution": { "width": 800, "height": 600 }+}diff --git a/examples/physics-playground/src/components.ts b/examples/physics-playground/src/components.tsnew file mode 100644index 000000000..4d85e4c74--- /dev/null+++ b/examples/physics-playground/src/components.ts@@ -0,0 +1,6 @@+import { defineComponent } from 'esengine';++export const SpawnTimer = defineComponent('SpawnTimer', {+ interval: 1.2,+ timer: 0,+});diff --git a/examples/physics-playground/src/main.ts b/examples/physics-playground/src/main.tsnew file mode 100644index 000000000..b021f4937--- /dev/null+++ b/examples/physics-playground/src/main.ts@@ -0,0 +1,6 @@+import { addSystemToSchedule, Schedule } from 'esengine';++import './components';+import { spawnSystem } from './systems/spawn';++addSystemToSchedule(Schedule.Update, spawnSystem);diff --git a/examples/physics-playground/src/systems/spawn.ts b/examples/physics-playground/src/systems/spawn.tsnew file mode 100644index 000000000..3da4de1e1--- /dev/null+++ b/examples/physics-playground/src/systems/spawn.ts@@ -0,0 +1,75 @@+import {+ defineSystem, Query, Mut, Res, Time, Commands,+ Transform, Sprite, RigidBody, BoxCollider, CircleCollider, BodyType,+} from 'esengine';+import { SpawnTimer } from '../components';++const MAX_BODIES = 40;+const SPAWN_Y = 250;+const PPU = 100;++let bodyCount = 0;++export const spawnSystem = defineSystem(+ [Query([Mut(SpawnTimer)]), Res(Time), Commands()],+ (query, time, cmds) => {+ for (const [_entity, timer] of query) {+ timer.timer += time.delta;+ if (timer.timer < timer.interval || bodyCount >= MAX_BODIES) continue;+ timer.timer = 0;++ const x = (Math.random() - 0.5) * 400;+ const hue = Math.random();+ const rgb = hslToRgb(hue, 0.85, 0.55);+ const useCircle = Math.random() > 0.5;++ if (useCircle) {+ const radius = 12 + Math.random() * 18;+ cmds.spawn()+ .insert(Transform, { position: { x, y: SPAWN_Y, z: 0 } })+ .insert(Sprite, {+ size: { x: radius * 2, y: radius * 2 },+ color: { r: rgb.r, g: rgb.g, b: rgb.b, a: 1 },+ texture: '0477f2e4-d640-4a8e-b696-36f52b7583df',+ })+ .insert(RigidBody, {+ bodyType: BodyType.Dynamic,+ restitution: 0.3 + Math.random() * 0.5,+ })+ .insert(CircleCollider, {+ radius: radius / PPU,+ restitution: 0.3 + Math.random() * 0.5,+ });+ } else {+ const w = 20 + Math.random() * 30;+ const h = 20 + Math.random() * 30;+ cmds.spawn()+ .insert(Transform, { position: { x, y: SPAWN_Y, z: 0 } })+ .insert(Sprite, {+ size: { x: w, y: h },+ color: { r: rgb.r, g: rgb.g, b: rgb.b, a: 1 },+ texture: '88be0710-ab45-4377-ac76-166aecfbd56f',+ })+ .insert(RigidBody, {+ bodyType: BodyType.Dynamic,+ })+ .insert(BoxCollider, {+ halfExtents: { x: w / 2 / PPU, y: h / 2 / PPU },+ restitution: 0.2 + Math.random() * 0.4,+ });+ }++ bodyCount++;+ }+ },+ { name: 'SpawnSystem' }+);++function hslToRgb(h: number, s: number, l: number) {+ const a = s * Math.min(l, 1 - l);+ const f = (n: number) => {+ const k = (n + h * 12) % 12;+ return l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);+ };+ return { r: f(0), g: f(8), b: f(4) };+}diff --git a/examples/physics-playground/thumbnail.png b/examples/physics-playground/thumbnail.pngnew file mode 100644index 000000000..74aa4c86cBinary files /dev/null and b/examples/physics-playground/thumbnail.png differdiff --git a/examples/physics-playground/tsconfig.json b/examples/physics-playground/tsconfig.jsonnew file mode 100644index 000000000..0a8528b29--- /dev/null+++ b/examples/physics-playground/tsconfig.json@@ -0,0 +1,22 @@+{+ "compilerOptions": {+ "target": "ES2020",+ "module": "ESNext",+ "moduleResolution": "bundler",+ "strict": true,+ "esModuleInterop": true,+ "skipLibCheck": true,+ "forceConsistentCasingInFileNames": true,+ "declaration": false,+ "outDir": "./dist",+ "rootDir": ".",+ "baseUrl": ".",+ "paths": {+ "esengine": ["./.esengine/sdk/index.d.ts"],+ "esengine/wasm": ["./.esengine/sdk/wasm.d.ts"],+ "@esengine/editor": ["./.esengine/editor/index.d.ts"]+ }+ },+ "include": ["src/**/*"],+ "exclude": ["node_modules"]+}diff --git a/examples/platformer/.esengine/settings.json b/examples/platformer/.esengine/settings.jsonnew file mode 100644index 000000000..4ae0a6dc7--- /dev/null+++ b/examples/platformer/.esengine/settings.json@@ -0,0 +1 @@+{ "lastOpenedScene": "assets/scenes/main.esscene" }diff --git a/examples/platformer/.gitignore b/examples/platformer/.gitignorenew file mode 100644index 000000000..359472ac2--- /dev/null+++ b/examples/platformer/.gitignore@@ -0,0 +1,7 @@+node_modules/+dist/+.vscode/+.idea/+.DS_Store+Thumbs.db+.esengine/cache/diff --git a/examples/platformer/assets/scenes/main.esscene b/examples/platformer/assets/scenes/main.esscenenew file mode 100644index 000000000..1e01f7b55--- /dev/null+++ b/examples/platformer/assets/scenes/main.esscene@@ -0,0 +1,170 @@+{+ "version": "1.0",+ "name": "Main",+ "entities": [+ {+ "id": 0,+ "name": "Camera",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 10 } } },+ { "type": "Camera", "data": { "projectionType": 1, "orthoSize": 350, "isActive": true, "priority": 0 } }+ ],+ "visible": true+ },+ {+ "id": 1,+ "name": "Ground",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": -250, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 800, "y": 40 }, "color": { "r": 0.4, "g": 0.7, "b": 0.3, "a": 1 }, "texture": "931ebe66-cded-4b32-8444-0737da446c0d" } },+ { "type": "Platform", "data": { "width": 800, "height": 40 } }+ ],+ "visible": true+ },+ {+ "id": 2,+ "name": "Platform1",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -200, "y": -120, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 160, "y": 24 }, "color": { "r": 0.6, "g": 0.5, "b": 0.3, "a": 1 }, "texture": "0258e55e-9aa0-47eb-8092-7386e03f97c7" } },+ { "type": "Platform", "data": { "width": 160, "height": 24 } }+ ],+ "visible": true+ },+ {+ "id": 3,+ "name": "Platform2",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 100, "y": -20, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 160, "y": 24 }, "color": { "r": 0.6, "g": 0.5, "b": 0.3, "a": 1 }, "texture": "0258e55e-9aa0-47eb-8092-7386e03f97c7" } },+ { "type": "Platform", "data": { "width": 160, "height": 24 } }+ ],+ "visible": true+ },+ {+ "id": 4,+ "name": "Platform3",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -80, "y": 100, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 200, "y": 24 }, "color": { "r": 0.6, "g": 0.5, "b": 0.3, "a": 1 }, "texture": "0258e55e-9aa0-47eb-8092-7386e03f97c7" } },+ { "type": "Platform", "data": { "width": 200, "height": 24 } }+ ],+ "visible": true+ },+ {+ "id": 5,+ "name": "Platform4",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 220, "y": 180, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 140, "y": 24 }, "color": { "r": 0.6, "g": 0.5, "b": 0.3, "a": 1 }, "texture": "0258e55e-9aa0-47eb-8092-7386e03f97c7" } },+ { "type": "Platform", "data": { "width": 140, "height": 24 } }+ ],+ "visible": true+ },+ {+ "id": 6,+ "name": "Player",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -200, "y": -200, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 32, "y": 48 }, "color": { "r": 0.2, "g": 0.6, "b": 1, "a": 1 }, "texture": "2bde6b7d-0dbe-4434-9e30-ed1cd8e3fe82" } },+ { "type": "Player", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 7,+ "name": "Coin1",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -200, "y": -80, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 24, "y": 24 }, "color": { "r": 1, "g": 0.85, "b": 0, "a": 1 }, "texture": "c18959bd-f6be-49d3-945b-3d6ecf8ef14f" } },+ { "type": "Coin", "data": { "baseY": -80, "bobTimer": 0 } }+ ],+ "visible": true+ },+ {+ "id": 8,+ "name": "Coin2",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 100, "y": 20, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 24, "y": 24 }, "color": { "r": 1, "g": 0.85, "b": 0, "a": 1 }, "texture": "c18959bd-f6be-49d3-945b-3d6ecf8ef14f" } },+ { "type": "Coin", "data": { "baseY": 20, "bobTimer": 0 } }+ ],+ "visible": true+ },+ {+ "id": 9,+ "name": "Coin3",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -80, "y": 140, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 24, "y": 24 }, "color": { "r": 1, "g": 0.85, "b": 0, "a": 1 }, "texture": "c18959bd-f6be-49d3-945b-3d6ecf8ef14f" } },+ { "type": "Coin", "data": { "baseY": 140, "bobTimer": 0 } }+ ],+ "visible": true+ },+ {+ "id": 10,+ "name": "Coin4",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 220, "y": 220, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 24, "y": 24 }, "color": { "r": 1, "g": 0.85, "b": 0, "a": 1 }, "texture": "c18959bd-f6be-49d3-945b-3d6ecf8ef14f" } },+ { "type": "Coin", "data": { "baseY": 220, "bobTimer": 0 } }+ ],+ "visible": true+ },+ {+ "id": 11,+ "name": "Coin5",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": -200, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 24, "y": 24 }, "color": { "r": 1, "g": 0.85, "b": 0, "a": 1 }, "texture": "c18959bd-f6be-49d3-945b-3d6ecf8ef14f" } },+ { "type": "Coin", "data": { "baseY": -200, "bobTimer": 0 } }+ ],+ "visible": true+ },+ {+ "id": 13,+ "name": "Sky",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": -1 } } },+ { "type": "Sprite", "data": { "size": { "x": 800, "y": 700 }, "texture": "74b832b1-40ae-4095-a620-c027735cb482" } }+ ],+ "visible": true+ },+ {+ "id": 12,+ "name": "ScoreDisplay",+ "parent": null,+ "children": [],+ "components": [+ { "type": "ScoreDisplay", "data": { "score": 0 } }+ ],+ "visible": true+ }+ ]+}diff --git a/examples/platformer/assets/textures/coin.png b/examples/platformer/assets/textures/coin.pngnew file mode 100644index 000000000..9cc6916d8Binary files /dev/null and b/examples/platformer/assets/textures/coin.png differdiff --git a/examples/platformer/assets/textures/coin.png.meta b/examples/platformer/assets/textures/coin.png.metanew file mode 100644index 000000000..b1c5b79c1--- /dev/null+++ b/examples/platformer/assets/textures/coin.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "c18959bd-f6be-49d3-945b-3d6ecf8ef14f",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}\ No newline at end of filediff --git a/examples/platformer/assets/textures/ground.png b/examples/platformer/assets/textures/ground.pngnew file mode 100644index 000000000..a62b67fd5Binary files /dev/null and b/examples/platformer/assets/textures/ground.png differdiff --git a/examples/platformer/assets/textures/ground.png.meta b/examples/platformer/assets/textures/ground.png.metanew file mode 100644index 000000000..ef477a419--- /dev/null+++ b/examples/platformer/assets/textures/ground.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "931ebe66-cded-4b32-8444-0737da446c0d",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}\ No newline at end of filediff --git a/examples/platformer/assets/textures/platform.png b/examples/platformer/assets/textures/platform.pngnew file mode 100644index 000000000..83620ed53Binary files /dev/null and b/examples/platformer/assets/textures/platform.png differdiff --git a/examples/platformer/assets/textures/platform.png.meta b/examples/platformer/assets/textures/platform.png.metanew file mode 100644index 000000000..57e82d172--- /dev/null+++ b/examples/platformer/assets/textures/platform.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "0258e55e-9aa0-47eb-8092-7386e03f97c7",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}\ No newline at end of filediff --git a/examples/platformer/assets/textures/player.png b/examples/platformer/assets/textures/player.pngnew file mode 100644index 000000000..85bf73b7fBinary files /dev/null and b/examples/platformer/assets/textures/player.png differdiff --git a/examples/platformer/assets/textures/player.png.meta b/examples/platformer/assets/textures/player.png.metanew file mode 100644index 000000000..83cc1a4c7--- /dev/null+++ b/examples/platformer/assets/textures/player.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "2bde6b7d-0dbe-4434-9e30-ed1cd8e3fe82",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}\ No newline at end of filediff --git a/examples/platformer/assets/textures/sky.png b/examples/platformer/assets/textures/sky.pngnew file mode 100644index 000000000..d164855acBinary files /dev/null and b/examples/platformer/assets/textures/sky.png differdiff --git a/examples/platformer/assets/textures/sky.png.meta b/examples/platformer/assets/textures/sky.png.metanew file mode 100644index 000000000..47ff18ddc--- /dev/null+++ b/examples/platformer/assets/textures/sky.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "74b832b1-40ae-4095-a620-c027735cb482",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}\ No newline at end of filediff --git a/examples/platformer/project.esproject b/examples/platformer/project.esprojectnew file mode 100644index 000000000..82470bc32--- /dev/null+++ b/examples/platformer/project.esproject@@ -0,0 +1,10 @@+{+ "name": "Platformer",+ "version": "0.1.0",+ "engine": "0.1.0",+ "defaultScene": "assets/scenes/main.esscene",+ "created": "2026-03-02T00:00:00.000Z",+ "modified": "2026-03-02T00:00:00.000Z",+ "spineVersion": "none",+ "designResolution": { "width": 800, "height": 600 }+}diff --git a/examples/platformer/src/components.ts b/examples/platformer/src/components.tsnew file mode 100644index 000000000..3e5eb43d7--- /dev/null+++ b/examples/platformer/src/components.ts@@ -0,0 +1,22 @@+import { defineComponent } from 'esengine';++export const Player = defineComponent('Player', {+ speed: 300,+ jumpForce: 600,+ velocityY: 0,+ isGrounded: false,+});++export const Coin = defineComponent('Coin', {+ baseY: 0,+ bobTimer: 0,+});++export const ScoreDisplay = defineComponent('ScoreDisplay', {+ score: 0,+});++export const Platform = defineComponent('Platform', {+ width: 0,+ height: 0,+});diff --git a/examples/platformer/src/main.ts b/examples/platformer/src/main.tsnew file mode 100644index 000000000..ee183861b--- /dev/null+++ b/examples/platformer/src/main.ts@@ -0,0 +1,8 @@+import { addSystemToSchedule, Schedule } from 'esengine';++import './components';+import { playerSystem } from './systems/player';+import { coinSystem } from './systems/coin';++addSystemToSchedule(Schedule.Update, playerSystem);+addSystemToSchedule(Schedule.Update, coinSystem);diff --git a/examples/platformer/src/systems/coin.ts b/examples/platformer/src/systems/coin.tsnew file mode 100644index 000000000..5eb5bff1b--- /dev/null+++ b/examples/platformer/src/systems/coin.ts@@ -0,0 +1,48 @@+import {+ defineSystem, Query, Mut, Res, Time, Transform, Commands,+} from 'esengine';+import { Coin, Player, ScoreDisplay } from '../components';++const COLLECT_DISTANCE = 30;+const BOB_SPEED = 3;+const BOB_AMOUNT = 6;++export const coinSystem = defineSystem(+ [+ Query([Mut(Transform), Mut(Coin)]),+ Query([Transform, Player]),+ Query([Mut(ScoreDisplay)]),+ Res(Time),+ Commands(),+ ],+ (coins, players, scores, time, cmds) => {+ let playerX = 0;+ let playerY = 0;+ let hasPlayer = false;++ for (const [_entity, t, _p] of players) {+ playerX = t.position.x;+ playerY = t.position.y;+ hasPlayer = true;+ }++ for (const [entity, transform, coin] of coins) {+ coin.bobTimer += time.delta * BOB_SPEED;+ transform.position.y = coin.baseY + Math.sin(coin.bobTimer) * BOB_AMOUNT;++ if (hasPlayer) {+ const dx = transform.position.x - playerX;+ const dy = transform.position.y - playerY;+ const dist = Math.sqrt(dx * dx + dy * dy);++ if (dist < COLLECT_DISTANCE) {+ cmds.despawn(entity);+ for (const [_e, score] of scores) {+ score.score += 1;+ }+ }+ }+ }+ },+ { name: 'CoinSystem' }+);diff --git a/examples/platformer/src/systems/player.ts b/examples/platformer/src/systems/player.tsnew file mode 100644index 000000000..2a5e13302--- /dev/null+++ b/examples/platformer/src/systems/player.ts@@ -0,0 +1,61 @@+import {+ defineSystem, Query, Mut, Res, Time, Transform, Input,+} from 'esengine';+import { Player, Platform } from '../components';++const GRAVITY = -1200;+const PLAYER_HALF_W = 16;+const PLAYER_HALF_H = 24;++export const playerSystem = defineSystem(+ [Query([Mut(Transform), Mut(Player)]), Query([Transform, Platform]), Res(Time), Res(Input)],+ (players, platforms, time, input) => {+ for (const [_entity, transform, player] of players) {+ let moveX = 0;+ if (input.isKeyDown('ArrowLeft') || input.isKeyDown('KeyA')) {+ moveX = -1;+ }+ if (input.isKeyDown('ArrowRight') || input.isKeyDown('KeyD')) {+ moveX = 1;+ }++ transform.position.x += moveX * player.speed * time.delta;++ player.velocityY += GRAVITY * time.delta;+ transform.position.y += player.velocityY * time.delta;++ player.isGrounded = false;++ for (const [_e, platTransform, plat] of platforms) {+ const px = platTransform.position.x;+ const py = platTransform.position.y;+ const platHalfW = plat.width / 2;+ const platHalfH = plat.height / 2;++ const overlapX = Math.abs(transform.position.x - px) < platHalfW + PLAYER_HALF_W;+ const playerBottom = transform.position.y - PLAYER_HALF_H;+ const platTop = py + platHalfH;++ if (overlapX && playerBottom < platTop && playerBottom > py - platHalfH && player.velocityY <= 0) {+ transform.position.y = platTop + PLAYER_HALF_H;+ player.velocityY = 0;+ player.isGrounded = true;+ }+ }++ if (player.isGrounded && (input.isKeyPressed('Space') || input.isKeyPressed('ArrowUp') || input.isKeyPressed('KeyW'))) {+ player.velocityY = player.jumpForce;+ }++ const BOUNDARY = 400;+ if (transform.position.x < -BOUNDARY) transform.position.x = -BOUNDARY;+ if (transform.position.x > BOUNDARY) transform.position.x = BOUNDARY;+ if (transform.position.y < -300) {+ transform.position.y = -200;+ transform.position.x = -200;+ player.velocityY = 0;+ }+ }+ },+ { name: 'PlayerSystem' }+);diff --git a/examples/platformer/thumbnail.png b/examples/platformer/thumbnail.pngnew file mode 100644index 000000000..29db70697Binary files /dev/null and b/examples/platformer/thumbnail.png differdiff --git a/examples/platformer/tsconfig.json b/examples/platformer/tsconfig.jsonnew file mode 100644index 000000000..0a8528b29--- /dev/null+++ b/examples/platformer/tsconfig.json@@ -0,0 +1,22 @@+{+ "compilerOptions": {+ "target": "ES2020",+ "module": "ESNext",+ "moduleResolution": "bundler",+ "strict": true,+ "esModuleInterop": true,+ "skipLibCheck": true,+ "forceConsistentCasingInFileNames": true,+ "declaration": false,+ "outDir": "./dist",+ "rootDir": ".",+ "baseUrl": ".",+ "paths": {+ "esengine": ["./.esengine/sdk/index.d.ts"],+ "esengine/wasm": ["./.esengine/sdk/wasm.d.ts"],+ "@esengine/editor": ["./.esengine/editor/index.d.ts"]+ }+ },+ "include": ["src/**/*"],+ "exclude": ["node_modules"]+}diff --git a/examples/postprocess-effects/.esengine/settings.json b/examples/postprocess-effects/.esengine/settings.jsonnew file mode 100644index 000000000..4ae0a6dc7--- /dev/null+++ b/examples/postprocess-effects/.esengine/settings.json@@ -0,0 +1 @@+{ "lastOpenedScene": "assets/scenes/main.esscene" }diff --git a/examples/postprocess-effects/.gitignore b/examples/postprocess-effects/.gitignorenew file mode 100644index 000000000..359472ac2--- /dev/null+++ b/examples/postprocess-effects/.gitignore@@ -0,0 +1,7 @@+node_modules/+dist/+.vscode/+.idea/+.DS_Store+Thumbs.db+.esengine/cache/diff --git a/examples/postprocess-effects/assets/scenes/main.esscene b/examples/postprocess-effects/assets/scenes/main.esscenenew file mode 100644index 000000000..cacce4528--- /dev/null+++ b/examples/postprocess-effects/assets/scenes/main.esscene@@ -0,0 +1,158 @@+{+ "version": "1.0",+ "name": "Main",+ "entities": [+ {+ "id": 0,+ "name": "Camera",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 10 } } },+ { "type": "Camera", "data": { "projectionType": 1, "orthoSize": 300, "isActive": true, "priority": 0 } }+ ],+ "visible": true+ },+ {+ "id": 1,+ "name": "OrbitSprite0",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 100, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 50, "y": 50 }, "color": { "r": 0.96, "g": 0.24, "b": 0.24, "a": 1 } } },+ { "type": "Orbit", "data": { "speed": 0.5, "radius": 80 } }+ ],+ "visible": true+ },+ {+ "id": 2,+ "name": "OrbitSprite1",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 70.71, "y": 70.71, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 50, "y": 50 }, "color": { "r": 0.96, "g": 0.78, "b": 0.24, "a": 1 } } },+ { "type": "Orbit", "data": { "speed": 0.6, "radius": 110, "angle": 0.79 } }+ ],+ "visible": true+ },+ {+ "id": 3,+ "name": "OrbitSprite2",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": 100, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 50, "y": 50 }, "color": { "r": 0.6, "g": 0.96, "b": 0.24, "a": 1 } } },+ { "type": "Orbit", "data": { "speed": 0.7, "radius": 140, "angle": 1.57 } }+ ],+ "visible": true+ },+ {+ "id": 4,+ "name": "OrbitSprite3",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -70.71, "y": 70.71, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 50, "y": 50 }, "color": { "r": 0.24, "g": 0.96, "b": 0.42, "a": 1 } } },+ { "type": "Orbit", "data": { "speed": 0.8, "radius": 80, "angle": 2.36 } }+ ],+ "visible": true+ },+ {+ "id": 5,+ "name": "OrbitSprite4",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -100, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 50, "y": 50 }, "color": { "r": 0.24, "g": 0.96, "b": 0.96, "a": 1 } } },+ { "type": "Orbit", "data": { "speed": 0.9, "radius": 110, "angle": 3.14 } }+ ],+ "visible": true+ },+ {+ "id": 6,+ "name": "OrbitSprite5",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -70.71, "y": -70.71, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 50, "y": 50 }, "color": { "r": 0.24, "g": 0.42, "b": 0.96, "a": 1 } } },+ { "type": "Orbit", "data": { "speed": 1.0, "radius": 140, "angle": 3.93 } }+ ],+ "visible": true+ },+ {+ "id": 7,+ "name": "OrbitSprite6",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": -100, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 50, "y": 50 }, "color": { "r": 0.6, "g": 0.24, "b": 0.96, "a": 1 } } },+ { "type": "Orbit", "data": { "speed": 1.1, "radius": 80, "angle": 4.71 } }+ ],+ "visible": true+ },+ {+ "id": 8,+ "name": "OrbitSprite7",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 70.71, "y": -70.71, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 50, "y": 50 }, "color": { "r": 0.96, "g": 0.24, "b": 0.78, "a": 1 } } },+ { "type": "Orbit", "data": { "speed": 1.2, "radius": 110, "angle": 5.50 } }+ ],+ "visible": true+ },+ {+ "id": 9,+ "name": "CenterSprite",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ { "type": "Sprite", "data": { "size": { "x": 60, "y": 60 } } }+ ],+ "visible": true+ },+ {+ "id": 10,+ "name": "PostProcess",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ { "type": "PostProcessVolume", "data": {+ "isGlobal": true,+ "priority": 0,+ "weight": 1,+ "effects": [+ {+ "type": "bloom",+ "enabled": true,+ "uniforms": {+ "u_threshold": 0.3,+ "u_intensity": 1.5,+ "u_radius": 6+ }+ },+ {+ "type": "vignette",+ "enabled": true,+ "uniforms": {+ "u_intensity": 0.8,+ "u_softness": 0.5+ }+ }+ ]+ }}+ ],+ "visible": true+ }+ ]+}diff --git a/examples/postprocess-effects/project.esproject b/examples/postprocess-effects/project.esprojectnew file mode 100644index 000000000..894a9aef5--- /dev/null+++ b/examples/postprocess-effects/project.esproject@@ -0,0 +1,10 @@+{+ "name": "Post-Processing",+ "version": "0.1.0",+ "engine": "0.1.0",+ "defaultScene": "assets/scenes/main.esscene",+ "created": "2026-03-02T00:00:00.000Z",+ "modified": "2026-03-02T00:00:00.000Z",+ "spineVersion": "none",+ "designResolution": { "width": 800, "height": 600 }+}diff --git a/examples/postprocess-effects/src/components.ts b/examples/postprocess-effects/src/components.tsnew file mode 100644index 000000000..9d3b7820a--- /dev/null+++ b/examples/postprocess-effects/src/components.ts@@ -0,0 +1,7 @@+import { defineComponent } from 'esengine';++export const Orbit = defineComponent('Orbit', {+ speed: 1,+ radius: 100,+ angle: 0,+});diff --git a/examples/postprocess-effects/src/main.ts b/examples/postprocess-effects/src/main.tsnew file mode 100644index 000000000..c67100fc2--- /dev/null+++ b/examples/postprocess-effects/src/main.ts@@ -0,0 +1,6 @@+import { addSystemToSchedule, Schedule } from 'esengine';++import './components';+import { animateSystem } from './systems/animate';++addSystemToSchedule(Schedule.Update, animateSystem);diff --git a/examples/postprocess-effects/src/systems/animate.ts b/examples/postprocess-effects/src/systems/animate.tsnew file mode 100644index 000000000..390b8c607--- /dev/null+++ b/examples/postprocess-effects/src/systems/animate.ts@@ -0,0 +1,16 @@+import {+ defineSystem, Query, Mut, Res, Time, Transform,+} from 'esengine';+import { Orbit } from '../components';++export const animateSystem = defineSystem(+ [Query([Mut(Transform), Mut(Orbit)]), Res(Time)],+ (query, time) => {+ for (const [_entity, transform, orbit] of query) {+ orbit.angle += orbit.speed * time.delta;+ transform.position.x = Math.cos(orbit.angle) * orbit.radius;+ transform.position.y = Math.sin(orbit.angle) * orbit.radius;+ }+ },+ { name: 'AnimateSystem' }+);diff --git a/examples/postprocess-effects/thumbnail.png b/examples/postprocess-effects/thumbnail.pngnew file mode 100644index 000000000..5ffbc5236Binary files /dev/null and b/examples/postprocess-effects/thumbnail.png differdiff --git a/examples/postprocess-effects/tsconfig.json b/examples/postprocess-effects/tsconfig.jsonnew file mode 100644index 000000000..0a8528b29--- /dev/null+++ b/examples/postprocess-effects/tsconfig.json@@ -0,0 +1,22 @@+{+ "compilerOptions": {+ "target": "ES2020",+ "module": "ESNext",+ "moduleResolution": "bundler",+ "strict": true,+ "esModuleInterop": true,+ "skipLibCheck": true,+ "forceConsistentCasingInFileNames": true,+ "declaration": false,+ "outDir": "./dist",+ "rootDir": ".",+ "baseUrl": ".",+ "paths": {+ "esengine": ["./.esengine/sdk/index.d.ts"],+ "esengine/wasm": ["./.esengine/sdk/wasm.d.ts"],+ "@esengine/editor": ["./.esengine/editor/index.d.ts"]+ }+ },+ "include": ["src/**/*"],+ "exclude": ["node_modules"]+}diff --git a/examples/sprite-animation/.esengine/settings.json b/examples/sprite-animation/.esengine/settings.jsonnew file mode 100644index 000000000..4ae0a6dc7--- /dev/null+++ b/examples/sprite-animation/.esengine/settings.json@@ -0,0 +1 @@+{ "lastOpenedScene": "assets/scenes/main.esscene" }diff --git a/examples/sprite-animation/.gitignore b/examples/sprite-animation/.gitignorenew file mode 100644index 000000000..359472ac2--- /dev/null+++ b/examples/sprite-animation/.gitignore@@ -0,0 +1,7 @@+node_modules/+dist/+.vscode/+.idea/+.DS_Store+Thumbs.db+.esengine/cache/diff --git a/examples/sprite-animation/assets/animations/idle.esanim b/examples/sprite-animation/assets/animations/idle.esanimnew file mode 100644index 000000000..1e5f41f16--- /dev/null+++ b/examples/sprite-animation/assets/animations/idle.esanim@@ -0,0 +1,18 @@+{+ "fps": 4,+ "loop": true,+ "frames": [+ {+ "texture": "e43a0ed9-50e9-46d8-b1db-da1c549590a8"+ },+ {+ "texture": "e9785b6d-6f6e-4dfb-aeed-66d39e5671e4"+ },+ {+ "texture": "36bf91fa-66a4-449b-8a7c-7bc261a04732"+ },+ {+ "texture": "92b3d54a-dd57-40f8-87b7-43e93d6b6a26"+ }+ ]+}\ No newline at end of filediff --git a/examples/sprite-animation/assets/animations/idle.esanim.meta b/examples/sprite-animation/assets/animations/idle.esanim.metanew file mode 100644index 000000000..7560744a0--- /dev/null+++ b/examples/sprite-animation/assets/animations/idle.esanim.meta@@ -0,0 +1,6 @@+{+ "uuid": "5eb93fe5-d5ae-429d-8385-f6763c755fe8",+ "version": "2.0",+ "type": "animclip",+ "importer": {}+}\ No newline at end of filediff --git a/examples/sprite-animation/assets/animations/walk.esanim b/examples/sprite-animation/assets/animations/walk.esanimnew file mode 100644index 000000000..9ff46f5d9--- /dev/null+++ b/examples/sprite-animation/assets/animations/walk.esanim@@ -0,0 +1,18 @@+{+ "fps": 8,+ "loop": true,+ "frames": [+ {+ "texture": "a354adf4-afc0-49a2-8cad-8c8f40d3d669"+ },+ {+ "texture": "586f71d5-05fd-4abc-b534-d81a042382b4"+ },+ {+ "texture": "ca5ce245-b0d4-46f3-b8f0-055d30f82800"+ },+ {+ "texture": "be2aabee-879f-4a7b-923b-e7f793e4d56f"+ }+ ]+}\ No newline at end of filediff --git a/examples/sprite-animation/assets/animations/walk.esanim.meta b/examples/sprite-animation/assets/animations/walk.esanim.metanew file mode 100644index 000000000..03ae559d6--- /dev/null+++ b/examples/sprite-animation/assets/animations/walk.esanim.meta@@ -0,0 +1,6 @@+{+ "uuid": "240172ce-a2c2-487c-af26-1992df05560f",+ "version": "2.0",+ "type": "animclip",+ "importer": {}+}\ No newline at end of filediff --git a/examples/sprite-animation/assets/scenes/main.esscene b/examples/sprite-animation/assets/scenes/main.esscenenew file mode 100644index 000000000..9faacdbfc--- /dev/null+++ b/examples/sprite-animation/assets/scenes/main.esscene@@ -0,0 +1,96 @@+{+ "version": "1.0",+ "name": "Main",+ "entities": [+ {+ "id": 0,+ "name": "Camera",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 10 } } },+ { "type": "Camera", "data": { "projectionType": 1, "orthoSize": 300, "isActive": true, "priority": 0 } }+ ],+ "visible": true+ },+ {+ "id": 1,+ "name": "Character0",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -240, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 80, "y": 80 } } },+ { "type": "SpriteAnimator", "data": {+ "clip": "assets/animations/walk.esanim",+ "speed": 0.8+ }},+ { "type": "AnimSwitcher", "data": { "switchTimer": 2 } }+ ],+ "visible": true+ },+ {+ "id": 2,+ "name": "Character1",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -120, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 80, "y": 80 } } },+ { "type": "SpriteAnimator", "data": {+ "clip": "assets/animations/idle.esanim"+ }},+ { "type": "AnimSwitcher", "data": { "isWalking": false, "switchTimer": 2.5 } }+ ],+ "visible": true+ },+ {+ "id": 3,+ "name": "Character2",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 80, "y": 80 } } },+ { "type": "SpriteAnimator", "data": {+ "clip": "assets/animations/walk.esanim",+ "speed": 1.2+ }},+ { "type": "AnimSwitcher", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 4,+ "name": "Character3",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 120, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 80, "y": 80 } } },+ { "type": "SpriteAnimator", "data": {+ "clip": "assets/animations/idle.esanim",+ "speed": 1.4+ }},+ { "type": "AnimSwitcher", "data": { "isWalking": false, "switchTimer": 3.5 } }+ ],+ "visible": true+ },+ {+ "id": 5,+ "name": "Character4",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 240, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 80, "y": 80 } } },+ { "type": "SpriteAnimator", "data": {+ "clip": "assets/animations/walk.esanim",+ "speed": 1.6+ }},+ { "type": "AnimSwitcher", "data": { "switchTimer": 4 } }+ ],+ "visible": true+ }+ ]+}diff --git a/examples/sprite-animation/assets/textures/idle_0.png b/examples/sprite-animation/assets/textures/idle_0.pngnew file mode 100644index 000000000..8113fa6cfBinary files /dev/null and b/examples/sprite-animation/assets/textures/idle_0.png differdiff --git a/examples/sprite-animation/assets/textures/idle_0.png.meta b/examples/sprite-animation/assets/textures/idle_0.png.metanew file mode 100644index 000000000..f8045b854--- /dev/null+++ b/examples/sprite-animation/assets/textures/idle_0.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "e43a0ed9-50e9-46d8-b1db-da1c549590a8",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}\ No newline at end of filediff --git a/examples/sprite-animation/assets/textures/idle_1.png b/examples/sprite-animation/assets/textures/idle_1.pngnew file mode 100644index 000000000..1305ad4ebBinary files /dev/null and b/examples/sprite-animation/assets/textures/idle_1.png differdiff --git a/examples/sprite-animation/assets/textures/idle_1.png.meta b/examples/sprite-animation/assets/textures/idle_1.png.metanew file mode 100644index 000000000..50e188e48--- /dev/null+++ b/examples/sprite-animation/assets/textures/idle_1.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "e9785b6d-6f6e-4dfb-aeed-66d39e5671e4",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}\ No newline at end of filediff --git a/examples/sprite-animation/assets/textures/idle_2.png b/examples/sprite-animation/assets/textures/idle_2.pngnew file mode 100644index 000000000..26dba57a2Binary files /dev/null and b/examples/sprite-animation/assets/textures/idle_2.png differdiff --git a/examples/sprite-animation/assets/textures/idle_2.png.meta b/examples/sprite-animation/assets/textures/idle_2.png.metanew file mode 100644index 000000000..402108fe7--- /dev/null+++ b/examples/sprite-animation/assets/textures/idle_2.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "36bf91fa-66a4-449b-8a7c-7bc261a04732",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}\ No newline at end of filediff --git a/examples/sprite-animation/assets/textures/idle_3.png b/examples/sprite-animation/assets/textures/idle_3.pngnew file mode 100644index 000000000..5c0469d74Binary files /dev/null and b/examples/sprite-animation/assets/textures/idle_3.png differdiff --git a/examples/sprite-animation/assets/textures/idle_3.png.meta b/examples/sprite-animation/assets/textures/idle_3.png.metanew file mode 100644index 000000000..2683134f2--- /dev/null+++ b/examples/sprite-animation/assets/textures/idle_3.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "92b3d54a-dd57-40f8-87b7-43e93d6b6a26",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}\ No newline at end of filediff --git a/examples/sprite-animation/assets/textures/walk_0.png b/examples/sprite-animation/assets/textures/walk_0.pngnew file mode 100644index 000000000..6f4b1b23aBinary files /dev/null and b/examples/sprite-animation/assets/textures/walk_0.png differdiff --git a/examples/sprite-animation/assets/textures/walk_0.png.meta b/examples/sprite-animation/assets/textures/walk_0.png.metanew file mode 100644index 000000000..8ca3f0c1c--- /dev/null+++ b/examples/sprite-animation/assets/textures/walk_0.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "a354adf4-afc0-49a2-8cad-8c8f40d3d669",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}\ No newline at end of filediff --git a/examples/sprite-animation/assets/textures/walk_1.png b/examples/sprite-animation/assets/textures/walk_1.pngnew file mode 100644index 000000000..1f327b78fBinary files /dev/null and b/examples/sprite-animation/assets/textures/walk_1.png differdiff --git a/examples/sprite-animation/assets/textures/walk_1.png.meta b/examples/sprite-animation/assets/textures/walk_1.png.metanew file mode 100644index 000000000..0528aa503--- /dev/null+++ b/examples/sprite-animation/assets/textures/walk_1.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "586f71d5-05fd-4abc-b534-d81a042382b4",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}\ No newline at end of filediff --git a/examples/sprite-animation/assets/textures/walk_2.png b/examples/sprite-animation/assets/textures/walk_2.pngnew file mode 100644index 000000000..6f4b1b23aBinary files /dev/null and b/examples/sprite-animation/assets/textures/walk_2.png differdiff --git a/examples/sprite-animation/assets/textures/walk_2.png.meta b/examples/sprite-animation/assets/textures/walk_2.png.metanew file mode 100644index 000000000..df05a036d--- /dev/null+++ b/examples/sprite-animation/assets/textures/walk_2.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "ca5ce245-b0d4-46f3-b8f0-055d30f82800",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}\ No newline at end of filediff --git a/examples/sprite-animation/assets/textures/walk_3.png b/examples/sprite-animation/assets/textures/walk_3.pngnew file mode 100644index 000000000..6e9c80576Binary files /dev/null and b/examples/sprite-animation/assets/textures/walk_3.png differdiff --git a/examples/sprite-animation/assets/textures/walk_3.png.meta b/examples/sprite-animation/assets/textures/walk_3.png.metanew file mode 100644index 000000000..c3a119acc--- /dev/null+++ b/examples/sprite-animation/assets/textures/walk_3.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "be2aabee-879f-4a7b-923b-e7f793e4d56f",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}\ No newline at end of filediff --git a/examples/sprite-animation/project.esproject b/examples/sprite-animation/project.esprojectnew file mode 100644index 000000000..774c6e91c--- /dev/null+++ b/examples/sprite-animation/project.esproject@@ -0,0 +1,10 @@+{+ "name": "Sprite Animation",+ "version": "0.1.0",+ "engine": "0.1.0",+ "defaultScene": "assets/scenes/main.esscene",+ "created": "2026-03-02T00:00:00.000Z",+ "modified": "2026-03-02T00:00:00.000Z",+ "spineVersion": "none",+ "designResolution": { "width": 800, "height": 600 }+}diff --git a/examples/sprite-animation/src/components.ts b/examples/sprite-animation/src/components.tsnew file mode 100644index 000000000..3bc717b26--- /dev/null+++ b/examples/sprite-animation/src/components.ts@@ -0,0 +1,8 @@+import { defineComponent } from 'esengine';++export const AnimSwitcher = defineComponent('AnimSwitcher', {+ walkClip: 'assets/animations/walk.esanim',+ idleClip: 'assets/animations/idle.esanim',+ isWalking: true,+ switchTimer: 3,+});diff --git a/examples/sprite-animation/src/main.ts b/examples/sprite-animation/src/main.tsnew file mode 100644index 000000000..db9b4ed7a--- /dev/null+++ b/examples/sprite-animation/src/main.ts@@ -0,0 +1,6 @@+import { addSystemToSchedule, Schedule } from 'esengine';++import './components';+import { switchSystem } from './systems/switch';++addSystemToSchedule(Schedule.Update, switchSystem);diff --git a/examples/sprite-animation/src/systems/switch.ts b/examples/sprite-animation/src/systems/switch.tsnew file mode 100644index 000000000..708fd2770--- /dev/null+++ b/examples/sprite-animation/src/systems/switch.ts@@ -0,0 +1,23 @@+import {+ defineSystem, Query, Mut, Res, Time, SpriteAnimator,+} from 'esengine';+import { AnimSwitcher } from '../components';++export const switchSystem = defineSystem(+ [Query([Mut(SpriteAnimator), Mut(AnimSwitcher)]), Res(Time)],+ (query, time) => {+ for (const [_entity, animator, switcher] of query) {+ switcher.switchTimer -= time.delta;+ if (switcher.switchTimer <= 0) {+ switcher.isWalking = !switcher.isWalking;+ animator.clip = switcher.isWalking+ ? switcher.walkClip+ : switcher.idleClip;+ animator.currentFrame = 0;+ animator.frameTimer = 0;+ switcher.switchTimer = 2 + Math.random() * 2;+ }+ }+ },+ { name: 'SwitchSystem' }+);diff --git a/examples/sprite-animation/thumbnail.png b/examples/sprite-animation/thumbnail.pngnew file mode 100644index 000000000..ca0e53542Binary files /dev/null and b/examples/sprite-animation/thumbnail.png differdiff --git a/examples/sprite-animation/tsconfig.json b/examples/sprite-animation/tsconfig.jsonnew file mode 100644index 000000000..0a8528b29--- /dev/null+++ b/examples/sprite-animation/tsconfig.json@@ -0,0 +1,22 @@+{+ "compilerOptions": {+ "target": "ES2020",+ "module": "ESNext",+ "moduleResolution": "bundler",+ "strict": true,+ "esModuleInterop": true,+ "skipLibCheck": true,+ "forceConsistentCasingInFileNames": true,+ "declaration": false,+ "outDir": "./dist",+ "rootDir": ".",+ "baseUrl": ".",+ "paths": {+ "esengine": ["./.esengine/sdk/index.d.ts"],+ "esengine/wasm": ["./.esengine/sdk/wasm.d.ts"],+ "@esengine/editor": ["./.esengine/editor/index.d.ts"]+ }+ },+ "include": ["src/**/*"],+ "exclude": ["node_modules"]+}diff --git a/examples/sprite-rendering/.esengine/settings.json b/examples/sprite-rendering/.esengine/settings.jsonnew file mode 100644index 000000000..4ae0a6dc7--- /dev/null+++ b/examples/sprite-rendering/.esengine/settings.json@@ -0,0 +1 @@+{ "lastOpenedScene": "assets/scenes/main.esscene" }diff --git a/examples/sprite-rendering/.gitignore b/examples/sprite-rendering/.gitignorenew file mode 100644index 000000000..359472ac2--- /dev/null+++ b/examples/sprite-rendering/.gitignore@@ -0,0 +1,7 @@+node_modules/+dist/+.vscode/+.idea/+.DS_Store+Thumbs.db+.esengine/cache/diff --git a/examples/sprite-rendering/assets/scenes/main.esscene b/examples/sprite-rendering/assets/scenes/main.esscenenew file mode 100644index 000000000..efc3ff3c4--- /dev/null+++ b/examples/sprite-rendering/assets/scenes/main.esscene@@ -0,0 +1,257 @@+{+ "version": "1.0",+ "name": "Main",+ "entities": [+ {+ "id": 0,+ "name": "Camera",+ "parent": null,+ "children": [],+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": { "x": 0, "y": 0, "z": 10 }+ }+ },+ {+ "type": "Camera",+ "data": {+ "projectionType": 1,+ "orthoSize": 300,+ "isActive": true,+ "priority": 0+ }+ }+ ],+ "visible": true+ },+ {+ "id": 1,+ "name": "Layer0",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -250, "y": 150, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 120, "y": 40 }, "color": { "r": 0.93, "g": 0.17, "b": 0.17, "a": 0.9 } } },+ { "type": "Wave", "data": { "amplitude": 15, "frequency": 1.5 } }+ ],+ "visible": true+ },+ {+ "id": 2,+ "name": "Layer1",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -230, "y": 90, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 120, "y": 40 }, "color": { "r": 0.93, "g": 0.74, "b": 0.17, "a": 0.9 }, "layer": 1 } },+ { "type": "Wave", "data": { "amplitude": 15, "frequency": 1.7, "phase": 0.5 } }+ ],+ "visible": true+ },+ {+ "id": 3,+ "name": "Layer2",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -210, "y": 30, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 120, "y": 40 }, "color": { "r": 0.55, "g": 0.93, "b": 0.17, "a": 0.9 }, "layer": 2 } },+ { "type": "Wave", "data": { "amplitude": 15, "frequency": 1.9, "phase": 1 } }+ ],+ "visible": true+ },+ {+ "id": 4,+ "name": "Layer3",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -190, "y": -30, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 120, "y": 40 }, "color": { "r": 0.17, "g": 0.93, "b": 0.36, "a": 0.9 }, "layer": 3 } },+ { "type": "Wave", "data": { "amplitude": 15, "frequency": 2.1, "phase": 1.5 } }+ ],+ "visible": true+ },+ {+ "id": 5,+ "name": "Layer4",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -170, "y": -90, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 120, "y": 40 }, "color": { "r": 0.17, "g": 0.93, "b": 0.93, "a": 0.9 }, "layer": 4 } },+ { "type": "Wave", "data": { "amplitude": 15, "frequency": 2.3, "phase": 2 } }+ ],+ "visible": true+ },+ {+ "id": 6,+ "name": "Layer5",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -150, "y": -150, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 120, "y": 40 }, "color": { "r": 0.17, "g": 0.36, "b": 0.93, "a": 0.9 }, "layer": 5 } },+ { "type": "Wave", "data": { "amplitude": 15, "frequency": 2.5, "phase": 2.5 } }+ ],+ "visible": true+ },+ {+ "id": 7,+ "name": "Layer6",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -130, "y": -210, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 120, "y": 40 }, "color": { "r": 0.55, "g": 0.17, "b": 0.93, "a": 0.9 }, "layer": 6 } },+ { "type": "Wave", "data": { "amplitude": 15, "frequency": 2.7, "phase": 3 } }+ ],+ "visible": true+ },+ {+ "id": 8,+ "name": "Layer7",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -110, "y": -270, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 120, "y": 40 }, "color": { "r": 0.93, "g": 0.17, "b": 0.74, "a": 0.9 }, "layer": 7 } },+ { "type": "Wave", "data": { "amplitude": 15, "frequency": 2.9, "phase": 3.5 } }+ ],+ "visible": true+ },+ {+ "id": 9,+ "name": "OrbitCenter",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 200, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 40, "y": 40 }, "layer": 10, "texture": "ac9483ea-42c0-4fce-8a31-cf4cdc224330" } }+ ],+ "visible": true+ },+ {+ "id": 10,+ "name": "Orbit0",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 200, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 24, "y": 24 }, "color": { "r": 0.96, "g": 0.24, "b": 0.24, "a": 1 }, "layer": 11, "texture": "ac9483ea-42c0-4fce-8a31-cf4cdc224330" } },+ { "type": "Orbit", "data": { "centerX": 200, "radius": 60 } }+ ],+ "visible": true+ },+ {+ "id": 11,+ "name": "Orbit1",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 200, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 24, "y": 24 }, "color": { "r": 0.96, "g": 0.96, "b": 0.24, "a": 1 }, "layer": 11, "texture": "ac9483ea-42c0-4fce-8a31-cf4cdc224330" } },+ { "type": "Orbit", "data": { "centerX": 200, "radius": 85, "speed": 1.3, "angle": 1.05 } }+ ],+ "visible": true+ },+ {+ "id": 12,+ "name": "Orbit2",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 200, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 24, "y": 24 }, "color": { "r": 0.24, "g": 0.96, "b": 0.24, "a": 1 }, "layer": 11, "texture": "ac9483ea-42c0-4fce-8a31-cf4cdc224330" } },+ { "type": "Orbit", "data": { "centerX": 200, "radius": 110, "speed": 1.6, "angle": 2.09 } }+ ],+ "visible": true+ },+ {+ "id": 13,+ "name": "Orbit3",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 200, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 24, "y": 24 }, "color": { "r": 0.24, "g": 0.96, "b": 0.96, "a": 1 }, "layer": 11, "texture": "ac9483ea-42c0-4fce-8a31-cf4cdc224330" } },+ { "type": "Orbit", "data": { "centerX": 200, "radius": 60, "speed": 1.9, "angle": 3.14 } }+ ],+ "visible": true+ },+ {+ "id": 14,+ "name": "Orbit4",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 200, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 24, "y": 24 }, "color": { "r": 0.24, "g": 0.24, "b": 0.96, "a": 1 }, "layer": 11, "texture": "ac9483ea-42c0-4fce-8a31-cf4cdc224330" } },+ { "type": "Orbit", "data": { "centerX": 200, "radius": 85, "speed": 2.2, "angle": 4.19 } }+ ],+ "visible": true+ },+ {+ "id": 15,+ "name": "Orbit5",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 200, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 24, "y": 24 }, "color": { "r": 0.96, "g": 0.24, "b": 0.96, "a": 1 }, "layer": 11, "texture": "ac9483ea-42c0-4fce-8a31-cf4cdc224330" } },+ { "type": "Orbit", "data": { "centerX": 200, "radius": 110, "speed": 2.5, "angle": 5.24 } }+ ],+ "visible": true+ },+ {+ "id": 16,+ "name": "FlipNormal",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -90, "y": -200, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 50, "y": 30 }, "color": { "r": 0.4, "g": 0.8, "b": 1, "a": 1 }, "layer": 5, "texture": "d7cfc683-b474-4c6a-bedf-c5149593510a" } },+ { "type": "FlipDemo", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 17,+ "name": "FlipX",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -10, "y": -200, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 50, "y": 30 }, "color": { "r": 0.4, "g": 0.8, "b": 1, "a": 1 }, "flipX": true, "layer": 5, "texture": "d7cfc683-b474-4c6a-bedf-c5149593510a" } },+ { "type": "FlipDemo", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 18,+ "name": "FlipY",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 70, "y": -200, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 50, "y": 30 }, "color": { "r": 0.4, "g": 0.8, "b": 1, "a": 1 }, "flipY": true, "layer": 5, "texture": "d7cfc683-b474-4c6a-bedf-c5149593510a" } },+ { "type": "FlipDemo", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 19,+ "name": "FlipXY",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 150, "y": -200, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 50, "y": 30 }, "color": { "r": 0.4, "g": 0.8, "b": 1, "a": 1 }, "flipX": true, "flipY": true, "layer": 5, "texture": "d7cfc683-b474-4c6a-bedf-c5149593510a" } },+ { "type": "FlipDemo", "data": {} }+ ],+ "visible": true+ }+ ]+}diff --git a/examples/sprite-rendering/assets/textures/arrow.png b/examples/sprite-rendering/assets/textures/arrow.pngnew file mode 100644index 000000000..0c6bd28f6Binary files /dev/null and b/examples/sprite-rendering/assets/textures/arrow.png differdiff --git a/examples/sprite-rendering/assets/textures/arrow.png.meta b/examples/sprite-rendering/assets/textures/arrow.png.metanew file mode 100644index 000000000..f3173adbb--- /dev/null+++ b/examples/sprite-rendering/assets/textures/arrow.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "d7cfc683-b474-4c6a-bedf-c5149593510a",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}\ No newline at end of filediff --git a/examples/sprite-rendering/assets/textures/star.png b/examples/sprite-rendering/assets/textures/star.pngnew file mode 100644index 000000000..070cd68d3Binary files /dev/null and b/examples/sprite-rendering/assets/textures/star.png differdiff --git a/examples/sprite-rendering/assets/textures/star.png.meta b/examples/sprite-rendering/assets/textures/star.png.metanew file mode 100644index 000000000..81059f870--- /dev/null+++ b/examples/sprite-rendering/assets/textures/star.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "ac9483ea-42c0-4fce-8a31-cf4cdc224330",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}\ No newline at end of filediff --git a/examples/sprite-rendering/project.esproject b/examples/sprite-rendering/project.esprojectnew file mode 100644index 000000000..97d7a18d9--- /dev/null+++ b/examples/sprite-rendering/project.esproject@@ -0,0 +1,10 @@+{+ "name": "Sprite Rendering",+ "version": "0.1.0",+ "engine": "0.1.0",+ "defaultScene": "assets/scenes/main.esscene",+ "created": "2026-03-02T00:00:00.000Z",+ "modified": "2026-03-02T00:00:00.000Z",+ "spineVersion": "none",+ "designResolution": { "width": 800, "height": 600 }+}diff --git a/examples/sprite-rendering/src/components.ts b/examples/sprite-rendering/src/components.tsnew file mode 100644index 000000000..49725328b--- /dev/null+++ b/examples/sprite-rendering/src/components.ts@@ -0,0 +1,17 @@+import { defineComponent, defineTag } from 'esengine';++export const Wave = defineComponent('Wave', {+ amplitude: 20,+ frequency: 2,+ phase: 0,+});++export const Orbit = defineComponent('Orbit', {+ centerX: 0,+ centerY: 0,+ radius: 80,+ speed: 1,+ angle: 0,+});++export const FlipDemo = defineTag('FlipDemo');diff --git a/examples/sprite-rendering/src/main.ts b/examples/sprite-rendering/src/main.tsnew file mode 100644index 000000000..87b020653--- /dev/null+++ b/examples/sprite-rendering/src/main.ts@@ -0,0 +1,8 @@+import { addSystemToSchedule, Schedule } from 'esengine';++import './components';+import { waveSystem, orbitSystem, flipSystem } from './systems/animate';++addSystemToSchedule(Schedule.Update, waveSystem);+addSystemToSchedule(Schedule.Update, orbitSystem);+addSystemToSchedule(Schedule.Update, flipSystem);diff --git a/examples/sprite-rendering/src/systems/animate.ts b/examples/sprite-rendering/src/systems/animate.tsnew file mode 100644index 000000000..98afc6b36--- /dev/null+++ b/examples/sprite-rendering/src/systems/animate.ts@@ -0,0 +1,38 @@+import {+ defineSystem, Query, Mut, Res, Time,+ Transform, Sprite,+} from 'esengine';+import { Wave, Orbit, FlipDemo } from '../components';++export const waveSystem = defineSystem(+ [Query([Mut(Transform), Wave]), Res(Time)],+ (query, time) => {+ for (const [_entity, transform, wave] of query) {+ transform.position.x += Math.sin(time.elapsed * wave.frequency + wave.phase) * wave.amplitude * time.delta;+ }+ },+ { name: 'WaveSystem' }+);++export const orbitSystem = defineSystem(+ [Query([Mut(Transform), Mut(Orbit)]), Res(Time)],+ (query, time) => {+ for (const [_entity, transform, orbit] of query) {+ orbit.angle += orbit.speed * time.delta;+ transform.position.x = orbit.centerX + Math.cos(orbit.angle) * orbit.radius;+ transform.position.y = orbit.centerY + Math.sin(orbit.angle) * orbit.radius;+ }+ },+ { name: 'OrbitSystem' }+);++export const flipSystem = defineSystem(+ [Query([Mut(Transform), FlipDemo]), Res(Time)],+ (query, time) => {+ for (const [_entity, transform] of query) {+ const bounce = Math.sin(time.elapsed * 2) * 5;+ transform.position.y += bounce * time.delta;+ }+ },+ { name: 'FlipSystem' }+);diff --git a/examples/sprite-rendering/thumbnail.png b/examples/sprite-rendering/thumbnail.pngnew file mode 100644index 000000000..3581d7abcBinary files /dev/null and b/examples/sprite-rendering/thumbnail.png differdiff --git a/examples/sprite-rendering/tsconfig.json b/examples/sprite-rendering/tsconfig.jsonnew file mode 100644index 000000000..0a8528b29--- /dev/null+++ b/examples/sprite-rendering/tsconfig.json@@ -0,0 +1,22 @@+{+ "compilerOptions": {+ "target": "ES2020",+ "module": "ESNext",+ "moduleResolution": "bundler",+ "strict": true,+ "esModuleInterop": true,+ "skipLibCheck": true,+ "forceConsistentCasingInFileNames": true,+ "declaration": false,+ "outDir": "./dist",+ "rootDir": ".",+ "baseUrl": ".",+ "paths": {+ "esengine": ["./.esengine/sdk/index.d.ts"],+ "esengine/wasm": ["./.esengine/sdk/wasm.d.ts"],+ "@esengine/editor": ["./.esengine/editor/index.d.ts"]+ }+ },+ "include": ["src/**/*"],+ "exclude": ["node_modules"]+}diff --git a/examples/tween-animation/.esengine/settings.json b/examples/tween-animation/.esengine/settings.jsonnew file mode 100644index 000000000..4ae0a6dc7--- /dev/null+++ b/examples/tween-animation/.esengine/settings.json@@ -0,0 +1 @@+{ "lastOpenedScene": "assets/scenes/main.esscene" }diff --git a/examples/tween-animation/.gitignore b/examples/tween-animation/.gitignorenew file mode 100644index 000000000..359472ac2--- /dev/null+++ b/examples/tween-animation/.gitignore@@ -0,0 +1,7 @@+node_modules/+dist/+.vscode/+.idea/+.DS_Store+Thumbs.db+.esengine/cache/diff --git a/examples/tween-animation/assets/scenes/main.esscene b/examples/tween-animation/assets/scenes/main.esscenenew file mode 100644index 000000000..c8e1cad65--- /dev/null+++ b/examples/tween-animation/assets/scenes/main.esscene@@ -0,0 +1,138 @@+{+ "version": "1.0",+ "name": "Main",+ "entities": [+ {+ "id": 0,+ "name": "Camera",+ "parent": null,+ "children": [],+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": { "x": 0, "y": 0, "z": 10 }+ }+ },+ {+ "type": "Camera",+ "data": {+ "projectionType": 1,+ "orthoSize": 300,+ "isActive": true,+ "priority": 0+ }+ }+ ],+ "visible": true+ },+ {+ "id": 1,+ "name": "EasingLinear",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -250, "y": 175, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 30, "y": 30 }, "color": { "r": 0.93, "g": 0.17, "b": 0.17, "a": 1 } } },+ { "type": "EasingDemo", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 2,+ "name": "EasingInQuad",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -250, "y": 105, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 30, "y": 30 }, "color": { "r": 0.93, "g": 0.93, "b": 0.17, "a": 1 } } },+ { "type": "EasingDemo", "data": { "easingIndex": 1 } }+ ],+ "visible": true+ },+ {+ "id": 3,+ "name": "EasingOutQuad",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -250, "y": 35, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 30, "y": 30 }, "color": { "r": 0.17, "g": 0.93, "b": 0.17, "a": 1 } } },+ { "type": "EasingDemo", "data": { "easingIndex": 2 } }+ ],+ "visible": true+ },+ {+ "id": 4,+ "name": "EasingInOutQuad",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -250, "y": -35, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 30, "y": 30 }, "color": { "r": 0.17, "g": 0.93, "b": 0.93, "a": 1 } } },+ { "type": "EasingDemo", "data": { "easingIndex": 3 } }+ ],+ "visible": true+ },+ {+ "id": 5,+ "name": "EasingInCubic",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -250, "y": -105, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 30, "y": 30 }, "color": { "r": 0.17, "g": 0.17, "b": 0.93, "a": 1 } } },+ { "type": "EasingDemo", "data": { "easingIndex": 4 } }+ ],+ "visible": true+ },+ {+ "id": 6,+ "name": "EasingOutBounce",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -250, "y": -175, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 30, "y": 30 }, "color": { "r": 0.93, "g": 0.17, "b": 0.93, "a": 1 } } },+ { "type": "EasingDemo", "data": { "easingIndex": 5 } }+ ],+ "visible": true+ },+ {+ "id": 7,+ "name": "ScaleDemo",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": -200, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 50, "y": 50 } } },+ { "type": "ScaleDemo", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 8,+ "name": "RotationDemo",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 250, "y": -200, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 40, "y": 40 }, "color": { "r": 0.5, "g": 1, "b": 0.8, "a": 1 } } },+ { "type": "RotationDemo", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 9,+ "name": "ColorDemo",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": -250, "y": -200, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 40, "y": 40 }, "color": { "r": 1, "g": 0, "b": 0, "a": 1 } } },+ { "type": "ColorDemo", "data": {} }+ ],+ "visible": true+ }+ ]+}diff --git a/examples/tween-animation/project.esproject b/examples/tween-animation/project.esprojectnew file mode 100644index 000000000..12b24912d--- /dev/null+++ b/examples/tween-animation/project.esproject@@ -0,0 +1,10 @@+{+ "name": "Tween Animation",+ "version": "0.1.0",+ "engine": "0.1.0",+ "defaultScene": "assets/scenes/main.esscene",+ "created": "2026-03-02T00:00:00.000Z",+ "modified": "2026-03-02T00:00:00.000Z",+ "spineVersion": "none",+ "designResolution": { "width": 800, "height": 600 }+}diff --git a/examples/tween-animation/src/components.ts b/examples/tween-animation/src/components.tsnew file mode 100644index 000000000..3acd13721--- /dev/null+++ b/examples/tween-animation/src/components.ts@@ -0,0 +1,17 @@+import { defineComponent } from 'esengine';++export const EasingDemo = defineComponent('EasingDemo', {+ easingIndex: 0,+});++export const ScaleDemo = defineComponent('ScaleDemo', {+ dummy: 0,+});++export const RotationDemo = defineComponent('RotationDemo', {+ dummy: 0,+});++export const ColorDemo = defineComponent('ColorDemo', {+ dummy: 0,+});diff --git a/examples/tween-animation/src/main.ts b/examples/tween-animation/src/main.tsnew file mode 100644index 000000000..c3ba336ef--- /dev/null+++ b/examples/tween-animation/src/main.ts@@ -0,0 +1,6 @@+import { addStartupSystem } from 'esengine';++import './components';+import { setupSystem } from './systems/setup';++addStartupSystem(setupSystem);diff --git a/examples/tween-animation/src/systems/setup.ts b/examples/tween-animation/src/systems/setup.tsnew file mode 100644index 000000000..67dff16f8--- /dev/null+++ b/examples/tween-animation/src/systems/setup.ts@@ -0,0 +1,60 @@+import {+ defineSystem, Query,+ Transform, Sprite, Tween, TweenTarget, EasingType, LoopMode,+} from 'esengine';+import { EasingDemo, ScaleDemo, RotationDemo, ColorDemo } from '../components';++const EASING_TYPES = [+ EasingType.Linear,+ EasingType.EaseInQuad,+ EasingType.EaseOutQuad,+ EasingType.EaseInOutQuad,+ EasingType.EaseInCubic,+ EasingType.EaseOutBounce,+];++const X_FROM = -250;+const X_TO = 250;+const DURATION = 2;++export const setupSystem = defineSystem(+ [Query([Transform, EasingDemo]), Query([Transform, ScaleDemo]), Query([Transform, RotationDemo]), Query([Transform, ColorDemo])],+ (easings, scales, rotations, colors) => {+ for (const [entity, _t, demo] of easings) {+ Tween.to(entity, TweenTarget.PositionX, X_FROM, X_TO, DURATION, {+ easing: EASING_TYPES[demo.easingIndex] ?? EasingType.Linear,+ loop: LoopMode.PingPong,+ });+ }++ for (const [entity] of scales) {+ Tween.to(entity, TweenTarget.ScaleX, 0.5, 2.0, 1.0, {+ easing: EasingType.EaseInOutQuad,+ loop: LoopMode.PingPong,+ });+ Tween.to(entity, TweenTarget.ScaleY, 0.5, 2.0, 1.0, {+ easing: EasingType.EaseInOutQuad,+ loop: LoopMode.PingPong,+ });+ }++ for (const [entity] of rotations) {+ Tween.to(entity, TweenTarget.RotationZ, 0, 360, 3.0, {+ easing: EasingType.Linear,+ loop: LoopMode.Restart,+ });+ }++ for (const [entity] of colors) {+ Tween.to(entity, TweenTarget.ColorR, 1, 0, 2, {+ loop: LoopMode.PingPong,+ easing: EasingType.EaseInOutQuad,+ });+ Tween.to(entity, TweenTarget.ColorG, 0, 1, 2, {+ loop: LoopMode.PingPong,+ easing: EasingType.EaseInOutQuad,+ });+ }+ },+ { name: 'SetupSystem' }+);diff --git a/examples/tween-animation/thumbnail.png b/examples/tween-animation/thumbnail.pngnew file mode 100644index 000000000..e31c950dcBinary files /dev/null and b/examples/tween-animation/thumbnail.png differdiff --git a/examples/tween-animation/tsconfig.json b/examples/tween-animation/tsconfig.jsonnew file mode 100644index 000000000..0a8528b29--- /dev/null+++ b/examples/tween-animation/tsconfig.json@@ -0,0 +1,22 @@+{+ "compilerOptions": {+ "target": "ES2020",+ "module": "ESNext",+ "moduleResolution": "bundler",+ "strict": true,+ "esModuleInterop": true,+ "skipLibCheck": true,+ "forceConsistentCasingInFileNames": true,+ "declaration": false,+ "outDir": "./dist",+ "rootDir": ".",+ "baseUrl": ".",+ "paths": {+ "esengine": ["./.esengine/sdk/index.d.ts"],+ "esengine/wasm": ["./.esengine/sdk/wasm.d.ts"],+ "@esengine/editor": ["./.esengine/editor/index.d.ts"]+ }+ },+ "include": ["src/**/*"],+ "exclude": ["node_modules"]+}diff --git a/examples/ui-controls/.esengine/settings.json b/examples/ui-controls/.esengine/settings.jsonnew file mode 100644index 000000000..4ae0a6dc7--- /dev/null+++ b/examples/ui-controls/.esengine/settings.json@@ -0,0 +1 @@+{ "lastOpenedScene": "assets/scenes/main.esscene" }diff --git a/examples/ui-controls/.gitignore b/examples/ui-controls/.gitignorenew file mode 100644index 000000000..359472ac2--- /dev/null+++ b/examples/ui-controls/.gitignore@@ -0,0 +1,7 @@+node_modules/+dist/+.vscode/+.idea/+.DS_Store+Thumbs.db+.esengine/cache/diff --git a/examples/ui-controls/assets/scenes/main.esscene b/examples/ui-controls/assets/scenes/main.esscenenew file mode 100644index 000000000..a90eaa9ee--- /dev/null+++ b/examples/ui-controls/assets/scenes/main.esscene@@ -0,0 +1,833 @@+{+ "version": "1.0",+ "name": "Main",+ "entities": [+ {+ "id": 0,+ "name": "Camera",+ "parent": null,+ "children": [],+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": { "x": 0, "y": 0, "z": 10 }+ }+ },+ {+ "type": "Camera",+ "data": {+ "projectionType": 1,+ "orthoSize": 300,+ "isActive": true,+ "priority": 0+ }+ }+ ],+ "visible": true+ },+ {+ "id": 1,+ "name": "Canvas",+ "parent": null,+ "children": [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "Canvas",+ "data": {+ "designResolution": { "x": 800, "y": 600 },+ "scaleMode": 2+ }+ },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "size": { "x": 800, "y": 600 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 2,+ "name": "Title",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 1 },+ "anchorMax": { "x": 0.5, "y": 1 },+ "offsetMin": { "x": 0, "y": -50 },+ "size": { "x": 400, "y": 50 },+ "pivot": { "x": 0.5, "y": 1 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "UI Controls Gallery",+ "fontSize": 32,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 3,+ "name": "PrimaryBtn",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -270, "y": 100 },+ "size": { "x": 140, "y": 45 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.2, "g": 0.6, "b": 1, "a": 1 }+ }+ },+ {+ "type": "Button",+ "data": {+ "state": 0,+ "transition": {+ "normalColor": { "r": 0.2, "g": 0.6, "b": 1, "a": 1 },+ "hoveredColor": { "r": 0.2, "g": 0.6, "b": 1, "a": 0.8 },+ "pressedColor": { "r": 0.2, "g": 0.6, "b": 1, "a": 0.6 },+ "disabledColor": { "r": 0.3, "g": 0.3, "b": 0.3, "a": 1 }+ }+ }+ },+ { "type": "Interactable", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 4,+ "name": "PrimaryLabel",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -270, "y": 100 },+ "size": { "x": 140, "y": 45 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Primary",+ "fontSize": 20,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 5,+ "name": "SuccessBtn",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -70, "y": 100 },+ "size": { "x": 140, "y": 45 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.2, "g": 0.8, "b": 0.4, "a": 1 }+ }+ },+ {+ "type": "Button",+ "data": {+ "state": 0,+ "transition": {+ "normalColor": { "r": 0.2, "g": 0.8, "b": 0.4, "a": 1 },+ "hoveredColor": { "r": 0.2, "g": 0.8, "b": 0.4, "a": 0.8 },+ "pressedColor": { "r": 0.2, "g": 0.8, "b": 0.4, "a": 0.6 },+ "disabledColor": { "r": 0.3, "g": 0.3, "b": 0.3, "a": 1 }+ }+ }+ },+ { "type": "Interactable", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 6,+ "name": "SuccessLabel",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -70, "y": 100 },+ "size": { "x": 140, "y": 45 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Success",+ "fontSize": 20,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 7,+ "name": "DangerBtn",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 130, "y": 100 },+ "size": { "x": 140, "y": 45 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.9, "g": 0.3, "b": 0.3, "a": 1 }+ }+ },+ {+ "type": "Button",+ "data": {+ "state": 0,+ "transition": {+ "normalColor": { "r": 0.9, "g": 0.3, "b": 0.3, "a": 1 },+ "hoveredColor": { "r": 0.9, "g": 0.3, "b": 0.3, "a": 0.8 },+ "pressedColor": { "r": 0.9, "g": 0.3, "b": 0.3, "a": 0.6 },+ "disabledColor": { "r": 0.3, "g": 0.3, "b": 0.3, "a": 1 }+ }+ }+ },+ { "type": "Interactable", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 8,+ "name": "DangerLabel",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 130, "y": 100 },+ "size": { "x": 140, "y": 45 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Danger",+ "fontSize": 20,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 9,+ "name": "Toggle1",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -215, "y": 20 },+ "size": { "x": 30, "y": 30 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.2, "g": 0.6, "b": 1, "a": 1 }+ }+ },+ {+ "type": "Toggle",+ "data": {+ "isOn": true+ }+ },+ { "type": "Interactable", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 10,+ "name": "Toggle1Label",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -175, "y": 20 },+ "size": { "x": 100, "y": 30 },+ "pivot": { "x": 0, "y": 0.5 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Option 1",+ "fontSize": 18,+ "color": { "r": 0.8, "g": 0.8, "b": 0.8, "a": 1 },+ "align": 0,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 11,+ "name": "Toggle2",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -15, "y": 20 },+ "size": { "x": 30, "y": 30 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.4, "g": 0.4, "b": 0.4, "a": 1 }+ }+ },+ {+ "type": "Toggle",+ "data": {+ "isOn": false+ }+ },+ { "type": "Interactable", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 12,+ "name": "Toggle2Label",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 25, "y": 20 },+ "size": { "x": 100, "y": 30 },+ "pivot": { "x": 0, "y": 0.5 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Option 2",+ "fontSize": 18,+ "color": { "r": 0.8, "g": 0.8, "b": 0.8, "a": 1 },+ "align": 0,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 13,+ "name": "Toggle3",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 185, "y": 20 },+ "size": { "x": 30, "y": 30 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.4, "g": 0.4, "b": 0.4, "a": 1 }+ }+ },+ {+ "type": "Toggle",+ "data": {+ "isOn": false+ }+ },+ { "type": "Interactable", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 14,+ "name": "Toggle3Label",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 225, "y": 20 },+ "size": { "x": 100, "y": 30 },+ "pivot": { "x": 0, "y": 0.5 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Option 3",+ "fontSize": 18,+ "color": { "r": 0.8, "g": 0.8, "b": 0.8, "a": 1 },+ "align": 0,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 15,+ "name": "SliderBg",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -200, "y": -60 },+ "size": { "x": 400, "y": 8 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.3, "g": 0.3, "b": 0.3, "a": 1 }+ }+ },+ {+ "type": "Slider",+ "data": {+ "value": 0.5,+ "minValue": 0,+ "maxValue": 1,+ "direction": 0,+ "fillEntity": 16,+ "handleEntity": 17+ }+ },+ { "type": "Interactable", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 16,+ "name": "SliderFill",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -200, "y": -60 },+ "size": { "x": 200, "y": 8 },+ "pivot": { "x": 0, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.2, "g": 0.6, "b": 1, "a": 1 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 17,+ "name": "SliderHandle",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 0, "y": -60 },+ "size": { "x": 20, "y": 20 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 18,+ "name": "ProgressBg1",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -200, "y": -120 },+ "size": { "x": 400, "y": 20 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.2, "g": 0.2, "b": 0.2, "a": 1 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 19,+ "name": "ProgressFill1",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -200, "y": -120 },+ "size": { "x": 400, "y": 20 },+ "pivot": { "x": 0, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.2, "g": 0.8, "b": 0.4, "a": 1 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 20,+ "name": "ProgressBar1",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -200, "y": -120 },+ "size": { "x": 400, "y": 20 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "ProgressBar",+ "data": {+ "value": 0.3,+ "fillEntity": 19,+ "direction": 0+ }+ },+ {+ "type": "ProgressAnimator",+ "data": {+ "speed": 0.2,+ "direction": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 21,+ "name": "ProgressBg2",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -200, "y": -160 },+ "size": { "x": 400, "y": 20 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.2, "g": 0.2, "b": 0.2, "a": 1 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 22,+ "name": "ProgressFill2",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -200, "y": -160 },+ "size": { "x": 400, "y": 20 },+ "pivot": { "x": 0, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 1, "g": 0.7, "b": 0.1, "a": 1 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 23,+ "name": "ProgressBar2",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -200, "y": -160 },+ "size": { "x": 400, "y": 20 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "ProgressBar",+ "data": {+ "value": 0.55,+ "fillEntity": 22,+ "direction": 0+ }+ },+ {+ "type": "ProgressAnimator",+ "data": {+ "speed": 0.3,+ "direction": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 24,+ "name": "ProgressBg3",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -200, "y": -200 },+ "size": { "x": 400, "y": 20 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.2, "g": 0.2, "b": 0.2, "a": 1 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 25,+ "name": "ProgressFill3",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -200, "y": -200 },+ "size": { "x": 400, "y": 20 },+ "pivot": { "x": 0, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.9, "g": 0.3, "b": 0.3, "a": 1 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 26,+ "name": "ProgressBar3",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -200, "y": -200 },+ "size": { "x": 400, "y": 20 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "ProgressBar",+ "data": {+ "value": 0.8,+ "fillEntity": 25,+ "direction": 0+ }+ },+ {+ "type": "ProgressAnimator",+ "data": {+ "speed": 0.4,+ "direction": 1+ }+ }+ ],+ "visible": true+ }+ ]+}diff --git a/examples/ui-controls/project.esproject b/examples/ui-controls/project.esprojectnew file mode 100644index 000000000..838db3947--- /dev/null+++ b/examples/ui-controls/project.esproject@@ -0,0 +1,10 @@+{+ "name": "UI Controls",+ "version": "0.1.0",+ "engine": "0.1.0",+ "defaultScene": "assets/scenes/main.esscene",+ "created": "2026-03-02T00:00:00.000Z",+ "modified": "2026-03-02T00:00:00.000Z",+ "spineVersion": "none",+ "designResolution": { "width": 800, "height": 600 }+}diff --git a/examples/ui-controls/src/components.ts b/examples/ui-controls/src/components.tsnew file mode 100644index 000000000..307361055--- /dev/null+++ b/examples/ui-controls/src/components.ts@@ -0,0 +1,9 @@+import { defineComponent, defineTag } from 'esengine';++export const ProgressAnimator = defineComponent('ProgressAnimator', {+ speed: 0.3,+ direction: 1,+});++export const SliderLabel = defineTag('SliderLabel');+export const ToggleLabel = defineTag('ToggleLabel');diff --git a/examples/ui-controls/src/main.ts b/examples/ui-controls/src/main.tsnew file mode 100644index 000000000..b0188bbd8--- /dev/null+++ b/examples/ui-controls/src/main.ts@@ -0,0 +1,6 @@+import { addSystemToSchedule, Schedule } from 'esengine';++import './components';+import { progressAnimateSystem } from './systems/animate';++addSystemToSchedule(Schedule.Update, progressAnimateSystem);diff --git a/examples/ui-controls/src/systems/animate.ts b/examples/ui-controls/src/systems/animate.tsnew file mode 100644index 000000000..d0c1a150c--- /dev/null+++ b/examples/ui-controls/src/systems/animate.ts@@ -0,0 +1,21 @@+import {+ defineSystem, Query, Mut, Res, Time, ProgressBar,+} from 'esengine';+import { ProgressAnimator } from '../components';++export const progressAnimateSystem = defineSystem(+ [Query([Mut(ProgressBar), Mut(ProgressAnimator)]), Res(Time)],+ (query, time) => {+ for (const [_entity, bar, animator] of query) {+ bar.value += animator.speed * animator.direction * time.delta;+ if (bar.value >= 1) {+ bar.value = 1;+ animator.direction = -1;+ } else if (bar.value <= 0) {+ bar.value = 0;+ animator.direction = 1;+ }+ }+ },+ { name: 'ProgressAnimateSystem' }+);diff --git a/examples/ui-controls/thumbnail.png b/examples/ui-controls/thumbnail.pngnew file mode 100644index 000000000..3b3b9f351Binary files /dev/null and b/examples/ui-controls/thumbnail.png differdiff --git a/examples/ui-controls/tsconfig.json b/examples/ui-controls/tsconfig.jsonnew file mode 100644index 000000000..0a8528b29--- /dev/null+++ b/examples/ui-controls/tsconfig.json@@ -0,0 +1,22 @@+{+ "compilerOptions": {+ "target": "ES2020",+ "module": "ESNext",+ "moduleResolution": "bundler",+ "strict": true,+ "esModuleInterop": true,+ "skipLibCheck": true,+ "forceConsistentCasingInFileNames": true,+ "declaration": false,+ "outDir": "./dist",+ "rootDir": ".",+ "baseUrl": ".",+ "paths": {+ "esengine": ["./.esengine/sdk/index.d.ts"],+ "esengine/wasm": ["./.esengine/sdk/wasm.d.ts"],+ "@esengine/editor": ["./.esengine/editor/index.d.ts"]+ }+ },+ "include": ["src/**/*"],+ "exclude": ["node_modules"]+}diff --git a/examples/ui-interaction/.esengine/settings.json b/examples/ui-interaction/.esengine/settings.jsonnew file mode 100644index 000000000..4ae0a6dc7--- /dev/null+++ b/examples/ui-interaction/.esengine/settings.json@@ -0,0 +1 @@+{ "lastOpenedScene": "assets/scenes/main.esscene" }diff --git a/examples/ui-interaction/.gitignore b/examples/ui-interaction/.gitignorenew file mode 100644index 000000000..359472ac2--- /dev/null+++ b/examples/ui-interaction/.gitignore@@ -0,0 +1,7 @@+node_modules/+dist/+.vscode/+.idea/+.DS_Store+Thumbs.db+.esengine/cache/diff --git a/examples/ui-interaction/assets/scenes/main.esscene b/examples/ui-interaction/assets/scenes/main.esscenenew file mode 100644index 000000000..e75688e8c--- /dev/null+++ b/examples/ui-interaction/assets/scenes/main.esscene@@ -0,0 +1,526 @@+{+ "version": "1.0",+ "name": "Main",+ "entities": [+ {+ "id": 0,+ "name": "Camera",+ "parent": null,+ "children": [],+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": { "x": 0, "y": 0, "z": 10 }+ }+ },+ {+ "type": "Camera",+ "data": {+ "projectionType": 1,+ "orthoSize": 300,+ "isActive": true,+ "priority": 0+ }+ }+ ],+ "visible": true+ },+ {+ "id": 1,+ "name": "Canvas",+ "parent": null,+ "children": [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "Canvas",+ "data": {+ "designResolution": { "x": 800, "y": 600 },+ "scaleMode": 2+ }+ },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "size": { "x": 800, "y": 600 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 2,+ "name": "Title",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 1 },+ "anchorMax": { "x": 0.5, "y": 1 },+ "offsetMin": { "x": 0, "y": -50 },+ "size": { "x": 500, "y": 50 },+ "pivot": { "x": 0.5, "y": 1 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Drag & Focus Demo",+ "fontSize": 28,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 3,+ "name": "Subtitle",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 1 },+ "anchorMax": { "x": 0.5, "y": 1 },+ "offsetMin": { "x": 0, "y": -80 },+ "size": { "x": 500, "y": 30 },+ "pivot": { "x": 0.5, "y": 1 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Drag cards to rearrange \u00b7 Tab to cycle focus",+ "fontSize": 16,+ "color": { "r": 0.6, "g": 0.6, "b": 0.6, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 4,+ "name": "Card1",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -350, "y": -40 },+ "size": { "x": 100, "y": 80 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.85, "g": 0.15, "b": 0.15, "a": 1 }+ }+ },+ { "type": "Interactable", "data": {} },+ { "type": "Draggable", "data": {} },+ { "type": "Focusable", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 5,+ "name": "Card1Label",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -350, "y": -40 },+ "size": { "x": 100, "y": 80 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Card 1",+ "fontSize": 18,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 6,+ "name": "Card2",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -230, "y": -40 },+ "size": { "x": 100, "y": 80 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.85, "g": 0.85, "b": 0.15, "a": 1 }+ }+ },+ { "type": "Interactable", "data": {} },+ { "type": "Draggable", "data": {} },+ { "type": "Focusable", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 7,+ "name": "Card2Label",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -230, "y": -40 },+ "size": { "x": 100, "y": 80 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Card 2",+ "fontSize": 18,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 8,+ "name": "Card3",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -110, "y": -40 },+ "size": { "x": 100, "y": 80 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.15, "g": 0.85, "b": 0.15, "a": 1 }+ }+ },+ { "type": "Interactable", "data": {} },+ { "type": "Draggable", "data": {} },+ { "type": "Focusable", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 9,+ "name": "Card3Label",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": -110, "y": -40 },+ "size": { "x": 100, "y": 80 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Card 3",+ "fontSize": 18,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 10,+ "name": "Card4",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 10, "y": -40 },+ "size": { "x": 100, "y": 80 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.15, "g": 0.85, "b": 0.85, "a": 1 }+ }+ },+ { "type": "Interactable", "data": {} },+ { "type": "Draggable", "data": {} },+ { "type": "Focusable", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 11,+ "name": "Card4Label",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 10, "y": -40 },+ "size": { "x": 100, "y": 80 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Card 4",+ "fontSize": 18,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 12,+ "name": "Card5",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 130, "y": -40 },+ "size": { "x": 100, "y": 80 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.15, "g": 0.15, "b": 0.85, "a": 1 }+ }+ },+ { "type": "Interactable", "data": {} },+ { "type": "Draggable", "data": {} },+ { "type": "Focusable", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 13,+ "name": "Card5Label",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 130, "y": -40 },+ "size": { "x": 100, "y": 80 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Card 5",+ "fontSize": 18,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 14,+ "name": "Card6",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 250, "y": -40 },+ "size": { "x": 100, "y": 80 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.85, "g": 0.15, "b": 0.85, "a": 1 }+ }+ },+ { "type": "Interactable", "data": {} },+ { "type": "Draggable", "data": {} },+ { "type": "Focusable", "data": {} }+ ],+ "visible": true+ },+ {+ "id": 15,+ "name": "Card6Label",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 250, "y": -40 },+ "size": { "x": 100, "y": 80 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Card 6",+ "fontSize": 18,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 16,+ "name": "DropZoneBg",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0 },+ "anchorMax": { "x": 0.5, "y": 0 },+ "offsetMin": { "x": -250, "y": 40 },+ "size": { "x": 500, "y": 120 },+ "pivot": { "x": 0.5, "y": 0 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.15, "g": 0.15, "b": 0.2, "a": 0.5 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 17,+ "name": "DropZoneLabel",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0 },+ "anchorMax": { "x": 0.5, "y": 0 },+ "offsetMin": { "x": -250, "y": 40 },+ "size": { "x": 500, "y": 120 },+ "pivot": { "x": 0.5, "y": 0 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Drop Zone",+ "fontSize": 20,+ "color": { "r": 0.4, "g": 0.4, "b": 0.4, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ }+ ]+}diff --git a/examples/ui-interaction/project.esproject b/examples/ui-interaction/project.esprojectnew file mode 100644index 000000000..c5d8a6a0a--- /dev/null+++ b/examples/ui-interaction/project.esproject@@ -0,0 +1,10 @@+{+ "name": "UI Interaction",+ "version": "0.1.0",+ "engine": "0.1.0",+ "defaultScene": "assets/scenes/main.esscene",+ "created": "2026-03-02T00:00:00.000Z",+ "modified": "2026-03-02T00:00:00.000Z",+ "spineVersion": "none",+ "designResolution": { "width": 800, "height": 600 }+}diff --git a/examples/ui-interaction/src/main.ts b/examples/ui-interaction/src/main.tsnew file mode 100644index 000000000..94b9128e1--- /dev/null+++ b/examples/ui-interaction/src/main.ts@@ -0,0 +1 @@+// UI Interaction - all entities defined in scenediff --git a/examples/ui-interaction/thumbnail.png b/examples/ui-interaction/thumbnail.pngnew file mode 100644index 000000000..edd715e6eBinary files /dev/null and b/examples/ui-interaction/thumbnail.png differdiff --git a/examples/ui-interaction/tsconfig.json b/examples/ui-interaction/tsconfig.jsonnew file mode 100644index 000000000..0a8528b29--- /dev/null+++ b/examples/ui-interaction/tsconfig.json@@ -0,0 +1,22 @@+{+ "compilerOptions": {+ "target": "ES2020",+ "module": "ESNext",+ "moduleResolution": "bundler",+ "strict": true,+ "esModuleInterop": true,+ "skipLibCheck": true,+ "forceConsistentCasingInFileNames": true,+ "declaration": false,+ "outDir": "./dist",+ "rootDir": ".",+ "baseUrl": ".",+ "paths": {+ "esengine": ["./.esengine/sdk/index.d.ts"],+ "esengine/wasm": ["./.esengine/sdk/wasm.d.ts"],+ "@esengine/editor": ["./.esengine/editor/index.d.ts"]+ }+ },+ "include": ["src/**/*"],+ "exclude": ["node_modules"]+}diff --git a/examples/ui-layout/.esengine/settings.json b/examples/ui-layout/.esengine/settings.jsonnew file mode 100644index 000000000..4ae0a6dc7--- /dev/null+++ b/examples/ui-layout/.esengine/settings.json@@ -0,0 +1 @@+{ "lastOpenedScene": "assets/scenes/main.esscene" }diff --git a/examples/ui-layout/.gitignore b/examples/ui-layout/.gitignorenew file mode 100644index 000000000..359472ac2--- /dev/null+++ b/examples/ui-layout/.gitignore@@ -0,0 +1,7 @@+node_modules/+dist/+.vscode/+.idea/+.DS_Store+Thumbs.db+.esengine/cache/diff --git a/examples/ui-layout/assets/scenes/main.esscene b/examples/ui-layout/assets/scenes/main.esscenenew file mode 100644index 000000000..756c1337d--- /dev/null+++ b/examples/ui-layout/assets/scenes/main.esscene@@ -0,0 +1,678 @@+{+ "version": "1.0",+ "name": "Main",+ "entities": [+ {+ "id": 0,+ "name": "Camera",+ "parent": null,+ "children": [],+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": { "x": 0, "y": 0, "z": 10 }+ }+ },+ {+ "type": "Camera",+ "data": {+ "projectionType": 1,+ "orthoSize": 300,+ "isActive": true,+ "priority": 0+ }+ }+ ],+ "visible": true+ },+ {+ "id": 1,+ "name": "Canvas",+ "parent": null,+ "children": [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "Canvas",+ "data": {+ "designResolution": { "x": 800, "y": 600 },+ "scaleMode": 2+ }+ },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "size": { "x": 800, "y": 600 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 2,+ "name": "Title",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 1 },+ "anchorMax": { "x": 0.5, "y": 1 },+ "offsetMin": { "x": 0, "y": -40 },+ "size": { "x": 400, "y": 40 },+ "pivot": { "x": 0.5, "y": 1 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "UIRect Anchor Layout",+ "fontSize": 28,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 3,+ "name": "TopLeftPanel",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0, "y": 1 },+ "anchorMax": { "x": 0, "y": 1 },+ "offsetMin": { "x": 10, "y": -10 },+ "size": { "x": 180, "y": 120 },+ "pivot": { "x": 0, "y": 1 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.2, "g": 0.4, "b": 0.7, "a": 0.8 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 4,+ "name": "TopLeftLabel",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0, "y": 1 },+ "anchorMax": { "x": 0, "y": 1 },+ "offsetMin": { "x": 10, "y": -10 },+ "size": { "x": 180, "y": 120 },+ "pivot": { "x": 0, "y": 1 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Top-Left",+ "fontSize": 16,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 5,+ "name": "TopRightPanel",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 1, "y": 1 },+ "anchorMax": { "x": 1, "y": 1 },+ "offsetMin": { "x": -10, "y": -10 },+ "size": { "x": 180, "y": 120 },+ "pivot": { "x": 1, "y": 1 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.7, "g": 0.2, "b": 0.4, "a": 0.8 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 6,+ "name": "TopRightLabel",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 1, "y": 1 },+ "anchorMax": { "x": 1, "y": 1 },+ "offsetMin": { "x": -10, "y": -10 },+ "size": { "x": 180, "y": 120 },+ "pivot": { "x": 1, "y": 1 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Top-Right",+ "fontSize": 16,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 7,+ "name": "BottomStretchPanel",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0, "y": 0 },+ "anchorMax": { "x": 1, "y": 0 },+ "offsetMin": { "x": 10, "y": 10 },+ "size": { "x": 780, "y": 80 },+ "pivot": { "x": 0.5, "y": 0 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.2, "g": 0.6, "b": 0.3, "a": 0.8 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 8,+ "name": "BottomStretchLabel",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0, "y": 0 },+ "anchorMax": { "x": 1, "y": 0 },+ "offsetMin": { "x": 10, "y": 10 },+ "size": { "x": 780, "y": 80 },+ "pivot": { "x": 0.5, "y": 0 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Bottom Stretch",+ "fontSize": 16,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 9,+ "name": "CenterPanel",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 0, "y": 0 },+ "size": { "x": 200, "y": 150 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.6, "g": 0.4, "b": 0.2, "a": 0.8 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 10,+ "name": "CenterLabel",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0.5, "y": 0.5 },+ "anchorMax": { "x": 0.5, "y": 0.5 },+ "offsetMin": { "x": 0, "y": 0 },+ "size": { "x": 200, "y": 150 },+ "pivot": { "x": 0.5, "y": 0.5 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Center",+ "fontSize": 16,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 11,+ "name": "LeftStretchPanel",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0, "y": 0.15 },+ "anchorMax": { "x": 0, "y": 0.85 },+ "offsetMin": { "x": 200, "y": 0 },+ "size": { "x": 120, "y": 300 },+ "pivot": { "x": 0, "y": 0.5 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.5, "g": 0.2, "b": 0.6, "a": 0.8 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 12,+ "name": "LeftStretchLabel",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0, "y": 0.15 },+ "anchorMax": { "x": 0, "y": 0.85 },+ "offsetMin": { "x": 200, "y": 0 },+ "size": { "x": 120, "y": 300 },+ "pivot": { "x": 0, "y": 0.5 }+ }+ },+ {+ "type": "Text",+ "data": {+ "content": "Left Stretch",+ "fontSize": 16,+ "color": { "r": 1, "g": 1, "b": 1, "a": 1 },+ "align": 1,+ "verticalAlign": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 13,+ "name": "GridItem0",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0, "y": 1 },+ "anchorMax": { "x": 0, "y": 1 },+ "offsetMin": { "x": 430, "y": -195 },+ "size": { "x": 55, "y": 55 },+ "pivot": { "x": 0, "y": 1 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.85, "g": 0.15, "b": 0.15, "a": 0.9 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 14,+ "name": "GridItem1",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0, "y": 1 },+ "anchorMax": { "x": 0, "y": 1 },+ "offsetMin": { "x": 493, "y": -195 },+ "size": { "x": 55, "y": 55 },+ "pivot": { "x": 0, "y": 1 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.85, "g": 0.5, "b": 0.15, "a": 0.9 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 15,+ "name": "GridItem2",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0, "y": 1 },+ "anchorMax": { "x": 0, "y": 1 },+ "offsetMin": { "x": 556, "y": -195 },+ "size": { "x": 55, "y": 55 },+ "pivot": { "x": 0, "y": 1 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.85, "g": 0.85, "b": 0.15, "a": 0.9 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 16,+ "name": "GridItem3",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0, "y": 1 },+ "anchorMax": { "x": 0, "y": 1 },+ "offsetMin": { "x": 619, "y": -195 },+ "size": { "x": 55, "y": 55 },+ "pivot": { "x": 0, "y": 1 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.5, "g": 0.85, "b": 0.15, "a": 0.9 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 17,+ "name": "GridItem4",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0, "y": 1 },+ "anchorMax": { "x": 0, "y": 1 },+ "offsetMin": { "x": 430, "y": -258 },+ "size": { "x": 55, "y": 55 },+ "pivot": { "x": 0, "y": 1 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.15, "g": 0.85, "b": 0.15, "a": 0.9 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 18,+ "name": "GridItem5",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0, "y": 1 },+ "anchorMax": { "x": 0, "y": 1 },+ "offsetMin": { "x": 493, "y": -258 },+ "size": { "x": 55, "y": 55 },+ "pivot": { "x": 0, "y": 1 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.15, "g": 0.85, "b": 0.5, "a": 0.9 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 19,+ "name": "GridItem6",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0, "y": 1 },+ "anchorMax": { "x": 0, "y": 1 },+ "offsetMin": { "x": 556, "y": -258 },+ "size": { "x": 55, "y": 55 },+ "pivot": { "x": 0, "y": 1 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.15, "g": 0.85, "b": 0.85, "a": 0.9 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 20,+ "name": "GridItem7",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0, "y": 1 },+ "anchorMax": { "x": 0, "y": 1 },+ "offsetMin": { "x": 619, "y": -258 },+ "size": { "x": 55, "y": 55 },+ "pivot": { "x": 0, "y": 1 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.15, "g": 0.5, "b": 0.85, "a": 0.9 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 21,+ "name": "GridItem8",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0, "y": 1 },+ "anchorMax": { "x": 0, "y": 1 },+ "offsetMin": { "x": 430, "y": -321 },+ "size": { "x": 55, "y": 55 },+ "pivot": { "x": 0, "y": 1 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.15, "g": 0.15, "b": 0.85, "a": 0.9 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 22,+ "name": "GridItem9",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0, "y": 1 },+ "anchorMax": { "x": 0, "y": 1 },+ "offsetMin": { "x": 493, "y": -321 },+ "size": { "x": 55, "y": 55 },+ "pivot": { "x": 0, "y": 1 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.5, "g": 0.15, "b": 0.85, "a": 0.9 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 23,+ "name": "GridItem10",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0, "y": 1 },+ "anchorMax": { "x": 0, "y": 1 },+ "offsetMin": { "x": 556, "y": -321 },+ "size": { "x": 55, "y": 55 },+ "pivot": { "x": 0, "y": 1 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.85, "g": 0.15, "b": 0.85, "a": 0.9 }+ }+ }+ ],+ "visible": true+ },+ {+ "id": 24,+ "name": "GridItem11",+ "parent": 1,+ "children": [],+ "components": [+ { "type": "Transform", "data": {} },+ {+ "type": "UIRect",+ "data": {+ "anchorMin": { "x": 0, "y": 1 },+ "anchorMax": { "x": 0, "y": 1 },+ "offsetMin": { "x": 619, "y": -321 },+ "size": { "x": 55, "y": 55 },+ "pivot": { "x": 0, "y": 1 }+ }+ },+ {+ "type": "Image",+ "data": {+ "color": { "r": 0.85, "g": 0.15, "b": 0.5, "a": 0.9 }+ }+ }+ ],+ "visible": true+ }+ ]+}diff --git a/examples/ui-layout/project.esproject b/examples/ui-layout/project.esprojectnew file mode 100644index 000000000..ebf110fc4--- /dev/null+++ b/examples/ui-layout/project.esproject@@ -0,0 +1,10 @@+{+ "name": "UI Layout",+ "version": "0.1.0",+ "engine": "0.1.0",+ "defaultScene": "assets/scenes/main.esscene",+ "created": "2026-03-02T00:00:00.000Z",+ "modified": "2026-03-02T00:00:00.000Z",+ "spineVersion": "none",+ "designResolution": { "width": 800, "height": 600 }+}diff --git a/examples/ui-layout/src/main.ts b/examples/ui-layout/src/main.tsnew file mode 100644index 000000000..1d46f09fa--- /dev/null+++ b/examples/ui-layout/src/main.ts@@ -0,0 +1 @@+// UI Layout - all entities defined in scenediff --git a/examples/ui-layout/thumbnail.png b/examples/ui-layout/thumbnail.pngnew file mode 100644index 000000000..c5df1df4cBinary files /dev/null and b/examples/ui-layout/thumbnail.png differdiff --git a/examples/ui-layout/tsconfig.json b/examples/ui-layout/tsconfig.jsonnew file mode 100644index 000000000..0a8528b29--- /dev/null+++ b/examples/ui-layout/tsconfig.json@@ -0,0 +1,22 @@+{+ "compilerOptions": {+ "target": "ES2020",+ "module": "ESNext",+ "moduleResolution": "bundler",+ "strict": true,+ "esModuleInterop": true,+ "skipLibCheck": true,+ "forceConsistentCasingInFileNames": true,+ "declaration": false,+ "outDir": "./dist",+ "rootDir": ".",+ "baseUrl": ".",+ "paths": {+ "esengine": ["./.esengine/sdk/index.d.ts"],+ "esengine/wasm": ["./.esengine/sdk/wasm.d.ts"],+ "@esengine/editor": ["./.esengine/editor/index.d.ts"]+ }+ },+ "include": ["src/**/*"],+ "exclude": ["node_modules"]+}