Skip to content

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.

fix(gates): the two SDK gates state what the code now says

yhh441159729d60
diff --git a/sdk/tests/__snapshots__/component-fieldmeta-golden.test.ts.snap b/sdk/tests/__snapshots__/component-fieldmeta-golden.test.ts.snap
index bb772c441..21e96e47c 100644
--- a/sdk/tests/__snapshots__/component-fieldmeta-golden.test.ts.snap
+++ b/sdk/tests/__snapshots__/component-fieldmeta-golden.test.ts.snap
@@ -60,6 +60,12 @@ exports[`builtin FieldMeta (RC9-1 equivalence gate) > matches the golden snapsho
"fov": {
"max": 179,
"min": 1,
+ "shownWhen": {
+ "field": "projectionType",
+ "values": [
+ 0,
+ ],
+ },
"unit": "°",
},
"nearPlane": {
@@ -68,10 +74,22 @@ exports[`builtin FieldMeta (RC9-1 equivalence gate) > matches the golden snapsho
},
"orthoSize": {
"min": 0,
+ "shownWhen": {
+ "field": "projectionType",
+ "values": [
+ 1,
+ ],
+ },
"tooltip": "Half the visible height in world units (Orthographic).",
},
"pixelPerfect": {
"advanced": true,
+ "shownWhen": {
+ "field": "projectionType",
+ "values": [
+ 1,
+ ],
+ },
"tooltip": "Snap the camera to the pixel grid for crisp pixel-art (Orthographic).",
},
"priority": {
@@ -162,15 +180,33 @@ exports[`builtin FieldMeta (RC9-1 equivalence gate) > matches the golden snapsho
},
"Light2D": {
"drawEnvironment": {
+ "shownWhen": {
+ "field": "type",
+ "values": [
+ 2,
+ ],
+ },
"tooltip": "Draw this environment as the sky behind the scene.",
},
"environment": {
+ "shownWhen": {
+ "field": "type",
+ "values": [
+ 2,
+ ],
+ },
"tooltip": "Baked environment (.esenv) this Ambient light casts.",
},
"innerAngle": {
"advanced": true,
"max": 180,
"min": 0,
+ "shownWhen": {
+ "field": "type",
+ "values": [
+ 3,
+ ],
+ },
"unit": "°",
},
"intensity": {
@@ -178,32 +214,86 @@ exports[`builtin FieldMeta (RC9-1 equivalence gate) > matches the golden snapsho
"tooltip": "Brightness multiplier of the light.",
},
"meshShadows": {
- "tooltip": "Cast a shadow map over 3D meshes (Directional).",
+ "shownWhen": {
+ "field": "type",
+ "values": [
+ 0,
+ 1,
+ 3,
+ ],
+ },
+ "tooltip": "Cast a shadow map over 3D meshes (Directional, Spot, Point).",
},
"outerAngle": {
"advanced": true,
"max": 180,
"min": 0,
+ "shownWhen": {
+ "field": "type",
+ "values": [
+ 3,
+ ],
+ },
"unit": "°",
},
"radius": {
"min": 0,
+ "shownWhen": {
+ "field": "type",
+ "values": [
+ 0,
+ 3,
+ ],
+ },
"tooltip": "Falloff reach in world units (Point / Spot).",
},
"shadowDistance": {
"advanced": true,
"min": 0,
+ "shownWhen": {
+ "field": "type",
+ "values": [
+ 1,
+ ],
+ },
"tooltip": "Directional shadow distance; 0 = no directional shadow.",
},
"shadowExtent": {
"advanced": true,
"min": 0,
+ "shownWhen": {
+ "field": "type",
+ "values": [
+ 1,
+ ],
+ },
"tooltip": "Shadow map coverage radius; 0 = fit the view.",
},
"shadowSoftness": {
"min": 0,
+ "shownWhen": {
+ "field": "type",
+ "values": [
+ 0,
+ 1,
+ 3,
+ ],
+ },
"tooltip": "Shadow softness (light-source size); 0 = hard edge.",
},
+ "sourceAngle": {
+ "advanced": true,
+ "max": 90,
+ "min": 0,
+ "shownWhen": {
+ "field": "type",
+ "values": [
+ 1,
+ ],
+ },
+ "tooltip": "Angular size of a Directional light's source; 0 = hard edge (sun ~0.53).",
+ "unit": "°",
+ },
"type": {
"enum": [
{
@@ -328,22 +418,46 @@ exports[`builtin FieldMeta (RC9-1 equivalence gate) > matches the golden snapsho
"category": "Collision",
"max": 1,
"min": 0,
+ "shownWhen": {
+ "field": "collisionEnabled",
+ "values": [
+ 1,
+ ],
+ },
},
"collisionEnabled": {
"category": "Collision",
},
"collisionFloor": {
"category": "Collision",
+ "shownWhen": {
+ "field": "collisionEnabled",
+ "values": [
+ 1,
+ ],
+ },
},
"collisionFriction": {
"category": "Collision",
"max": 1,
"min": 0,
+ "shownWhen": {
+ "field": "collisionEnabled",
+ "values": [
+ 1,
+ ],
+ },
},
"collisionLifetimeLoss": {
"category": "Collision",
"max": 1,
"min": 0,
+ "shownWhen": {
+ "field": "collisionEnabled",
+ "values": [
+ 1,
+ ],
+ },
},
"colorEasing": {
"category": "Color",
@@ -471,14 +585,33 @@ exports[`builtin FieldMeta (RC9-1 equivalence gate) > matches the golden snapsho
},
"shapeAngle": {
"category": "Shape",
+ "shownWhen": {
+ "field": "shape",
+ "values": [
+ 3,
+ ],
+ },
"unit": "°",
},
"shapeRadius": {
"category": "Shape",
"min": 0,
+ "shownWhen": {
+ "field": "shape",
+ "values": [
+ 1,
+ 3,
+ ],
+ },
},
"shapeSize": {
"category": "Shape",
+ "shownWhen": {
+ "field": "shape",
+ "values": [
+ 2,
+ ],
+ },
},
"simulationSpace": {
"category": "Rendering",
@@ -587,16 +720,34 @@ exports[`builtin FieldMeta (RC9-1 equivalence gate) > matches the golden snapsho
"trailMinDistance": {
"category": "Trail",
"min": 0,
+ "shownWhen": {
+ "field": "trailEnabled",
+ "values": [
+ 1,
+ ],
+ },
},
"trailPoints": {
"category": "Trail",
"max": 12,
"min": 2,
+ "shownWhen": {
+ "field": "trailEnabled",
+ "values": [
+ 1,
+ ],
+ },
"step": 1,
},
"trailWidth": {
"category": "Trail",
"min": 0,
+ "shownWhen": {
+ "field": "trailEnabled",
+ "values": [
+ 1,
+ ],
+ },
},
},
"ParticleForceField": {
@@ -727,6 +878,12 @@ exports[`builtin FieldMeta (RC9-1 equivalence gate) > matches the golden snapsho
"TilemapLayer": {
"hexSideLength": {
"min": 0,
+ "shownWhen": {
+ "field": "orientation",
+ "values": [
+ 3,
+ ],
+ },
"step": 1,
"tooltip": "Hexagonal side length in px (0 = a regular pointy hex = tileHeight/2). Ignored unless orientation is Hexagonal.",
},
@@ -772,6 +929,13 @@ exports[`builtin FieldMeta (RC9-1 equivalence gate) > matches the golden snapsho
"value": 1,
},
],
+ "shownWhen": {
+ "field": "orientation",
+ "values": [
+ 2,
+ 3,
+ ],
+ },
"tooltip": "Stagger axis (staggered/hex): Y shifts rows, X shifts columns.",
},
"staggerIndex": {
@@ -785,6 +949,13 @@ exports[`builtin FieldMeta (RC9-1 equivalence gate) > matches the golden snapsho
"value": 1,
},
],
+ "shownWhen": {
+ "field": "orientation",
+ "values": [
+ 2,
+ 3,
+ ],
+ },
"tooltip": "Which lines carry the half-cell shift (staggered/hex).",
},
"tilesetColumns": {
diff --git a/sdk/tests/editor-view.test.ts b/sdk/tests/editor-view.test.ts
index 529cac51c..d7d1e21cb 100644
--- a/sdk/tests/editor-view.test.ts
+++ b/sdk/tests/editor-view.test.ts
@@ -248,8 +248,25 @@ describe('the work plane', () => {
expect(worldAxisVector(p.normal)).toEqual({ x: 0, y: 0, z: 1 });
});
- it('is the ground once the view is a 3D one', () => {
+ it('is the ground once the view is turned to look at a 3D scene', () => {
+ const p = editorViewWorkPlane(view({ perspective: true, pitch: 40 }));
+ expect(worldAxisVector(p.normal)).toEqual({ x: 0, y: 1, z: 0 });
+ expect(new Set([p.u, p.v, p.normal]).size).toBe(3);
+ });
+
+ // A perspective eye that has not been turned yet looks ALONG the ground: that
+ // plane is a line on screen and offers nothing to work on, so the plane the eye
+ // most faces answers — which head-on is the 2D plane, exactly as it was.
+ it('is the 2D plane again while a perspective eye is held head-on', () => {
const p = editorViewWorkPlane(view({ perspective: true }));
+ expect(worldAxisVector(p.normal)).toEqual({ x: 0, y: 0, z: 1 });
+ expect(new Set([p.u, p.v, p.normal]).size).toBe(3);
+ });
+
+ // A top-down orthographic view is the same statement the other way round: the
+ // 2D plane is edge-on there, and the ground is what it is looking at.
+ it('is the ground from a top-down orthographic view', () => {
+ const p = editorViewWorkPlane(view({ pitch: 90 }));
expect(worldAxisVector(p.normal)).toEqual({ x: 0, y: 1, z: 0 });
expect(new Set([p.u, p.v, p.normal]).size).toBe(3);
});