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(render): parallax unified across renderables — ShapeRenderer + BitmapText
yhh66bd10bd3460
diff --git a/desktop/package.json b/desktop/package.jsonindex c92cd04c6..465e93c02 100644--- a/desktop/package.json+++ b/desktop/package.json@@ -53,7 +53,8 @@"verify:smoke": "vite build && electron scripts/headless-smoke.mjs","mcp": "electron electron/mcp/server.mjs","mcp:smoke": "vite build && node electron/mcp/smoke.mjs",- "verify:render:tilemap:hex": "vite build && ESTELLA_VERIFY_SCENE=/scenes/tilemap-hex.esscene ESTELLA_VERIFY_MANIFEST=/scenes/tilemap-hex.textures.json ESTELLA_VERIFY_W=256 ESTELLA_VERIFY_H=256 ESTELLA_VERIFY_STEPS=6 ESTELLA_VERIFY_EXPECT=\"[{\\\"x\\\":0.40,\\\"y\\\":0.40,\\\"rgb\\\":[255,0,0]},{\\\"x\\\":0.60,\\\"y\\\":0.40,\\\"rgb\\\":[0,255,0]},{\\\"x\\\":0.50,\\\"y\\\":0.55,\\\"rgb\\\":[0,0,255]},{\\\"x\\\":0.70,\\\"y\\\":0.55,\\\"rgb\\\":[255,255,0]}]\" electron scripts/headless-verify.mjs"+ "verify:render:tilemap:hex": "vite build && ESTELLA_VERIFY_SCENE=/scenes/tilemap-hex.esscene ESTELLA_VERIFY_MANIFEST=/scenes/tilemap-hex.textures.json ESTELLA_VERIFY_W=256 ESTELLA_VERIFY_H=256 ESTELLA_VERIFY_STEPS=6 ESTELLA_VERIFY_EXPECT=\"[{\\\"x\\\":0.40,\\\"y\\\":0.40,\\\"rgb\\\":[255,0,0]},{\\\"x\\\":0.60,\\\"y\\\":0.40,\\\"rgb\\\":[0,255,0]},{\\\"x\\\":0.50,\\\"y\\\":0.55,\\\"rgb\\\":[0,0,255]},{\\\"x\\\":0.70,\\\"y\\\":0.55,\\\"rgb\\\":[255,255,0]}]\" electron scripts/headless-verify.mjs",+ "verify:render:parallax:shape": "vite build && ESTELLA_VERIFY_SCENE=/scenes/parallax-shape.esscene ESTELLA_VERIFY_MANIFEST=/scenes/parallax-shape.textures.json ESTELLA_VERIFY_STEPS=4 ESTELLA_VERIFY_EXPECT=\"[{\\\"x\\\":0.5,\\\"y\\\":0.5,\\\"rgb\\\":[0,255,0],\\\"tol\\\":40},{\\\"x\\\":0.25,\\\"y\\\":0.5,\\\"rgb\\\":[255,0,0],\\\"tol\\\":40}]\" electron scripts/headless-verify.mjs"},"dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",diff --git a/desktop/public/scenes/parallax-shape.esscene b/desktop/public/scenes/parallax-shape.esscenenew file mode 100644index 000000000..ebe1c53bd--- /dev/null+++ b/desktop/public/scenes/parallax-shape.esscene@@ -0,0 +1,39 @@+{+ "version": "1.0",+ "name": "ParallaxShape",+ "entities": [+ {+ "id": 0,+ "name": "Camera",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 200, "y": 0, "z": 10 } } },+ { "type": "Camera", "data": { "projectionType": 1, "orthoSize": 300, "isActive": true, "priority": 0 } }+ ],+ "visible": true+ },+ {+ "id": 1,+ "name": "Locked",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },+ { "type": "ShapeRenderer", "data": { "shapeType": 0, "size": { "x": 100, "y": 100 }, "color": { "r": 0, "g": 1, "b": 0, "a": 1 }, "parallax": { "x": 0, "y": 0 }, "enabled": true } }+ ],+ "visible": true+ },+ {+ "id": 2,+ "name": "Normal",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },+ { "type": "ShapeRenderer", "data": { "shapeType": 0, "size": { "x": 100, "y": 100 }, "color": { "r": 1, "g": 0, "b": 0, "a": 1 }, "parallax": { "x": 1, "y": 1 }, "enabled": true } }+ ],+ "visible": true+ }+ ]+}diff --git a/desktop/public/scenes/parallax-shape.textures.json b/desktop/public/scenes/parallax-shape.textures.jsonnew file mode 100644index 000000000..0967ef424--- /dev/null+++ b/desktop/public/scenes/parallax-shape.textures.json@@ -0,0 +1 @@+{}diff --git a/sdk/src/component.generated.ts b/sdk/src/component.generated.tsindex 0ce690c13..60ff93368 100644--- a/sdk/src/component.generated.ts+++ b/sdk/src/component.generated.ts@@ -15,7 +15,7 @@ import type { Dimension, Padding, VisualState } from './wasm.generated';* getAbiLayoutHash(); BuiltinBridge.connect() compares them and refuses to* run on mismatch, because mismatched offsets read the wrong heap bytes.*/-export const ABI_LAYOUT_HASH = '2139ae73f765c1ed';+export const ABI_LAYOUT_HASH = '4a0ed8f94ca2aed4';export interface AssetFieldMeta {field: string;@@ -52,6 +52,7 @@ export const COMPONENT_META: Record<string, ComponentMetaEntry> = {fontSize: 1,align: 0,spacing: 0,+ parallax: { x: 1, y: 1 },layer: 0,font: 0,enabled: true,@@ -63,6 +64,7 @@ export const COMPONENT_META: Record<string, ComponentMetaEntry> = {fields: {fontSize: { min: 1 },align: { enum: [{ label: 'Left', value: 0 }, { label: 'Center', value: 1 }, { label: 'Right', value: 2 }] },+ parallax: { tooltip: "Parallax scroll factor (1 = with world, <1 = slower, 0 = locked to camera).", advanced: true },layer: { step: 1 },},},@@ -397,6 +399,7 @@ export const COMPONENT_META: Record<string, ComponentMetaEntry> = {size: { x: 100, y: 100 },cornerRadius: 0,layer: 0,+ parallax: { x: 1, y: 1 },enabled: true,},assetFields: [],@@ -407,6 +410,7 @@ export const COMPONENT_META: Record<string, ComponentMetaEntry> = {shapeType: { enum: [{ label: 'Circle', value: 0 }, { label: 'Capsule', value: 1 }, { label: 'RoundedRect', value: 2 }] },cornerRadius: { min: 0 },layer: { step: 1, enumSource: "sortingLayers" },+ parallax: { tooltip: "Parallax scroll factor (1 = with world, <1 = slower, 0 = locked to camera).", advanced: true },},},SpineAnimation: {@@ -643,6 +647,7 @@ export interface BitmapTextData {fontSize: number;align: number;spacing: number;+ parallax: Vec2;layer: number;font: number;enabled: boolean;@@ -821,6 +826,7 @@ export interface ShapeRendererData {size: Vec2;cornerRadius: number;layer: number;+ parallax: Vec2;enabled: boolean;}diff --git a/sdk/src/ecs/ptrAccessors.generated.ts b/sdk/src/ecs/ptrAccessors.generated.tsindex 344683b7c..4cf8b7a29 100644--- a/sdk/src/ecs/ptrAccessors.generated.ts+++ b/sdk/src/ecs/ptrAccessors.generated.ts@@ -14,6 +14,7 @@ export interface BitmapTextPtrData {fontSize: number;align: number;spacing: number;+ parallax: Vec2;layer: number;font: number;enabled: boolean;@@ -27,9 +28,10 @@ export function fillBitmapText(out.fontSize = f32[(ptr + 28) >> 2];out.align = u8[ptr + 32];out.spacing = f32[(ptr + 36) >> 2];- out.layer = u32[(ptr + 40) >> 2] | 0;- out.font = u32[(ptr + 44) >> 2];- out.enabled = u8[ptr + 48] !== 0;+ const parallax_ = out.parallax; parallax_.x = f32[(ptr + 40) >> 2]; parallax_.y = f32[((ptr + 40) >> 2) + 1];+ out.layer = u32[(ptr + 48) >> 2] | 0;+ out.font = u32[(ptr + 52) >> 2];+ out.enabled = u8[ptr + 56] !== 0;}export function writeBitmapText(@@ -40,9 +42,10 @@ export function writeBitmapText(f32[(ptr + 28) >> 2] = data.fontSize;u8[ptr + 32] = data.align;f32[(ptr + 36) >> 2] = data.spacing;- u32[(ptr + 40) >> 2] = data.layer | 0;- u32[(ptr + 44) >> 2] = data.font;- u8[ptr + 48] = data.enabled ? 1 : 0;+ f32[(ptr + 40) >> 2] = data.parallax.x; f32[((ptr + 40) >> 2) + 1] = data.parallax.y;+ u32[(ptr + 48) >> 2] = data.layer | 0;+ u32[(ptr + 52) >> 2] = data.font;+ u8[ptr + 56] = data.enabled ? 1 : 0;}export function createBitmapTextData(): BitmapTextPtrData {@@ -51,6 +54,7 @@ export function createBitmapTextData(): BitmapTextPtrData {fontSize: 0,align: 0,spacing: 0,+ parallax: { x: 0, y: 0 },layer: 0,font: 0,enabled: false,@@ -791,6 +795,7 @@ export interface ShapeRendererPtrData {size: Vec2;cornerRadius: number;layer: number;+ parallax: Vec2;enabled: boolean;}@@ -803,7 +808,8 @@ export function fillShapeRenderer(const size_ = out.size; size_.x = f32[(ptr + 20) >> 2]; size_.y = f32[((ptr + 20) >> 2) + 1];out.cornerRadius = f32[(ptr + 28) >> 2];out.layer = u32[(ptr + 32) >> 2] | 0;- out.enabled = u8[ptr + 36] !== 0;+ const parallax_ = out.parallax; parallax_.x = f32[(ptr + 36) >> 2]; parallax_.y = f32[((ptr + 36) >> 2) + 1];+ out.enabled = u8[ptr + 44] !== 0;}export function writeShapeRenderer(@@ -815,7 +821,8 @@ export function writeShapeRenderer(f32[(ptr + 20) >> 2] = data.size.x; f32[((ptr + 20) >> 2) + 1] = data.size.y;f32[(ptr + 28) >> 2] = data.cornerRadius;u32[(ptr + 32) >> 2] = data.layer | 0;- u8[ptr + 36] = data.enabled ? 1 : 0;+ f32[(ptr + 36) >> 2] = data.parallax.x; f32[((ptr + 36) >> 2) + 1] = data.parallax.y;+ u8[ptr + 44] = data.enabled ? 1 : 0;}export function createShapeRendererData(): ShapeRendererPtrData {@@ -825,6 +832,7 @@ export function createShapeRendererData(): ShapeRendererPtrData {size: { x: 0, y: 0 },cornerRadius: 0,layer: 0,+ parallax: { x: 0, y: 0 },enabled: false,};}diff --git a/sdk/src/ptrLayouts.generated.ts b/sdk/src/ptrLayouts.generated.tsindex 4d21523a3..e5f889d59 100644--- a/sdk/src/ptrLayouts.generated.ts+++ b/sdk/src/ptrLayouts.generated.ts@@ -25,9 +25,10 @@ export const PTR_LAYOUTS: Record<string, PtrLayout> = {{ name: 'fontSize', type: 'f32', offset: 28 },{ name: 'align', type: 'u8', offset: 32 },{ name: 'spacing', type: 'f32', offset: 36 },- { name: 'layer', type: 'i32', offset: 40 },- { name: 'font', type: 'u32', offset: 44 },- { name: 'enabled', type: 'bool', offset: 48 },+ { name: 'parallax', type: 'vec2', offset: 40 },+ { name: 'layer', type: 'i32', offset: 48 },+ { name: 'font', type: 'u32', offset: 52 },+ { name: 'enabled', type: 'bool', offset: 56 },],},BoxCollider: {@@ -220,7 +221,8 @@ export const PTR_LAYOUTS: Record<string, PtrLayout> = {{ name: 'size', type: 'vec2', offset: 20 },{ name: 'cornerRadius', type: 'f32', offset: 28 },{ name: 'layer', type: 'i32', offset: 32 },- { name: 'enabled', type: 'bool', offset: 36 },+ { name: 'parallax', type: 'vec2', offset: 36 },+ { name: 'enabled', type: 'bool', offset: 44 },],},SpineAnimation: {diff --git a/sdk/src/wasm.generated.ts b/sdk/src/wasm.generated.tsindex 9b004e987..663294f08 100644--- a/sdk/src/wasm.generated.ts+++ b/sdk/src/wasm.generated.ts@@ -175,6 +175,7 @@ export interface BitmapText {fontSize: number;align: number;spacing: number;+ parallax: Vec2;layer: number;font: number;enabled: boolean;@@ -353,6 +354,7 @@ export interface ShapeRenderer {size: Vec2;cornerRadius: number;layer: number;+ parallax: Vec2;enabled: boolean;}diff --git a/sdk/tests/__snapshots__/component-fieldmeta-golden.test.ts.snap b/sdk/tests/__snapshots__/component-fieldmeta-golden.test.ts.snapindex d4a22283f..553d7caa8 100644--- a/sdk/tests/__snapshots__/component-fieldmeta-golden.test.ts.snap+++ b/sdk/tests/__snapshots__/component-fieldmeta-golden.test.ts.snap@@ -25,6 +25,10 @@ exports[`builtin FieldMeta (RC9-1 equivalence gate) > matches the golden snapsho"layer": {"step": 1,},+ "parallax": {+ "advanced": true,+ "tooltip": "Parallax scroll factor (1 = with world, <1 = slower, 0 = locked to camera).",+ },},"Camera": {"aspectRatio": {@@ -435,6 +439,10 @@ exports[`builtin FieldMeta (RC9-1 equivalence gate) > matches the golden snapsho"enumSource": "sortingLayers","step": 1,},+ "parallax": {+ "advanced": true,+ "tooltip": "Parallax scroll factor (1 = with world, <1 = slower, 0 = locked to camera).",+ },"shapeType": {"enum": [{diff --git a/src/esengine/bindings/EditorAPI.generated.cpp b/src/esengine/bindings/EditorAPI.generated.cppindex 42a3bc0ea..11c31e7eb 100644--- a/src/esengine/bindings/EditorAPI.generated.cpp+++ b/src/esengine/bindings/EditorAPI.generated.cpp@@ -2,10 +2,10 @@* @file EditorAPI.generated.cpp* @brief Auto-generated editor API with string-dispatched component access* @details Generated by EHT - DO NOT EDIT- * @schema_hash a4a54cbd50da0aef+ * @schema_hash 09f40f18d6c7ea16*/-#define ES_EDITOR_API_SCHEMA_HASH "a4a54cbd50da0aef"+#define ES_EDITOR_API_SCHEMA_HASH "09f40f18d6c7ea16"#include <emscripten/bind.h>#include <string>@@ -96,6 +96,8 @@ std::string editor_getComponentSchema(const std::string& name) {{"key":"fontSize","type":"float","group":"BitmapText"},{"key":"align","type":"enum","group":"BitmapText","values":["Left","Center","Right"]},{"key":"spacing","type":"float","group":"BitmapText"},+ {"key":"parallax.x","type":"float","group":"BitmapText"},+ {"key":"parallax.y","type":"float","group":"BitmapText"},{"key":"layer","type":"int","group":"BitmapText"},{"key":"font","type":"asset","group":"BitmapText"},{"key":"enabled","type":"bool","group":"BitmapText"}@@ -308,6 +310,8 @@ std::string editor_getComponentSchema(const std::string& name) {{"key":"size.y","type":"float","group":"ShapeRenderer"},{"key":"cornerRadius","type":"float","group":"ShapeRenderer"},{"key":"layer","type":"int","group":"ShapeRenderer"},+ {"key":"parallax.x","type":"float","group":"ShapeRenderer"},+ {"key":"parallax.y","type":"float","group":"ShapeRenderer"},{"key":"enabled","type":"bool","group":"ShapeRenderer"}])JSON";} else if (name == "SpineAnimation") {@@ -720,6 +724,8 @@ bool editor_setFloat(Registry& reg, u32 e, const std::string& comp, const std::selse if (field == "color.a") { c.color.a = value; }else if (field == "fontSize") { c.fontSize = value; }else if (field == "spacing") { c.spacing = value; }+ else if (field == "parallax.x") { c.parallax.x = value; }+ else if (field == "parallax.y") { c.parallax.y = value; }else { return false; }return true;} else if (comp == "BoxCollider") {@@ -885,6 +891,8 @@ bool editor_setFloat(Registry& reg, u32 e, const std::string& comp, const std::selse if (field == "size.x") { c.size.x = value; }else if (field == "size.y") { c.size.y = value; }else if (field == "cornerRadius") { c.cornerRadius = value; }+ else if (field == "parallax.x") { c.parallax.x = value; }+ else if (field == "parallax.y") { c.parallax.y = value; }else { return false; }return true;} else if (comp == "SpineAnimation") {@@ -1055,6 +1063,8 @@ f32 editor_getFloat(Registry& reg, u32 e, const std::string& comp, const std::stelse if (field == "color.a") { return c.color.a; }else if (field == "fontSize") { return c.fontSize; }else if (field == "spacing") { return c.spacing; }+ else if (field == "parallax.x") { return c.parallax.x; }+ else if (field == "parallax.y") { return c.parallax.y; }} else if (comp == "BoxCollider") {if (!reg.has<esengine::ecs::BoxCollider>(entity)) return 0.0f;const auto& c = reg.get<esengine::ecs::BoxCollider>(entity);@@ -1196,6 +1206,8 @@ f32 editor_getFloat(Registry& reg, u32 e, const std::string& comp, const std::stelse if (field == "size.x") { return c.size.x; }else if (field == "size.y") { return c.size.y; }else if (field == "cornerRadius") { return c.cornerRadius; }+ else if (field == "parallax.x") { return c.parallax.x; }+ else if (field == "parallax.y") { return c.parallax.y; }} else if (comp == "SpineAnimation") {if (!reg.has<esengine::ecs::SpineAnimation>(entity)) return 0.0f;const auto& c = reg.get<esengine::ecs::SpineAnimation>(entity);diff --git a/src/esengine/bindings/WebBindings.generated.cpp b/src/esengine/bindings/WebBindings.generated.cppindex fb4f027dd..a6e07f740 100644--- a/src/esengine/bindings/WebBindings.generated.cpp+++ b/src/esengine/bindings/WebBindings.generated.cpp@@ -228,6 +228,7 @@ struct BitmapTextJS {f32 fontSize;i32 align;f32 spacing;+ glm::vec2 parallax;i32 layer;u32 font;bool enabled;@@ -240,6 +241,7 @@ esengine::ecs::BitmapText bitmaptextFromJS(const BitmapTextJS& js) {c.fontSize = js.fontSize;c.align = static_cast<TextAlign>(js.align);c.spacing = js.spacing;+ c.parallax = js.parallax;c.layer = js.layer;c.font = resource::BitmapFontHandle(js.font);c.enabled = js.enabled;@@ -253,6 +255,7 @@ BitmapTextJS bitmaptextToJS(const esengine::ecs::BitmapText& c) {js.fontSize = c.fontSize;js.align = static_cast<i32>(c.align);js.spacing = c.spacing;+ js.parallax = c.parallax;js.layer = c.layer;js.font = c.font.id();js.enabled = c.enabled;@@ -847,6 +850,7 @@ EMSCRIPTEN_BINDINGS(esengine_components) {.field("fontSize", &BitmapTextJS::fontSize).field("align", &BitmapTextJS::align).field("spacing", &BitmapTextJS::spacing)+ .field("parallax", &BitmapTextJS::parallax).field("layer", &BitmapTextJS::layer).field("font", &BitmapTextJS::font).field("enabled", &BitmapTextJS::enabled);@@ -1010,6 +1014,7 @@ EMSCRIPTEN_BINDINGS(esengine_components) {.field("size", &esengine::ecs::ShapeRenderer::size).field("cornerRadius", &esengine::ecs::ShapeRenderer::cornerRadius).field("layer", &esengine::ecs::ShapeRenderer::layer)+ .field("parallax", &esengine::ecs::ShapeRenderer::parallax).field("enabled", &esengine::ecs::ShapeRenderer::enabled);value_object<esengine::ecs::SpineAnimation>("SpineAnimation")@@ -1760,9 +1765,10 @@ static_assert(offsetof(esengine::ecs::BitmapText, color) == 12, "ABI offset drifstatic_assert(offsetof(esengine::ecs::BitmapText, fontSize) == 28, "ABI offset drift: esengine::ecs::BitmapText.fontSize (EHT expected 28)");static_assert(offsetof(esengine::ecs::BitmapText, align) == 32, "ABI offset drift: esengine::ecs::BitmapText.align (EHT expected 32)");static_assert(offsetof(esengine::ecs::BitmapText, spacing) == 36, "ABI offset drift: esengine::ecs::BitmapText.spacing (EHT expected 36)");-static_assert(offsetof(esengine::ecs::BitmapText, layer) == 40, "ABI offset drift: esengine::ecs::BitmapText.layer (EHT expected 40)");-static_assert(offsetof(esengine::ecs::BitmapText, font) == 44, "ABI offset drift: esengine::ecs::BitmapText.font (EHT expected 44)");-static_assert(offsetof(esengine::ecs::BitmapText, enabled) == 48, "ABI offset drift: esengine::ecs::BitmapText.enabled (EHT expected 48)");+static_assert(offsetof(esengine::ecs::BitmapText, parallax) == 40, "ABI offset drift: esengine::ecs::BitmapText.parallax (EHT expected 40)");+static_assert(offsetof(esengine::ecs::BitmapText, layer) == 48, "ABI offset drift: esengine::ecs::BitmapText.layer (EHT expected 48)");+static_assert(offsetof(esengine::ecs::BitmapText, font) == 52, "ABI offset drift: esengine::ecs::BitmapText.font (EHT expected 52)");+static_assert(offsetof(esengine::ecs::BitmapText, enabled) == 56, "ABI offset drift: esengine::ecs::BitmapText.enabled (EHT expected 56)");static_assert(offsetof(esengine::ecs::BoxCollider, halfExtents) == 0, "ABI offset drift: esengine::ecs::BoxCollider.halfExtents (EHT expected 0)");static_assert(offsetof(esengine::ecs::BoxCollider, offset) == 8, "ABI offset drift: esengine::ecs::BoxCollider.offset (EHT expected 8)");static_assert(offsetof(esengine::ecs::BoxCollider, density) == 16, "ABI offset drift: esengine::ecs::BoxCollider.density (EHT expected 16)");@@ -1890,7 +1896,8 @@ static_assert(offsetof(esengine::ecs::ShapeRenderer, color) == 4, "ABI offset drstatic_assert(offsetof(esengine::ecs::ShapeRenderer, size) == 20, "ABI offset drift: esengine::ecs::ShapeRenderer.size (EHT expected 20)");static_assert(offsetof(esengine::ecs::ShapeRenderer, cornerRadius) == 28, "ABI offset drift: esengine::ecs::ShapeRenderer.cornerRadius (EHT expected 28)");static_assert(offsetof(esengine::ecs::ShapeRenderer, layer) == 32, "ABI offset drift: esengine::ecs::ShapeRenderer.layer (EHT expected 32)");-static_assert(offsetof(esengine::ecs::ShapeRenderer, enabled) == 36, "ABI offset drift: esengine::ecs::ShapeRenderer.enabled (EHT expected 36)");+static_assert(offsetof(esengine::ecs::ShapeRenderer, parallax) == 36, "ABI offset drift: esengine::ecs::ShapeRenderer.parallax (EHT expected 36)");+static_assert(offsetof(esengine::ecs::ShapeRenderer, enabled) == 44, "ABI offset drift: esengine::ecs::ShapeRenderer.enabled (EHT expected 44)");static_assert(offsetof(esengine::ecs::SpineAnimation, timeScale) == 48, "ABI offset drift: esengine::ecs::SpineAnimation.timeScale (EHT expected 48)");static_assert(offsetof(esengine::ecs::SpineAnimation, loop) == 52, "ABI offset drift: esengine::ecs::SpineAnimation.loop (EHT expected 52)");static_assert(offsetof(esengine::ecs::SpineAnimation, playing) == 53, "ABI offset drift: esengine::ecs::SpineAnimation.playing (EHT expected 53)");@@ -1962,7 +1969,7 @@ static_assert(offsetof(esengine::ecs::Velocity, angular) == 12, "ABI offset drif// ABI Hash -- runtime handshake against the SDK bundle// =============================================================================-static const char* kEsAbiLayoutHash = "2139ae73f765c1ed";+static const char* kEsAbiLayoutHash = "4a0ed8f94ca2aed4";std::string esengineGetAbiLayoutHash() {return std::string(kEsAbiLayoutHash);diff --git a/src/esengine/ecs/components/BitmapText.hpp b/src/esengine/ecs/components/BitmapText.hppindex dfba20655..2e80bf8d3 100644--- a/src/esengine/ecs/components/BitmapText.hpp+++ b/src/esengine/ecs/components/BitmapText.hpp@@ -35,6 +35,13 @@ struct BitmapText {ES_PROPERTY()f32 spacing{0.0f};+ /** @brief Parallax scroll factor per axis. 1 = moves with the world (default, no+ * parallax); <1 = scrolls slower than the camera (appears farther, e.g. a+ * background); 0 = locked to the camera (e.g. a sky). The renderer offsets+ * the text by camera_center * (1 - factor). */+ ES_PROPERTY(advanced, tooltip="Parallax scroll factor (1 = with world, <1 = slower, 0 = locked to camera).")+ glm::vec2 parallax{1.0f, 1.0f};+ES_PROPERTY(step=1)i32 layer{0};diff --git a/src/esengine/ecs/components/ShapeRenderer.hpp b/src/esengine/ecs/components/ShapeRenderer.hppindex d882bd5ab..947ea4473 100644--- a/src/esengine/ecs/components/ShapeRenderer.hpp+++ b/src/esengine/ecs/components/ShapeRenderer.hpp@@ -32,6 +32,13 @@ struct ShapeRenderer {ES_PROPERTY(step=1, enum_source=sortingLayers)i32 layer{0};+ /** @brief Parallax scroll factor per axis. 1 = moves with the world (default, no+ * parallax); <1 = scrolls slower than the camera (appears farther, e.g. a+ * background); 0 = locked to the camera (e.g. a sky). The renderer offsets+ * the shape by camera_center * (1 - factor). */+ ES_PROPERTY(advanced, tooltip="Parallax scroll factor (1 = with world, <1 = slower, 0 = locked to camera).")+ glm::vec2 parallax{1.0f, 1.0f};+ES_PROPERTY()bool enabled{true};diff --git a/src/esengine/renderer/plugins/ShapePlugin.cpp b/src/esengine/renderer/plugins/ShapePlugin.cppindex 4765238e4..c2e698194 100644--- a/src/esengine/renderer/plugins/ShapePlugin.cpp+++ b/src/esengine/renderer/plugins/ShapePlugin.cpp@@ -37,6 +37,15 @@ void ShapePlugin::collect(RenderCollectContext& collect_ctx) {auto& ctx = collect_ctx.frame_context;auto shapeView = registry.view<ecs::Transform, ecs::ShapeRenderer>();+ // Camera center in world space (from the inverse view-projection), for parallax —+ // the same derivation SpritePlugin/TilemapRenderPlugin use, so every renderable's+ // parallax scrolls consistently. Computed once per collect.+ glm::mat4 invVP = glm::inverse(ctx.view_projection);+ glm::vec4 camBL = invVP * glm::vec4(-1.0f, -1.0f, 0.0f, 1.0f);+ glm::vec4 camTR = invVP * glm::vec4( 1.0f, 1.0f, 0.0f, 1.0f);+ const f32 camCenterX = (camBL.x / camBL.w + camTR.x / camTR.w) * 0.5f;+ const f32 camCenterY = (camBL.y / camBL.w + camTR.y / camTR.w) * 0.5f;+for (auto entity : shapeView) {const auto& shape = shapeView.get<ecs::ShapeRenderer>(entity);if (!shape.enabled) continue;@@ -44,6 +53,10 @@ void ShapePlugin::collect(RenderCollectContext& collect_ctx) {auto& transform = shapeView.get<ecs::Transform>(entity);transform.ensureDecomposed();glm::vec3 position = transform.worldPosition;+ // Parallax: shift toward the camera by (1 - factor); factor 1 = no shift.+ // Applied before the frustum cull so a parallaxed shape is culled where drawn.+ position.x += camCenterX * (1.0f - shape.parallax.x);+ position.y += camCenterY * (1.0f - shape.parallax.y);const auto& rotation = transform.worldRotation;const auto& scale = transform.worldScale;diff --git a/src/esengine/renderer/plugins/TextPlugin.cpp b/src/esengine/renderer/plugins/TextPlugin.cppindex 48f5763f3..045ac3073 100644--- a/src/esengine/renderer/plugins/TextPlugin.cpp+++ b/src/esengine/renderer/plugins/TextPlugin.cpp@@ -50,6 +50,15 @@ void TextPlugin::collect(RenderCollectContext& collect_ctx) {auto& ctx = collect_ctx.frame_context;auto textView = registry.view<ecs::Transform, ecs::BitmapText>();+ // Camera center in world space (from the inverse view-projection), for parallax —+ // the same derivation SpritePlugin/TilemapRenderPlugin use, so every renderable's+ // parallax scrolls consistently. Computed once per collect.+ glm::mat4 invVP = glm::inverse(ctx.view_projection);+ glm::vec4 camBL = invVP * glm::vec4(-1.0f, -1.0f, 0.0f, 1.0f);+ glm::vec4 camTR = invVP * glm::vec4( 1.0f, 1.0f, 0.0f, 1.0f);+ const f32 camCenterX = (camBL.x / camBL.w + camTR.x / camTR.w) * 0.5f;+ const f32 camCenterY = (camBL.y / camBL.w + camTR.y / camTR.w) * 0.5f;+for (auto entity : textView) {const auto& bt = textView.get<ecs::BitmapText>(entity);if (!bt.enabled) continue;@@ -63,7 +72,11 @@ void TextPlugin::collect(RenderCollectContext& collect_ctx) {auto& transform = textView.get<ecs::Transform>(entity);transform.ensureDecomposed();- const auto& position = transform.worldPosition;+ glm::vec3 position = transform.worldPosition;+ // Parallax: shift toward the camera by (1 - factor); factor 1 = no shift.+ // Applied before the frustum cull so parallaxed text is culled where drawn.+ position.x += camCenterX * (1.0f - bt.parallax.x);+ position.y += camCenterY * (1.0f - bt.parallax.y);const auto& scale = transform.worldScale;auto textMetrics = font->measureText(bt.text, bt.fontSize, bt.spacing);