@gamelearn/arcade-components 1.4.27 → 1.4.29

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.
@@ -419,7 +419,25 @@ var DialogComponent = function DialogComponent(_ref) {
419
419
  head.getWorldPosition(target.position);
420
420
  target.applyQuaternion(camera.quaternion);
421
421
  target.translateX(1.25);
422
- target.translateY(showArrowTop ? 1.25 : 2);
422
+ var distanceToCam = camera.position.distanceTo(element.position);
423
+ var bbox = new _three.Box3().setFromObject(element);
424
+ var size = bbox.getSize(new _three.Vector3());
425
+ var distanceMultiplier = 1;
426
+
427
+ if (distanceToCam > 200 && !zoomInActor) {
428
+ distanceMultiplier = size.y / 3.5;
429
+
430
+ if (distanceToCam > 400) {
431
+ distanceMultiplier = size.y / 2;
432
+
433
+ if (distanceToCam > 600) {
434
+ distanceMultiplier = size.y / 1.5;
435
+ }
436
+ }
437
+ }
438
+
439
+ var baseY = 3 * distanceMultiplier;
440
+ target.translateY(showArrowTop ? 1.25 : baseY);
423
441
  messagePosition.current = {
424
442
  pos: target.position.toArray(),
425
443
  child: head,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@gamelearn/arcade-components",
3
3
  "author": "Gamelearn",
4
4
  "license": "unlicense",
5
- "version": "1.4.27",
5
+ "version": "1.4.29",
6
6
  "main": "dist/index.js",
7
7
  "files": [
8
8
  "dist",