laymur 0.3.7 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4770,7 +4770,7 @@ class UIElement extends UIAnchor {
4770
4770
  /** Internal storage for the current visibility/interaction mode. */
4771
4771
  this.modeInternal = UIMode.VISIBLE;
4772
4772
  /** Internal storage for the transparency rendering mode. */
4773
- this.transparencyInternal = UITransparencyMode.CLIP;
4773
+ this.transparencyInternal = UITransparencyMode.BLEND;
4774
4774
  /** Internal storage for the z-index (depth) value. */
4775
4775
  this.zIndexInternal = 0;
4776
4776
  /**
@@ -4791,6 +4791,7 @@ class UIElement extends UIAnchor {
4791
4791
  this.hVariable = this.solverWrapper.createVariable(height, UIPriority.P6);
4792
4792
  this.sceneWrapper = layer["getSceneWrapperClientAPI"]();
4793
4793
  this.planeHandler = this.sceneWrapper.createPlane(source, uniforms);
4794
+ this.sceneWrapper.setTransparency(this.planeHandler, this.transparencyInternal);
4794
4795
  }
4795
4796
  /**
4796
4797
  * Gets the current width value from the solver.
@@ -6332,6 +6333,19 @@ class UIFullscreenLayer extends UILayer {
6332
6333
  assertValidNumber(deltaTime, "UIFullscreenLayer.deltaTime");
6333
6334
  super.renderInternal(renderer, deltaTime);
6334
6335
  }
6336
+ /**
6337
+ * Projects a 3D world position to 2D screen coordinates within this layer.
6338
+ *
6339
+ * @param position - The 3D world position to project
6340
+ * @param camera - The camera used for projection
6341
+ * @returns The projected 2D position in layer coordinates
6342
+ */
6343
+ projectWorldPosition(position, camera) {
6344
+ const projectedPosition = position.project(camera);
6345
+ projectedPosition.x = MathUtils.mapLinear(projectedPosition.x, -1, 1, this.x, this.width);
6346
+ projectedPosition.y = MathUtils.mapLinear(projectedPosition.y, -1, 1, this.y, this.height);
6347
+ return projectedPosition;
6348
+ }
6335
6349
  /**
6336
6350
  * Calculates the scaling factor based on orientation and fixed dimensions.
6337
6351
  *