gdcore-tools 2.0.0-gd-v5.4.218-autobuild → 2.0.0-gd-v5.4.220-autobuild

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.
Files changed (43) hide show
  1. package/dist/Runtime/Extensions/3D/CustomRuntimeObject3D.js +1 -1
  2. package/dist/Runtime/Extensions/3D/CustomRuntimeObject3D.js.map +2 -2
  3. package/dist/Runtime/Extensions/AnchorBehavior/anchorruntimebehavior.js +1 -1
  4. package/dist/Runtime/Extensions/AnchorBehavior/anchorruntimebehavior.js.map +2 -2
  5. package/dist/Runtime/Extensions/Physics2Behavior/JsExtension.js +19 -19
  6. package/dist/Runtime/Extensions/Physics2Behavior/physics2runtimebehavior.js +1 -1
  7. package/dist/Runtime/Extensions/Physics2Behavior/physics2runtimebehavior.js.map +2 -2
  8. package/dist/Runtime/Extensions/Physics2Behavior/physics2tools.js +1 -1
  9. package/dist/Runtime/Extensions/Physics2Behavior/physics2tools.js.map +2 -2
  10. package/dist/Runtime/Extensions/Physics3DBehavior/JsExtension.js +2442 -0
  11. package/dist/Runtime/Extensions/Physics3DBehavior/Physics3DRuntimeBehavior.js +2 -0
  12. package/dist/Runtime/Extensions/Physics3DBehavior/Physics3DRuntimeBehavior.js.map +7 -0
  13. package/dist/Runtime/Extensions/Physics3DBehavior/Physics3DTools.js +2 -0
  14. package/dist/Runtime/Extensions/Physics3DBehavior/Physics3DTools.js.map +7 -0
  15. package/dist/Runtime/Extensions/Physics3DBehavior/PhysicsCharacter3DRuntimeBehavior.js +2 -0
  16. package/dist/Runtime/Extensions/Physics3DBehavior/PhysicsCharacter3DRuntimeBehavior.js.map +7 -0
  17. package/dist/Runtime/Extensions/Physics3DBehavior/jolt-physics.d.ts +4874 -0
  18. package/dist/Runtime/Extensions/Physics3DBehavior/jolt-physics.wasm.js +2 -0
  19. package/dist/Runtime/Extensions/Physics3DBehavior/jolt-physics.wasm.js.map +7 -0
  20. package/dist/Runtime/Extensions/Physics3DBehavior/jolt-physics.wasm.wasm +0 -0
  21. package/dist/Runtime/Extensions/PlatformBehavior/platformerobjectruntimebehavior.js.map +2 -2
  22. package/dist/Runtime/Extensions/TileMap/helper/TileMapHelper.js +1 -1
  23. package/dist/Runtime/Extensions/TileMap/helper/TileMapHelper.js.map +1 -1
  24. package/dist/Runtime/Extensions/TileMap/simpletilemapruntimeobject.js +1 -1
  25. package/dist/Runtime/Extensions/TileMap/simpletilemapruntimeobject.js.map +2 -2
  26. package/dist/Runtime/RuntimeInstanceContainer.js +1 -1
  27. package/dist/Runtime/RuntimeInstanceContainer.js.map +2 -2
  28. package/dist/Runtime/RuntimeLayer.js +1 -1
  29. package/dist/Runtime/RuntimeLayer.js.map +2 -2
  30. package/dist/Runtime/layer.js +1 -1
  31. package/dist/Runtime/layer.js.map +2 -2
  32. package/dist/Runtime/pixi-renderers/pixi-image-manager.js +1 -1
  33. package/dist/Runtime/pixi-renderers/pixi-image-manager.js.map +2 -2
  34. package/dist/Runtime/pixi-renderers/runtimegame-pixi-renderer.js +1 -1
  35. package/dist/Runtime/pixi-renderers/runtimegame-pixi-renderer.js.map +2 -2
  36. package/dist/Runtime/runtimegame.js +1 -1
  37. package/dist/Runtime/runtimegame.js.map +2 -2
  38. package/dist/Runtime/types/global-types.d.ts +20 -3
  39. package/dist/Runtime/types/project-data.d.ts +1 -1
  40. package/dist/lib/libGD.cjs +1 -1
  41. package/dist/lib/libGD.wasm +0 -0
  42. package/gd.d.ts +17 -3
  43. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- var gdjs;(function(r){class o extends r.CustomRuntimeObject{constructor(t,i){super(t,i);this._z=0;this._minZ=0;this._maxZ=0;this._scaleZ=1;this._flippedZ=!1;this._rotationX=0;this._rotationY=0;this._customCenterZ=0;this._renderer.reinitialize(this,t)}_createRender(){const t=this._runtimeScene;return new r.CustomRuntimeObject3DRenderer(this,this._instanceContainer,t)}_reinitializeRenderer(){this.getRenderer().reinitialize(this,this.getParent())}getRenderer(){return super.getRenderer()}get3DRendererObject(){return this.getRenderer().get3DRendererObject()}extraInitializationFromInitialInstance(t){super.extraInitializationFromInitialInstance(t),t.depth!==void 0&&this.setDepth(t.depth),t.flippedX&&this.flipX(t.flippedX),t.flippedY&&this.flipY(t.flippedY),t.flippedZ&&this.flipZ(t.flippedZ)}setZ(t){t!==this._z&&(this._z=t,this.getRenderer().updatePosition())}getZ(){return this._z}getDrawableZ(){return this._isUntransformedHitBoxesDirty&&this._updateUntransformedHitBoxes(),this._z+this._minZ}getCenterZ(){return this.getDepth()/2}getCenterZInScene(){return this.getDrawableZ()+this.getCenterZ()}setCenterZInScene(t){this.setZ(t+this._z-(this.getDrawableZ()+this.getCenterZ()))}getUnrotatedAABBMinZ(){return this.getDrawableZ()}getUnrotatedAABBMaxZ(){return this.getDrawableZ()+this.getDepth()}setRotationX(t){this._rotationX=t,this.getRenderer().updateRotation()}setRotationY(t){this._rotationY=t,this.getRenderer().updateRotation()}getRotationX(){return this._rotationX}getRotationY(){return this._rotationY}turnAroundX(t){const i=r.CustomRuntimeObject3D._temporaryVector;i.set(1,0,0);const e=this.get3DRendererObject();e.rotateOnWorldAxis(i,r.toRad(t)),this._rotationX=r.toDegrees(e.rotation.x),this._rotationY=r.toDegrees(e.rotation.y),this.setAngle(r.toDegrees(e.rotation.z))}turnAroundY(t){const i=r.CustomRuntimeObject3D._temporaryVector;i.set(0,1,0);const e=this.get3DRendererObject();e.rotateOnWorldAxis(i,r.toRad(t)),this._rotationX=r.toDegrees(e.rotation.x),this._rotationY=r.toDegrees(e.rotation.y),this.setAngle(r.toDegrees(e.rotation.z))}turnAroundZ(t){const i=r.CustomRuntimeObject3D._temporaryVector;i.set(0,0,1);const e=this.get3DRendererObject();e.rotateOnWorldAxis(i,r.toRad(t)),this._rotationX=r.toDegrees(e.rotation.x),this._rotationY=r.toDegrees(e.rotation.y),this.setAngle(r.toDegrees(e.rotation.z))}getUnscaledDepth(){return this._isUntransformedHitBoxesDirty&&this._updateUntransformedHitBoxes(),this._maxZ-this._minZ}_updateUntransformedHitBoxes(){super._updateUntransformedHitBoxes();let t=Number.MAX_VALUE,i=-Number.MAX_VALUE;for(const e of this._instanceContainer.getAdhocListOfAllInstances())!e.isIncludedInParentCollisionMask()||!r.Base3DHandler.is3D(e)||(t=Math.min(t,e.getUnrotatedAABBMinZ()),i=Math.max(i,e.getUnrotatedAABBMaxZ()));t===Number.MAX_VALUE&&(t=0,i=1),this._minZ=t,this._maxZ=i}getUnscaledCenterZ(){return this.hasCustomRotationCenter()?this._customCenterZ:(this._isUntransformedHitBoxesDirty&&this._updateUntransformedHitBoxes(),(this._minZ+this._maxZ)/2)}setRotationCenter3D(t,i,e){this._customCenterZ=e,this.setRotationCenter(t,i)}getDepth(){return this.getUnscaledDepth()*this.getScaleZ()}setDepth(t){const i=this.getUnscaledDepth();if(i===0)return;const e=t/i;this._innerArea&&this._isInnerAreaFollowingParentSize?(this._innerArea.min[2]*=e,this._innerArea.max[2]*=e):this.setScaleZ(e)}setScale(t){super.setScale(t),this.setScaleZ(t)}setScaleZ(t){this._innerArea&&this._isInnerAreaFollowingParentSize||(t<0&&(t=0),t!==Math.abs(this._scaleZ)&&(this._scaleZ=t*(this._flippedZ?-1:1),this.getRenderer().updateSize()))}getScale(){const t=this.getScaleX(),i=this.getScaleY(),e=this.getScaleZ();return t===i&&t===e?t:Math.pow(t*i*e,1/3)}getScaleZ(){return Math.abs(this._scaleZ)}flipZ(t){t!==this._flippedZ&&(this._flippedZ=t,this.getRenderer().updateSize())}isFlippedZ(){return this._flippedZ}}o._temporaryVector=new THREE.Vector3,r.CustomRuntimeObject3D=o})(gdjs||(gdjs={}));
1
+ var gdjs;(function(r){class n extends r.CustomRuntimeObject{constructor(t,i){super(t,i);this._z=0;this._minZ=0;this._maxZ=0;this._scaleZ=1;this._flippedZ=!1;this._rotationX=0;this._rotationY=0;this._customCenterZ=0;this._renderer.reinitialize(this,t)}_createRender(){const t=this._runtimeScene;return new r.CustomRuntimeObject3DRenderer(this,this._instanceContainer,t)}_reinitializeRenderer(){this.getRenderer().reinitialize(this,this.getParent())}getRenderer(){return super.getRenderer()}get3DRendererObject(){return this.getRenderer().get3DRendererObject()}extraInitializationFromInitialInstance(t){super.extraInitializationFromInitialInstance(t),t.depth!==void 0&&this.setDepth(t.depth),t.flippedX&&this.flipX(t.flippedX),t.flippedY&&this.flipY(t.flippedY),t.flippedZ&&this.flipZ(t.flippedZ)}setZ(t){t!==this._z&&(this._z=t,this.getRenderer().updatePosition())}getZ(){return this._z}getDrawableZ(){let t=0;this._innerArea?t=this._innerArea.min[2]:(this._isUntransformedHitBoxesDirty&&this._updateUntransformedHitBoxes(),t=this._minZ);const i=this.getScaleZ();return this._flippedZ?this._z+(-t-this.getUnscaledDepth()+2*this.getUnscaledCenterZ())*i:this._z+t*i}getCenterZ(){return this.getDepth()/2}getCenterZInScene(){return this.getDrawableZ()+this.getCenterZ()}setCenterZInScene(t){this.setZ(t+this._z-(this.getDrawableZ()+this.getCenterZ()))}getUnrotatedAABBMinZ(){return this.getDrawableZ()}getUnrotatedAABBMaxZ(){return this.getDrawableZ()+this.getDepth()}setRotationX(t){this._rotationX=t,this.getRenderer().updateRotation()}setRotationY(t){this._rotationY=t,this.getRenderer().updateRotation()}getRotationX(){return this._rotationX}getRotationY(){return this._rotationY}turnAroundX(t){const i=r.CustomRuntimeObject3D._temporaryVector;i.set(1,0,0);const e=this.get3DRendererObject();e.rotateOnWorldAxis(i,r.toRad(t)),this._rotationX=r.toDegrees(e.rotation.x),this._rotationY=r.toDegrees(e.rotation.y),this.setAngle(r.toDegrees(e.rotation.z))}turnAroundY(t){const i=r.CustomRuntimeObject3D._temporaryVector;i.set(0,1,0);const e=this.get3DRendererObject();e.rotateOnWorldAxis(i,r.toRad(t)),this._rotationX=r.toDegrees(e.rotation.x),this._rotationY=r.toDegrees(e.rotation.y),this.setAngle(r.toDegrees(e.rotation.z))}turnAroundZ(t){const i=r.CustomRuntimeObject3D._temporaryVector;i.set(0,0,1);const e=this.get3DRendererObject();e.rotateOnWorldAxis(i,r.toRad(t)),this._rotationX=r.toDegrees(e.rotation.x),this._rotationY=r.toDegrees(e.rotation.y),this.setAngle(r.toDegrees(e.rotation.z))}getInnerAreaMinZ(){return this._innerArea?this._innerArea.min[2]:(this._isUntransformedHitBoxesDirty&&this._updateUntransformedHitBoxes(),this._minZ)}getInnerAreaMaxZ(){return this._innerArea?this._innerArea.max[2]:(this._isUntransformedHitBoxesDirty&&this._updateUntransformedHitBoxes(),this._maxZ)}getUnscaledDepth(){return this._innerArea?this._innerArea.max[2]-this._innerArea.min[2]:(this._isUntransformedHitBoxesDirty&&this._updateUntransformedHitBoxes(),this._maxZ-this._minZ)}_updateUntransformedHitBoxes(){super._updateUntransformedHitBoxes();let t=Number.MAX_VALUE,i=-Number.MAX_VALUE;for(const e of this._instanceContainer.getAdhocListOfAllInstances())!e.isIncludedInParentCollisionMask()||!r.Base3DHandler.is3D(e)||(t=Math.min(t,e.getUnrotatedAABBMinZ()),i=Math.max(i,e.getUnrotatedAABBMaxZ()));t===Number.MAX_VALUE&&(t=0,i=1),this._minZ=t,this._maxZ=i}getUnscaledCenterZ(){return this.hasCustomRotationCenter()?this._customCenterZ:this._innerArea?(this._innerArea.min[2]+this._innerArea.max[2])/2:(this._isUntransformedHitBoxesDirty&&this._updateUntransformedHitBoxes(),(this._minZ+this._maxZ)/2)}setRotationCenter3D(t,i,e){this._customCenterZ=e,this.setRotationCenter(t,i)}getDepth(){return this.getUnscaledDepth()*this.getScaleZ()}setDepth(t){const i=this.getUnscaledDepth();if(i===0)return;const e=t/i;this._innerArea&&this._isInnerAreaFollowingParentSize?(this._innerArea.min[2]*=e,this._innerArea.max[2]*=e):this.setScaleZ(e)}setScale(t){super.setScale(t),this.setScaleZ(t)}setScaleZ(t){this._innerArea&&this._isInnerAreaFollowingParentSize||(t<0&&(t=0),t!==Math.abs(this._scaleZ)&&(this._scaleZ=t*(this._flippedZ?-1:1),this.getRenderer().updateSize()))}getScale(){const t=this.getScaleX(),i=this.getScaleY(),e=this.getScaleZ();return t===i&&t===e?t:Math.pow(t*i*e,1/3)}getScaleZ(){return Math.abs(this._scaleZ)}flipZ(t){t!==this._flippedZ&&(this._flippedZ=t,this.getRenderer().updateSize())}isFlippedZ(){return this._flippedZ}}n._temporaryVector=new THREE.Vector3,r.CustomRuntimeObject3D=n})(gdjs||(gdjs={}));
2
2
  //# sourceMappingURL=CustomRuntimeObject3D.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../GDevelop/Extensions/3D/CustomRuntimeObject3D.ts"],
4
- "sourcesContent": ["namespace gdjs {\n export interface Object3DDataContent {\n width: float;\n height: float;\n depth: float;\n }\n /** Base parameters for {@link gdjs.RuntimeObject3D} */\n export interface Object3DData extends ObjectData {\n /** The base parameters of the RuntimeObject3D */\n content: Object3DDataContent;\n }\n\n /**\n * Base class for 3D custom objects.\n */\n export class CustomRuntimeObject3D\n extends gdjs.CustomRuntimeObject\n implements gdjs.Base3DHandler {\n /**\n * Position on the Z axis.\n */\n private _z: float = 0;\n private _minZ: float = 0;\n private _maxZ: float = 0;\n private _scaleZ: float = 1;\n private _flippedZ: boolean = false;\n /**\n * Euler angle with the `ZYX` order.\n *\n * Note that `_rotationZ` is `angle` from `gdjs.RuntimeObject`.\n */\n private _rotationX: float = 0;\n /**\n * Euler angle with the `ZYX` order.\n *\n * Note that `_rotationZ` is `angle` from `gdjs.RuntimeObject`.\n */\n private _rotationY: float = 0;\n private _customCenterZ: float = 0;\n private static _temporaryVector = new THREE.Vector3();\n\n constructor(\n parent: gdjs.RuntimeInstanceContainer,\n objectData: Object3DData & CustomObjectConfiguration\n ) {\n super(parent, objectData);\n this._renderer.reinitialize(this, parent);\n }\n\n protected _createRender() {\n const parent = this._runtimeScene;\n return new gdjs.CustomRuntimeObject3DRenderer(\n this,\n this._instanceContainer,\n parent\n );\n }\n\n protected _reinitializeRenderer(): void {\n this.getRenderer().reinitialize(this, this.getParent());\n }\n\n getRenderer(): gdjs.CustomRuntimeObject3DRenderer {\n return super.getRenderer() as gdjs.CustomRuntimeObject3DRenderer;\n }\n\n get3DRendererObject() {\n // It can't be null because Three.js is always loaded\n // when a custom 3D object is used.\n return this.getRenderer().get3DRendererObject()!;\n }\n\n extraInitializationFromInitialInstance(initialInstanceData: InstanceData) {\n super.extraInitializationFromInitialInstance(initialInstanceData);\n if (initialInstanceData.depth !== undefined) {\n this.setDepth(initialInstanceData.depth);\n }\n if (initialInstanceData.flippedX) {\n this.flipX(initialInstanceData.flippedX);\n }\n if (initialInstanceData.flippedY) {\n this.flipY(initialInstanceData.flippedY);\n }\n if (initialInstanceData.flippedZ) {\n this.flipZ(initialInstanceData.flippedZ);\n }\n }\n\n /**\n * Set the object position on the Z axis.\n */\n setZ(z: float): void {\n if (z === this._z) return;\n this._z = z;\n this.getRenderer().updatePosition();\n }\n\n /**\n * Get the object position on the Z axis.\n */\n getZ(): float {\n return this._z;\n }\n\n /**\n * Get the Z position of the rendered object.\n *\n * For most objects, this will returns the same value as getZ(). But if the\n * object has an origin that is not the same as the point (0,0,0) of the\n * object displayed, getDrawableZ will differ.\n *\n * @return The Z position of the rendered object.\n */\n getDrawableZ(): float {\n if (this._isUntransformedHitBoxesDirty) {\n this._updateUntransformedHitBoxes();\n }\n return this._z + this._minZ;\n }\n\n /**\n * Return the Z position of the object center, **relative to the object Z\n * position** (`getDrawableX`).\n *\n * Use `getCenterZInScene` to get the position of the center in the scene.\n *\n * @return the Z position of the object center, relative to\n * `getDrawableZ()`.\n */\n getCenterZ(): float {\n return this.getDepth() / 2;\n }\n\n getCenterZInScene(): float {\n return this.getDrawableZ() + this.getCenterZ();\n }\n\n setCenterZInScene(z: float): void {\n this.setZ(z + this._z - (this.getDrawableZ() + this.getCenterZ()));\n }\n\n /**\n * Return the bottom Z of the object.\n * Rotations around X and Y are not taken into account.\n */\n getUnrotatedAABBMinZ(): number {\n return this.getDrawableZ();\n }\n\n /**\n * Return the top Z of the object.\n * Rotations around X and Y are not taken into account.\n */\n getUnrotatedAABBMaxZ(): number {\n return this.getDrawableZ() + this.getDepth();\n }\n\n /**\n * Set the object rotation on the X axis.\n *\n * This is an Euler angle. Objects use the `ZYX` order.\n */\n setRotationX(angle: float): void {\n this._rotationX = angle;\n this.getRenderer().updateRotation();\n }\n\n /**\n * Set the object rotation on the Y axis.\n *\n * This is an Euler angle. Objects use the `ZYX` order.\n */\n setRotationY(angle: float): void {\n this._rotationY = angle;\n this.getRenderer().updateRotation();\n }\n\n /**\n * Get the object rotation on the X axis.\n *\n * This is an Euler angle. Objects use the `ZYX` order.\n */\n getRotationX(): float {\n return this._rotationX;\n }\n\n /**\n * Get the object rotation on the Y axis.\n *\n * This is an Euler angle. Objects use the `ZYX` order.\n */\n getRotationY(): float {\n return this._rotationY;\n }\n\n /**\n * Turn the object around the scene x axis at its center.\n * @param deltaAngle the rotation angle\n */\n turnAroundX(deltaAngle: float): void {\n const axisX = gdjs.CustomRuntimeObject3D._temporaryVector;\n axisX.set(1, 0, 0);\n\n const mesh = this.get3DRendererObject();\n mesh.rotateOnWorldAxis(axisX, gdjs.toRad(deltaAngle));\n this._rotationX = gdjs.toDegrees(mesh.rotation.x);\n this._rotationY = gdjs.toDegrees(mesh.rotation.y);\n this.setAngle(gdjs.toDegrees(mesh.rotation.z));\n }\n\n /**\n * Turn the object around the scene y axis at its center.\n * @param deltaAngle the rotation angle\n */\n turnAroundY(deltaAngle: float): void {\n const axisY = gdjs.CustomRuntimeObject3D._temporaryVector;\n axisY.set(0, 1, 0);\n\n const mesh = this.get3DRendererObject();\n mesh.rotateOnWorldAxis(axisY, gdjs.toRad(deltaAngle));\n this._rotationX = gdjs.toDegrees(mesh.rotation.x);\n this._rotationY = gdjs.toDegrees(mesh.rotation.y);\n this.setAngle(gdjs.toDegrees(mesh.rotation.z));\n }\n\n /**\n * Turn the object around the scene z axis at its center.\n * @param deltaAngle the rotation angle\n */\n turnAroundZ(deltaAngle: float): void {\n const axisZ = gdjs.CustomRuntimeObject3D._temporaryVector;\n axisZ.set(0, 0, 1);\n\n const mesh = this.get3DRendererObject();\n mesh.rotateOnWorldAxis(axisZ, gdjs.toRad(deltaAngle));\n this._rotationX = gdjs.toDegrees(mesh.rotation.x);\n this._rotationY = gdjs.toDegrees(mesh.rotation.y);\n this.setAngle(gdjs.toDegrees(mesh.rotation.z));\n }\n\n /**\n * @return the internal width of the object according to its children.\n */\n getUnscaledDepth(): float {\n if (this._isUntransformedHitBoxesDirty) {\n this._updateUntransformedHitBoxes();\n }\n return this._maxZ - this._minZ;\n }\n\n _updateUntransformedHitBoxes(): void {\n super._updateUntransformedHitBoxes();\n\n let minZ = Number.MAX_VALUE;\n let maxZ = -Number.MAX_VALUE;\n for (const childInstance of this._instanceContainer.getAdhocListOfAllInstances()) {\n if (!childInstance.isIncludedInParentCollisionMask()) {\n continue;\n }\n if (!gdjs.Base3DHandler.is3D(childInstance)) {\n continue;\n }\n minZ = Math.min(minZ, childInstance.getUnrotatedAABBMinZ());\n maxZ = Math.max(maxZ, childInstance.getUnrotatedAABBMaxZ());\n }\n if (minZ === Number.MAX_VALUE) {\n // The unscaled size can't be 0 because setWidth and setHeight wouldn't\n // have any effect.\n minZ = 0;\n maxZ = 1;\n }\n this._minZ = minZ;\n this._maxZ = maxZ;\n }\n\n /**\n * @returns the center Z from the local origin (0;0).\n */\n getUnscaledCenterZ(): float {\n if (this.hasCustomRotationCenter()) {\n return this._customCenterZ;\n }\n if (this._isUntransformedHitBoxesDirty) {\n this._updateUntransformedHitBoxes();\n }\n return (this._minZ + this._maxZ) / 2;\n }\n\n /**\n * The center of rotation is defined relatively to the origin (the object\n * position).\n * This avoids the center to move when children push the bounds.\n *\n * When no custom center is defined, it will move\n * to stay at the center of the children bounds.\n *\n * @param x coordinate of the custom center\n * @param y coordinate of the custom center\n */\n setRotationCenter3D(x: float, y: float, z: float) {\n this._customCenterZ = z;\n this.setRotationCenter(x, y);\n }\n\n /**\n * Get the object size on the Z axis (called \"depth\").\n */\n getDepth(): float {\n return this.getUnscaledDepth() * this.getScaleZ();\n }\n\n /**\n * Set the object size on the Z axis (called \"depth\").\n */\n setDepth(depth: float): void {\n const unscaledDepth = this.getUnscaledDepth();\n if (unscaledDepth === 0) {\n return;\n }\n const scaleZ = depth / unscaledDepth;\n if (this._innerArea && this._isInnerAreaFollowingParentSize) {\n this._innerArea.min[2] *= scaleZ;\n this._innerArea.max[2] *= scaleZ;\n } else {\n this.setScaleZ(scaleZ);\n }\n }\n\n /**\n * Change the scale on X, Y and Z axis of the object.\n *\n * @param newScale The new scale (must be greater than 0).\n */\n setScale(newScale: number): void {\n super.setScale(newScale);\n this.setScaleZ(newScale);\n }\n\n /**\n * Change the scale on Z axis of the object (changing its height).\n *\n * @param newScale The new scale (must be greater than 0).\n */\n setScaleZ(newScale: number): void {\n if (this._innerArea && this._isInnerAreaFollowingParentSize) {\n // The scale is always 1;\n return;\n }\n if (newScale < 0) {\n newScale = 0;\n }\n if (newScale === Math.abs(this._scaleZ)) {\n return;\n }\n this._scaleZ = newScale * (this._flippedZ ? -1 : 1);\n this.getRenderer().updateSize();\n }\n\n /**\n * Get the scale of the object (or the geometric average of X, Y and Z scale in case they are different).\n *\n * @return the scale of the object (or the geometric average of X, Y and Z scale in case they are different).\n */\n getScale(): number {\n const scaleX = this.getScaleX();\n const scaleY = this.getScaleY();\n const scaleZ = this.getScaleZ();\n return scaleX === scaleY && scaleX === scaleZ\n ? scaleX\n : Math.pow(scaleX * scaleY * scaleZ, 1 / 3);\n }\n\n /**\n * Get the scale of the object on Z axis.\n *\n * @return the scale of the object on Z axis\n */\n getScaleZ(): float {\n return Math.abs(this._scaleZ);\n }\n\n flipZ(enable: boolean) {\n if (enable === this._flippedZ) {\n return;\n }\n this._flippedZ = enable;\n this.getRenderer().updateSize();\n }\n\n isFlippedZ(): boolean {\n return this._flippedZ;\n }\n }\n}\n"],
5
- "mappings": "AAAA,GAAU,MAAV,UAAU,EAAV,CAeS,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BAA4B,CAC1B,MAAI,MAAK,0BACA,KAAK,eAEV,MAAK,+BACP,KAAK,+BAEC,MAAK,MAAQ,KAAK,OAAS,GAcrC,oBAAoB,EAAU,EAAU,EAAU,CAChD,KAAK,eAAiB,EACtB,KAAK,kBAAkB,EAAG,GAM5B,UAAkB,CAChB,MAAO,MAAK,mBAAqB,KAAK,YAMxC,SAAS,EAAoB,CAC3B,KAAM,GAAgB,KAAK,mBAC3B,GAAI,IAAkB,EACpB,OAEF,KAAM,GAAS,EAAQ,EACvB,AAAI,KAAK,YAAc,KAAK,gCAC1B,MAAK,WAAW,IAAI,IAAM,EAC1B,KAAK,WAAW,IAAI,IAAM,GAE1B,KAAK,UAAU,GASnB,SAAS,EAAwB,CAC/B,MAAM,SAAS,GACf,KAAK,UAAU,GAQjB,UAAU,EAAwB,CAChC,AAAI,KAAK,YAAc,KAAK,iCAIxB,GAAW,GACb,GAAW,GAET,IAAa,KAAK,IAAI,KAAK,UAG/B,MAAK,QAAU,EAAY,MAAK,UAAY,GAAK,GACjD,KAAK,cAAc,eAQrB,UAAmB,CACjB,KAAM,GAAS,KAAK,YACd,EAAS,KAAK,YACd,EAAS,KAAK,YACpB,MAAO,KAAW,GAAU,IAAW,EACnC,EACA,KAAK,IAAI,EAAS,EAAS,EAAQ,EAAI,GAQ7C,WAAmB,CACjB,MAAO,MAAK,IAAI,KAAK,SAGvB,MAAM,EAAiB,CACrB,AAAI,IAAW,KAAK,WAGpB,MAAK,UAAY,EACjB,KAAK,cAAc,cAGrB,YAAsB,CACpB,MAAO,MAAK,WA/VC,AAxBV,EAwBU,iBAAmB,GAAI,OAAM,QAxBvC,EAAM,0BAfL",
4
+ "sourcesContent": ["namespace gdjs {\n export interface Object3DDataContent {\n width: float;\n height: float;\n depth: float;\n }\n /** Base parameters for {@link gdjs.RuntimeObject3D} */\n export interface Object3DData extends ObjectData {\n /** The base parameters of the RuntimeObject3D */\n content: Object3DDataContent;\n }\n\n /**\n * Base class for 3D custom objects.\n */\n export class CustomRuntimeObject3D\n extends gdjs.CustomRuntimeObject\n implements gdjs.Base3DHandler {\n /**\n * Position on the Z axis.\n */\n private _z: float = 0;\n private _minZ: float = 0;\n private _maxZ: float = 0;\n private _scaleZ: float = 1;\n private _flippedZ: boolean = false;\n /**\n * Euler angle with the `ZYX` order.\n *\n * Note that `_rotationZ` is `angle` from `gdjs.RuntimeObject`.\n */\n private _rotationX: float = 0;\n /**\n * Euler angle with the `ZYX` order.\n *\n * Note that `_rotationZ` is `angle` from `gdjs.RuntimeObject`.\n */\n private _rotationY: float = 0;\n private _customCenterZ: float = 0;\n private static _temporaryVector = new THREE.Vector3();\n\n constructor(\n parent: gdjs.RuntimeInstanceContainer,\n objectData: Object3DData & CustomObjectConfiguration\n ) {\n super(parent, objectData);\n this._renderer.reinitialize(this, parent);\n }\n\n protected _createRender() {\n const parent = this._runtimeScene;\n return new gdjs.CustomRuntimeObject3DRenderer(\n this,\n this._instanceContainer,\n parent\n );\n }\n\n protected _reinitializeRenderer(): void {\n this.getRenderer().reinitialize(this, this.getParent());\n }\n\n getRenderer(): gdjs.CustomRuntimeObject3DRenderer {\n return super.getRenderer() as gdjs.CustomRuntimeObject3DRenderer;\n }\n\n get3DRendererObject() {\n // It can't be null because Three.js is always loaded\n // when a custom 3D object is used.\n return this.getRenderer().get3DRendererObject()!;\n }\n\n extraInitializationFromInitialInstance(initialInstanceData: InstanceData) {\n super.extraInitializationFromInitialInstance(initialInstanceData);\n if (initialInstanceData.depth !== undefined) {\n this.setDepth(initialInstanceData.depth);\n }\n if (initialInstanceData.flippedX) {\n this.flipX(initialInstanceData.flippedX);\n }\n if (initialInstanceData.flippedY) {\n this.flipY(initialInstanceData.flippedY);\n }\n if (initialInstanceData.flippedZ) {\n this.flipZ(initialInstanceData.flippedZ);\n }\n }\n\n /**\n * Set the object position on the Z axis.\n */\n setZ(z: float): void {\n if (z === this._z) return;\n this._z = z;\n this.getRenderer().updatePosition();\n }\n\n /**\n * Get the object position on the Z axis.\n */\n getZ(): float {\n return this._z;\n }\n\n /**\n * Get the Z position of the rendered object.\n *\n * For most objects, this will returns the same value as getZ(). But if the\n * object has an origin that is not the same as the point (0,0,0) of the\n * object displayed, getDrawableZ will differ.\n *\n * @return The Z position of the rendered object.\n */\n getDrawableZ(): float {\n let minZ = 0;\n if (this._innerArea) {\n minZ = this._innerArea.min[2];\n } else {\n if (this._isUntransformedHitBoxesDirty) {\n this._updateUntransformedHitBoxes();\n }\n minZ = this._minZ;\n }\n const absScaleZ = this.getScaleZ();\n if (!this._flippedZ) {\n return this._z + minZ * absScaleZ;\n } else {\n return (\n this._z +\n (-minZ - this.getUnscaledDepth() + 2 * this.getUnscaledCenterZ()) *\n absScaleZ\n );\n }\n }\n\n /**\n * Return the Z position of the object center, **relative to the object Z\n * position** (`getDrawableX`).\n *\n * Use `getCenterZInScene` to get the position of the center in the scene.\n *\n * @return the Z position of the object center, relative to\n * `getDrawableZ()`.\n */\n getCenterZ(): float {\n return this.getDepth() / 2;\n }\n\n getCenterZInScene(): float {\n return this.getDrawableZ() + this.getCenterZ();\n }\n\n setCenterZInScene(z: float): void {\n this.setZ(z + this._z - (this.getDrawableZ() + this.getCenterZ()));\n }\n\n /**\n * Return the bottom Z of the object.\n * Rotations around X and Y are not taken into account.\n */\n getUnrotatedAABBMinZ(): number {\n return this.getDrawableZ();\n }\n\n /**\n * Return the top Z of the object.\n * Rotations around X and Y are not taken into account.\n */\n getUnrotatedAABBMaxZ(): number {\n return this.getDrawableZ() + this.getDepth();\n }\n\n /**\n * Set the object rotation on the X axis.\n *\n * This is an Euler angle. Objects use the `ZYX` order.\n */\n setRotationX(angle: float): void {\n this._rotationX = angle;\n this.getRenderer().updateRotation();\n }\n\n /**\n * Set the object rotation on the Y axis.\n *\n * This is an Euler angle. Objects use the `ZYX` order.\n */\n setRotationY(angle: float): void {\n this._rotationY = angle;\n this.getRenderer().updateRotation();\n }\n\n /**\n * Get the object rotation on the X axis.\n *\n * This is an Euler angle. Objects use the `ZYX` order.\n */\n getRotationX(): float {\n return this._rotationX;\n }\n\n /**\n * Get the object rotation on the Y axis.\n *\n * This is an Euler angle. Objects use the `ZYX` order.\n */\n getRotationY(): float {\n return this._rotationY;\n }\n\n /**\n * Turn the object around the scene x axis at its center.\n * @param deltaAngle the rotation angle\n */\n turnAroundX(deltaAngle: float): void {\n const axisX = gdjs.CustomRuntimeObject3D._temporaryVector;\n axisX.set(1, 0, 0);\n\n const mesh = this.get3DRendererObject();\n mesh.rotateOnWorldAxis(axisX, gdjs.toRad(deltaAngle));\n this._rotationX = gdjs.toDegrees(mesh.rotation.x);\n this._rotationY = gdjs.toDegrees(mesh.rotation.y);\n this.setAngle(gdjs.toDegrees(mesh.rotation.z));\n }\n\n /**\n * Turn the object around the scene y axis at its center.\n * @param deltaAngle the rotation angle\n */\n turnAroundY(deltaAngle: float): void {\n const axisY = gdjs.CustomRuntimeObject3D._temporaryVector;\n axisY.set(0, 1, 0);\n\n const mesh = this.get3DRendererObject();\n mesh.rotateOnWorldAxis(axisY, gdjs.toRad(deltaAngle));\n this._rotationX = gdjs.toDegrees(mesh.rotation.x);\n this._rotationY = gdjs.toDegrees(mesh.rotation.y);\n this.setAngle(gdjs.toDegrees(mesh.rotation.z));\n }\n\n /**\n * Turn the object around the scene z axis at its center.\n * @param deltaAngle the rotation angle\n */\n turnAroundZ(deltaAngle: float): void {\n const axisZ = gdjs.CustomRuntimeObject3D._temporaryVector;\n axisZ.set(0, 0, 1);\n\n const mesh = this.get3DRendererObject();\n mesh.rotateOnWorldAxis(axisZ, gdjs.toRad(deltaAngle));\n this._rotationX = gdjs.toDegrees(mesh.rotation.x);\n this._rotationY = gdjs.toDegrees(mesh.rotation.y);\n this.setAngle(gdjs.toDegrees(mesh.rotation.z));\n }\n\n /**\n * @return the internal top bound of the object according to its children.\n */\n getInnerAreaMinZ(): number {\n if (this._innerArea) {\n return this._innerArea.min[2];\n }\n if (this._isUntransformedHitBoxesDirty) {\n this._updateUntransformedHitBoxes();\n }\n return this._minZ;\n }\n\n /**\n * @return the internal bottom bound of the object according to its children.\n */\n getInnerAreaMaxZ(): number {\n if (this._innerArea) {\n return this._innerArea.max[2];\n }\n if (this._isUntransformedHitBoxesDirty) {\n this._updateUntransformedHitBoxes();\n }\n return this._maxZ;\n }\n\n /**\n * @return the internal width of the object according to its children.\n */\n getUnscaledDepth(): float {\n if (this._innerArea) {\n return this._innerArea.max[2] - this._innerArea.min[2];\n }\n if (this._isUntransformedHitBoxesDirty) {\n this._updateUntransformedHitBoxes();\n }\n return this._maxZ - this._minZ;\n }\n\n _updateUntransformedHitBoxes(): void {\n super._updateUntransformedHitBoxes();\n\n let minZ = Number.MAX_VALUE;\n let maxZ = -Number.MAX_VALUE;\n for (const childInstance of this._instanceContainer.getAdhocListOfAllInstances()) {\n if (!childInstance.isIncludedInParentCollisionMask()) {\n continue;\n }\n if (!gdjs.Base3DHandler.is3D(childInstance)) {\n continue;\n }\n minZ = Math.min(minZ, childInstance.getUnrotatedAABBMinZ());\n maxZ = Math.max(maxZ, childInstance.getUnrotatedAABBMaxZ());\n }\n if (minZ === Number.MAX_VALUE) {\n // The unscaled size can't be 0 because setWidth and setHeight wouldn't\n // have any effect.\n minZ = 0;\n maxZ = 1;\n }\n this._minZ = minZ;\n this._maxZ = maxZ;\n }\n\n /**\n * @returns the center Z from the local origin (0;0).\n */\n getUnscaledCenterZ(): float {\n if (this.hasCustomRotationCenter()) {\n return this._customCenterZ;\n }\n if (this._innerArea) {\n return (this._innerArea.min[2] + this._innerArea.max[2]) / 2;\n }\n if (this._isUntransformedHitBoxesDirty) {\n this._updateUntransformedHitBoxes();\n }\n return (this._minZ + this._maxZ) / 2;\n }\n\n /**\n * The center of rotation is defined relatively to the origin (the object\n * position).\n * This avoids the center to move when children push the bounds.\n *\n * When no custom center is defined, it will move\n * to stay at the center of the children bounds.\n *\n * @param x coordinate of the custom center\n * @param y coordinate of the custom center\n */\n setRotationCenter3D(x: float, y: float, z: float) {\n this._customCenterZ = z;\n this.setRotationCenter(x, y);\n }\n\n /**\n * Get the object size on the Z axis (called \"depth\").\n */\n getDepth(): float {\n return this.getUnscaledDepth() * this.getScaleZ();\n }\n\n /**\n * Set the object size on the Z axis (called \"depth\").\n */\n setDepth(depth: float): void {\n const unscaledDepth = this.getUnscaledDepth();\n if (unscaledDepth === 0) {\n return;\n }\n const scaleZ = depth / unscaledDepth;\n if (this._innerArea && this._isInnerAreaFollowingParentSize) {\n this._innerArea.min[2] *= scaleZ;\n this._innerArea.max[2] *= scaleZ;\n } else {\n this.setScaleZ(scaleZ);\n }\n }\n\n /**\n * Change the scale on X, Y and Z axis of the object.\n *\n * @param newScale The new scale (must be greater than 0).\n */\n setScale(newScale: number): void {\n super.setScale(newScale);\n this.setScaleZ(newScale);\n }\n\n /**\n * Change the scale on Z axis of the object (changing its height).\n *\n * @param newScale The new scale (must be greater than 0).\n */\n setScaleZ(newScale: number): void {\n if (this._innerArea && this._isInnerAreaFollowingParentSize) {\n // The scale is always 1;\n return;\n }\n if (newScale < 0) {\n newScale = 0;\n }\n if (newScale === Math.abs(this._scaleZ)) {\n return;\n }\n this._scaleZ = newScale * (this._flippedZ ? -1 : 1);\n this.getRenderer().updateSize();\n }\n\n /**\n * Get the scale of the object (or the geometric average of X, Y and Z scale in case they are different).\n *\n * @return the scale of the object (or the geometric average of X, Y and Z scale in case they are different).\n */\n getScale(): number {\n const scaleX = this.getScaleX();\n const scaleY = this.getScaleY();\n const scaleZ = this.getScaleZ();\n return scaleX === scaleY && scaleX === scaleZ\n ? scaleX\n : Math.pow(scaleX * scaleY * scaleZ, 1 / 3);\n }\n\n /**\n * Get the scale of the object on Z axis.\n *\n * @return the scale of the object on Z axis\n */\n getScaleZ(): float {\n return Math.abs(this._scaleZ);\n }\n\n flipZ(enable: boolean) {\n if (enable === this._flippedZ) {\n return;\n }\n this._flippedZ = enable;\n this.getRenderer().updateSize();\n }\n\n isFlippedZ(): boolean {\n return this._flippedZ;\n }\n }\n}\n"],
5
+ "mappings": "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EAAS,KAAK,YACd,EAAS,KAAK,YACpB,MAAO,KAAW,GAAU,IAAW,EACnC,EACA,KAAK,IAAI,EAAS,EAAS,EAAQ,EAAI,GAQ7C,WAAmB,CACjB,MAAO,MAAK,IAAI,KAAK,SAGvB,MAAM,EAAiB,CACrB,AAAI,IAAW,KAAK,WAGpB,MAAK,UAAY,EACjB,KAAK,cAAc,cAGrB,YAAsB,CACpB,MAAO,MAAK,WA9YC,AAxBV,EAwBU,iBAAmB,GAAI,OAAM,QAxBvC,EAAM,0BAfL",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- var gdjs;(function(_){let o;(function(t){t[t.None=0]="None",t[t.WindowLeft=1]="WindowLeft",t[t.WindowRight=2]="WindowRight",t[t.Proportional=3]="Proportional",t[t.WindowCenter=4]="WindowCenter"})(o||(o={}));let n;(function(t){t[t.None=0]="None",t[t.WindowTop=1]="WindowTop",t[t.WindowBottom=2]="WindowBottom",t[t.Proportional=3]="Proportional",t[t.WindowCenter=4]="WindowCenter"})(n||(n={}));class R extends _.RuntimeBehavior{constructor(e,i,s){super(e,i,s);this._invalidDistances=!0;this._leftEdgeDistance=0;this._rightEdgeDistance=0;this._topEdgeDistance=0;this._bottomEdgeDistance=0;this._useLegacyBottomAndRightAnchors=!1;this._relativeToOriginalWindowSize=!!i.relativeToOriginalWindowSize,this._leftEdgeAnchor=i.leftEdgeAnchor,this._rightEdgeAnchor=i.rightEdgeAnchor,this._topEdgeAnchor=i.topEdgeAnchor,this._bottomEdgeAnchor=i.bottomEdgeAnchor,this._useLegacyBottomAndRightAnchors=i.useLegacyBottomAndRightAnchors===void 0?!0:i.useLegacyBottomAndRightAnchors}updateFromBehaviorData(e,i){return e.leftEdgeAnchor!==i.leftEdgeAnchor&&(this._leftEdgeAnchor=i.leftEdgeAnchor),e.rightEdgeAnchor!==i.rightEdgeAnchor&&(this._rightEdgeAnchor=i.rightEdgeAnchor),e.topEdgeAnchor!==i.topEdgeAnchor&&(this._topEdgeAnchor=i.topEdgeAnchor),e.bottomEdgeAnchor!==i.bottomEdgeAnchor&&(this._bottomEdgeAnchor=i.bottomEdgeAnchor),e.useLegacyTrajectory!==i.useLegacyTrajectory&&(this._useLegacyBottomAndRightAnchors=i.useLegacyBottomAndRightAnchors),e.relativeToOriginalWindowSize===i.relativeToOriginalWindowSize}onActivate(){this._invalidDistances=!0}doStepPreEvents(e){const i=_.staticArray(_.AnchorRuntimeBehavior.prototype.doStepPreEvents);let s=e.getUnrotatedViewportMinX(),h=e.getUnrotatedViewportMinY(),t=e.getUnrotatedViewportMaxX(),d=e.getUnrotatedViewportMaxY(),l=(t+s)/2,f=(d+h)/2,w=t-s,A=d-h;const b=e.getLayer(this.owner.getLayer());if(this._invalidDistances){this._relativeToOriginalWindowSize&&(s=e.getInitialUnrotatedViewportMinX(),h=e.getInitialUnrotatedViewportMinY(),t=e.getInitialUnrotatedViewportMaxX(),d=e.getInitialUnrotatedViewportMaxY(),l=(t+s)/2,f=(d+h)/2,w=t-s,A=d-h);const r=this._convertCoords(e,b,this.owner.getDrawableX(),this.owner.getDrawableY(),i);this._leftEdgeAnchor===1?this._leftEdgeDistance=r[0]-s:this._leftEdgeAnchor===2?this._leftEdgeDistance=r[0]-t:this._leftEdgeAnchor===3?this._leftEdgeDistance=(r[0]-s)/w:this._leftEdgeAnchor===4&&(this._leftEdgeDistance=r[0]-l),this._topEdgeAnchor===1?this._topEdgeDistance=r[1]-h:this._topEdgeAnchor===2?this._topEdgeDistance=r[1]-d:this._topEdgeAnchor===3?this._topEdgeDistance=(r[1]-h)/A:this._topEdgeAnchor===4&&(this._topEdgeDistance=r[1]-f);const g=this._convertCoords(e,b,this.owner.getDrawableX()+this.owner.getWidth(),this.owner.getDrawableY()+this.owner.getHeight(),i);this._rightEdgeAnchor===1?this._rightEdgeDistance=g[0]-s:this._rightEdgeAnchor===2?this._rightEdgeDistance=g[0]-t:this._rightEdgeAnchor===3?this._rightEdgeDistance=(g[0]-s)/w:this._rightEdgeAnchor===4&&(this._rightEdgeDistance=g[0]-l),this._bottomEdgeAnchor===1?this._bottomEdgeDistance=g[1]-h:this._bottomEdgeAnchor===2?this._bottomEdgeDistance=g[1]-d:this._bottomEdgeAnchor===3?this._bottomEdgeDistance=(g[1]-h)/A:this._bottomEdgeAnchor===4&&(this._bottomEdgeDistance=g[1]-f),this._invalidDistances=!1}else{let r=0,g=0,a=0,p=0;this._leftEdgeAnchor===1?r=s+this._leftEdgeDistance:this._leftEdgeAnchor===2?r=t+this._leftEdgeDistance:this._leftEdgeAnchor===3?r=s+this._leftEdgeDistance*w:this._leftEdgeAnchor===4&&(r=l+this._leftEdgeDistance),this._topEdgeAnchor===1?g=h+this._topEdgeDistance:this._topEdgeAnchor===2?g=d+this._topEdgeDistance:this._topEdgeAnchor===3?g=h+this._topEdgeDistance*A:this._topEdgeAnchor===4&&(g=f+this._topEdgeDistance),this._rightEdgeAnchor===1?a=s+this._rightEdgeDistance:this._rightEdgeAnchor===2?a=t+this._rightEdgeDistance:this._rightEdgeAnchor===3?a=s+this._rightEdgeDistance*w:this._rightEdgeAnchor===4&&(a=l+this._rightEdgeDistance),this._bottomEdgeAnchor===1?p=h+this._bottomEdgeDistance:this._bottomEdgeAnchor===2?p=d+this._bottomEdgeDistance:this._bottomEdgeAnchor===3?p=h+this._bottomEdgeDistance*A:this._bottomEdgeAnchor===4&&(p=f+this._bottomEdgeDistance);const D=this._convertInverseCoords(e,b,r,g,i),c=D[0],E=D[1],P=this._convertInverseCoords(e,b,a,p,i),W=P[0],u=P[1];if(this._useLegacyBottomAndRightAnchors)this._rightEdgeAnchor!==0&&this.owner.setWidth(W-c),this._bottomEdgeAnchor!==0&&this.owner.setHeight(u-E),this._leftEdgeAnchor!==0&&this.owner.setX(c+this.owner.getX()-this.owner.getDrawableX()),this._topEdgeAnchor!==0&&this.owner.setY(E+this.owner.getY()-this.owner.getDrawableY());else{if(this._rightEdgeAnchor!==0&&this._leftEdgeAnchor!==0){const m=W-c;this.owner.setX(this.owner.getX()===this.owner.getDrawableX()?c:c+(this.owner.getX()-this.owner.getDrawableX())*m/this.owner.getWidth()),this.owner.setWidth(m)}else this._leftEdgeAnchor!==0&&this.owner.setX(c+this.owner.getX()-this.owner.getDrawableX()),this._rightEdgeAnchor!==0&&this.owner.setX(W+this.owner.getX()-this.owner.getDrawableX()-this.owner.getWidth());if(this._bottomEdgeAnchor!==0&&this._topEdgeAnchor!==0){const m=u-E;this.owner.setY(this.owner.getY()===this.owner.getDrawableY()?E:E+(this.owner.getY()-this.owner.getDrawableY())*m/this.owner.getHeight()),this.owner.setHeight(m)}else this._topEdgeAnchor!==0&&this.owner.setY(E+this.owner.getY()-this.owner.getDrawableY()),this._bottomEdgeAnchor!==0&&this.owner.setY(u+this.owner.getY()-this.owner.getDrawableY()-this.owner.getHeight())}}}doStepPostEvents(e){}_convertCoords(e,i,s,h,t){return e!==e.getScene()?(t[0]=s,t[1]=h,t):i.convertCoords(s,h,0,t)}_convertInverseCoords(e,i,s,h,t){return e!==e.getScene()?(t[0]=s,t[1]=h,t):i.convertInverseCoords(s,h,0,t)}}_.AnchorRuntimeBehavior=R,_.registerBehavior("AnchorBehavior::AnchorBehavior",_.AnchorRuntimeBehavior)})(gdjs||(gdjs={}));
1
+ var gdjs;(function(E){let o;(function(t){t[t.None=0]="None",t[t.WindowLeft=1]="WindowLeft",t[t.WindowRight=2]="WindowRight",t[t.Proportional=3]="Proportional",t[t.WindowCenter=4]="WindowCenter"})(o||(o={}));let n;(function(t){t[t.None=0]="None",t[t.WindowTop=1]="WindowTop",t[t.WindowBottom=2]="WindowBottom",t[t.Proportional=3]="Proportional",t[t.WindowCenter=4]="WindowCenter"})(n||(n={}));class R extends E.RuntimeBehavior{constructor(e,i,s){super(e,i,s);this._invalidDistances=!0;this._leftEdgeDistance=0;this._rightEdgeDistance=0;this._topEdgeDistance=0;this._bottomEdgeDistance=0;this._useLegacyBottomAndRightAnchors=!1;this._relativeToOriginalWindowSize=!!i.relativeToOriginalWindowSize,this._leftEdgeAnchor=i.leftEdgeAnchor,this._rightEdgeAnchor=i.rightEdgeAnchor,this._topEdgeAnchor=i.topEdgeAnchor,this._bottomEdgeAnchor=i.bottomEdgeAnchor,this._useLegacyBottomAndRightAnchors=i.useLegacyBottomAndRightAnchors===void 0?!0:i.useLegacyBottomAndRightAnchors}updateFromBehaviorData(e,i){return e.leftEdgeAnchor!==i.leftEdgeAnchor&&(this._leftEdgeAnchor=i.leftEdgeAnchor),e.rightEdgeAnchor!==i.rightEdgeAnchor&&(this._rightEdgeAnchor=i.rightEdgeAnchor),e.topEdgeAnchor!==i.topEdgeAnchor&&(this._topEdgeAnchor=i.topEdgeAnchor),e.bottomEdgeAnchor!==i.bottomEdgeAnchor&&(this._bottomEdgeAnchor=i.bottomEdgeAnchor),e.useLegacyTrajectory!==i.useLegacyTrajectory&&(this._useLegacyBottomAndRightAnchors=i.useLegacyBottomAndRightAnchors),e.relativeToOriginalWindowSize===i.relativeToOriginalWindowSize}onActivate(){this._invalidDistances=!0}doStepPreEvents(e){const i=E.staticArray(E.AnchorRuntimeBehavior.prototype.doStepPreEvents);let s=e.getUnrotatedViewportMinX(),h=e.getUnrotatedViewportMinY(),t=e.getUnrotatedViewportMaxX(),d=e.getUnrotatedViewportMaxY(),_=(t+s)/2,w=(d+h)/2,f=t-s,a=d-h;const b=e.getLayer(this.owner.getLayer());if(this._invalidDistances){this._relativeToOriginalWindowSize&&(s=e.getInitialUnrotatedViewportMinX(),h=e.getInitialUnrotatedViewportMinY(),t=e.getInitialUnrotatedViewportMaxX(),d=e.getInitialUnrotatedViewportMaxY(),_=(t+s)/2,w=(d+h)/2,f=t-s,a=d-h);const r=this._relativeToOriginalWindowSize?[this.owner.getDrawableX(),this.owner.getDrawableY()]:this._convertInverseCoords(e,b,this.owner.getDrawableX(),this.owner.getDrawableY(),i);this._leftEdgeAnchor===1?this._leftEdgeDistance=r[0]-s:this._leftEdgeAnchor===2?this._leftEdgeDistance=r[0]-t:this._leftEdgeAnchor===3?this._leftEdgeDistance=(r[0]-s)/f:this._leftEdgeAnchor===4&&(this._leftEdgeDistance=r[0]-_),this._topEdgeAnchor===1?this._topEdgeDistance=r[1]-h:this._topEdgeAnchor===2?this._topEdgeDistance=r[1]-d:this._topEdgeAnchor===3?this._topEdgeDistance=(r[1]-h)/a:this._topEdgeAnchor===4&&(this._topEdgeDistance=r[1]-w);const g=this._relativeToOriginalWindowSize?[this.owner.getDrawableX()+this.owner.getWidth(),this.owner.getDrawableY()+this.owner.getHeight()]:this._convertInverseCoords(e,b,this.owner.getDrawableX()+this.owner.getWidth(),this.owner.getDrawableY()+this.owner.getHeight(),i);this._rightEdgeAnchor===1?this._rightEdgeDistance=g[0]-s:this._rightEdgeAnchor===2?this._rightEdgeDistance=g[0]-t:this._rightEdgeAnchor===3?this._rightEdgeDistance=(g[0]-s)/f:this._rightEdgeAnchor===4&&(this._rightEdgeDistance=g[0]-_),this._bottomEdgeAnchor===1?this._bottomEdgeDistance=g[1]-h:this._bottomEdgeAnchor===2?this._bottomEdgeDistance=g[1]-d:this._bottomEdgeAnchor===3?this._bottomEdgeDistance=(g[1]-h)/a:this._bottomEdgeAnchor===4&&(this._bottomEdgeDistance=g[1]-w),this._invalidDistances=!1}else{let r=0,g=0,A=0,p=0;this._leftEdgeAnchor===1?r=s+this._leftEdgeDistance:this._leftEdgeAnchor===2?r=t+this._leftEdgeDistance:this._leftEdgeAnchor===3?r=s+this._leftEdgeDistance*f:this._leftEdgeAnchor===4&&(r=_+this._leftEdgeDistance),this._topEdgeAnchor===1?g=h+this._topEdgeDistance:this._topEdgeAnchor===2?g=d+this._topEdgeDistance:this._topEdgeAnchor===3?g=h+this._topEdgeDistance*a:this._topEdgeAnchor===4&&(g=w+this._topEdgeDistance),this._rightEdgeAnchor===1?A=s+this._rightEdgeDistance:this._rightEdgeAnchor===2?A=t+this._rightEdgeDistance:this._rightEdgeAnchor===3?A=s+this._rightEdgeDistance*f:this._rightEdgeAnchor===4&&(A=_+this._rightEdgeDistance),this._bottomEdgeAnchor===1?p=h+this._bottomEdgeDistance:this._bottomEdgeAnchor===2?p=d+this._bottomEdgeDistance:this._bottomEdgeAnchor===3?p=h+this._bottomEdgeDistance*a:this._bottomEdgeAnchor===4&&(p=w+this._bottomEdgeDistance);const D=this._convertCoords(e,b,r,g,i);let c=D[0],l=D[1];const P=this._convertCoords(e,b,A,p,i),W=P[0],u=P[1];if(this._useLegacyBottomAndRightAnchors)this._rightEdgeAnchor!==0&&this.owner.setWidth(W-c),this._bottomEdgeAnchor!==0&&this.owner.setHeight(u-l),this._leftEdgeAnchor!==0&&this.owner.setX(c+this.owner.getX()-this.owner.getDrawableX()),this._topEdgeAnchor!==0&&this.owner.setY(l+this.owner.getY()-this.owner.getDrawableY());else{if(this._rightEdgeAnchor!==0&&this._leftEdgeAnchor!==0){const m=W-c;this.owner.setX(this.owner.getX()===this.owner.getDrawableX()?c:c+(this.owner.getX()-this.owner.getDrawableX())*m/this.owner.getWidth()),this.owner.setWidth(m)}else this._leftEdgeAnchor!==0&&this.owner.setX(c+this.owner.getX()-this.owner.getDrawableX()),this._rightEdgeAnchor!==0&&this.owner.setX(W+this.owner.getX()-this.owner.getDrawableX()-this.owner.getWidth());if(this._bottomEdgeAnchor!==0&&this._topEdgeAnchor!==0){const m=u-l;this.owner.setY(this.owner.getY()===this.owner.getDrawableY()?l:l+(this.owner.getY()-this.owner.getDrawableY())*m/this.owner.getHeight()),this.owner.setHeight(m)}else this._topEdgeAnchor!==0&&this.owner.setY(l+this.owner.getY()-this.owner.getDrawableY()),this._bottomEdgeAnchor!==0&&this.owner.setY(u+this.owner.getY()-this.owner.getDrawableY()-this.owner.getHeight())}}}doStepPostEvents(e){}_convertCoords(e,i,s,h,t){return e!==e.getScene()?(t[0]=s,t[1]=h,t):i.convertCoords(s,h,0,t)}_convertInverseCoords(e,i,s,h,t){return e!==e.getScene()?(t[0]=s,t[1]=h,t):i.convertInverseCoords(s,h,0,t)}}E.AnchorRuntimeBehavior=R,E.registerBehavior("AnchorBehavior::AnchorBehavior",E.AnchorRuntimeBehavior)})(gdjs||(gdjs={}));
2
2
  //# sourceMappingURL=anchorruntimebehavior.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../GDevelop/Extensions/AnchorBehavior/anchorruntimebehavior.ts"],
4
- "sourcesContent": ["/*\nGDevelop - Anchor Behavior Extension\nCopyright (c) 2013-2016 Florian Rival (Florian.Rival@gmail.com)\n */\n\nnamespace gdjs {\n const enum HorizontalAnchor {\n None = 0,\n WindowLeft,\n WindowRight,\n Proportional,\n WindowCenter,\n }\n const enum VerticalAnchor {\n None = 0,\n WindowTop,\n WindowBottom,\n Proportional,\n WindowCenter,\n }\n\n export class AnchorRuntimeBehavior extends gdjs.RuntimeBehavior {\n _relativeToOriginalWindowSize: any;\n _leftEdgeAnchor: HorizontalAnchor;\n _rightEdgeAnchor: HorizontalAnchor;\n _topEdgeAnchor: any;\n _bottomEdgeAnchor: any;\n _invalidDistances: boolean = true;\n _leftEdgeDistance: number = 0;\n _rightEdgeDistance: number = 0;\n _topEdgeDistance: number = 0;\n _bottomEdgeDistance: number = 0;\n _useLegacyBottomAndRightAnchors: boolean = false;\n\n constructor(\n instanceContainer: gdjs.RuntimeInstanceContainer,\n behaviorData,\n owner: gdjs.RuntimeObject\n ) {\n super(instanceContainer, behaviorData, owner);\n this._relativeToOriginalWindowSize = !!behaviorData.relativeToOriginalWindowSize;\n this._leftEdgeAnchor = behaviorData.leftEdgeAnchor;\n this._rightEdgeAnchor = behaviorData.rightEdgeAnchor;\n this._topEdgeAnchor = behaviorData.topEdgeAnchor;\n this._bottomEdgeAnchor = behaviorData.bottomEdgeAnchor;\n this._useLegacyBottomAndRightAnchors =\n behaviorData.useLegacyBottomAndRightAnchors === undefined\n ? true\n : behaviorData.useLegacyBottomAndRightAnchors;\n }\n\n updateFromBehaviorData(oldBehaviorData, newBehaviorData): boolean {\n if (oldBehaviorData.leftEdgeAnchor !== newBehaviorData.leftEdgeAnchor) {\n this._leftEdgeAnchor = newBehaviorData.leftEdgeAnchor;\n }\n if (oldBehaviorData.rightEdgeAnchor !== newBehaviorData.rightEdgeAnchor) {\n this._rightEdgeAnchor = newBehaviorData.rightEdgeAnchor;\n }\n if (oldBehaviorData.topEdgeAnchor !== newBehaviorData.topEdgeAnchor) {\n this._topEdgeAnchor = newBehaviorData.topEdgeAnchor;\n }\n if (\n oldBehaviorData.bottomEdgeAnchor !== newBehaviorData.bottomEdgeAnchor\n ) {\n this._bottomEdgeAnchor = newBehaviorData.bottomEdgeAnchor;\n }\n if (\n oldBehaviorData.useLegacyTrajectory !==\n newBehaviorData.useLegacyTrajectory\n ) {\n this._useLegacyBottomAndRightAnchors =\n newBehaviorData.useLegacyBottomAndRightAnchors;\n }\n if (\n oldBehaviorData.relativeToOriginalWindowSize !==\n newBehaviorData.relativeToOriginalWindowSize\n ) {\n return false;\n }\n return true;\n }\n\n onActivate() {\n this._invalidDistances = true;\n }\n\n doStepPreEvents(instanceContainer: gdjs.RuntimeInstanceContainer) {\n const workingPoint: FloatPoint = gdjs.staticArray(\n gdjs.AnchorRuntimeBehavior.prototype.doStepPreEvents\n ) as FloatPoint;\n let parentMinX = instanceContainer.getUnrotatedViewportMinX();\n let parentMinY = instanceContainer.getUnrotatedViewportMinY();\n let parentMaxX = instanceContainer.getUnrotatedViewportMaxX();\n let parentMaxY = instanceContainer.getUnrotatedViewportMaxY();\n let parentCenterX = (parentMaxX + parentMinX) / 2;\n let parentCenterY = (parentMaxY + parentMinY) / 2;\n let parentWidth = parentMaxX - parentMinX;\n let parentHeight = parentMaxY - parentMinY;\n const layer = instanceContainer.getLayer(this.owner.getLayer());\n if (this._invalidDistances) {\n if (this._relativeToOriginalWindowSize) {\n parentMinX = instanceContainer.getInitialUnrotatedViewportMinX();\n parentMinY = instanceContainer.getInitialUnrotatedViewportMinY();\n parentMaxX = instanceContainer.getInitialUnrotatedViewportMaxX();\n parentMaxY = instanceContainer.getInitialUnrotatedViewportMaxY();\n parentCenterX = (parentMaxX + parentMinX) / 2;\n parentCenterY = (parentMaxY + parentMinY) / 2;\n parentWidth = parentMaxX - parentMinX;\n parentHeight = parentMaxY - parentMinY;\n }\n\n //Calculate the distances from the window's bounds.\n const topLeftPixel = this._convertCoords(\n instanceContainer,\n layer,\n this.owner.getDrawableX(),\n this.owner.getDrawableY(),\n workingPoint\n );\n\n // Left edge\n if (this._leftEdgeAnchor === HorizontalAnchor.WindowLeft) {\n this._leftEdgeDistance = topLeftPixel[0] - parentMinX;\n } else if (this._leftEdgeAnchor === HorizontalAnchor.WindowRight) {\n this._leftEdgeDistance = topLeftPixel[0] - parentMaxX;\n } else if (this._leftEdgeAnchor === HorizontalAnchor.Proportional) {\n this._leftEdgeDistance = (topLeftPixel[0] - parentMinX) / parentWidth;\n } else if (this._leftEdgeAnchor === HorizontalAnchor.WindowCenter) {\n this._leftEdgeDistance = topLeftPixel[0] - parentCenterX;\n }\n\n // Top edge\n if (this._topEdgeAnchor === VerticalAnchor.WindowTop) {\n this._topEdgeDistance = topLeftPixel[1] - parentMinY;\n } else if (this._topEdgeAnchor === VerticalAnchor.WindowBottom) {\n this._topEdgeDistance = topLeftPixel[1] - parentMaxY;\n } else if (this._topEdgeAnchor === VerticalAnchor.Proportional) {\n this._topEdgeDistance = (topLeftPixel[1] - parentMinY) / parentHeight;\n } else if (this._topEdgeAnchor === VerticalAnchor.WindowCenter) {\n this._topEdgeDistance = topLeftPixel[1] - parentCenterY;\n }\n\n // It's fine to reuse workingPoint as topLeftPixel is no longer used.\n const bottomRightPixel = this._convertCoords(\n instanceContainer,\n layer,\n this.owner.getDrawableX() + this.owner.getWidth(),\n this.owner.getDrawableY() + this.owner.getHeight(),\n workingPoint\n );\n\n // Right edge\n if (this._rightEdgeAnchor === HorizontalAnchor.WindowLeft) {\n this._rightEdgeDistance = bottomRightPixel[0] - parentMinX;\n } else if (this._rightEdgeAnchor === HorizontalAnchor.WindowRight) {\n this._rightEdgeDistance = bottomRightPixel[0] - parentMaxX;\n } else if (this._rightEdgeAnchor === HorizontalAnchor.Proportional) {\n this._rightEdgeDistance =\n (bottomRightPixel[0] - parentMinX) / parentWidth;\n } else if (this._rightEdgeAnchor === HorizontalAnchor.WindowCenter) {\n this._rightEdgeDistance = bottomRightPixel[0] - parentCenterX;\n }\n\n // Bottom edge\n if (this._bottomEdgeAnchor === VerticalAnchor.WindowTop) {\n this._bottomEdgeDistance = bottomRightPixel[1] - parentMinY;\n } else if (this._bottomEdgeAnchor === VerticalAnchor.WindowBottom) {\n this._bottomEdgeDistance = bottomRightPixel[1] - parentMaxY;\n } else if (this._bottomEdgeAnchor === VerticalAnchor.Proportional) {\n this._bottomEdgeDistance =\n (bottomRightPixel[1] - parentMinY) / parentHeight;\n } else if (this._bottomEdgeAnchor === VerticalAnchor.WindowCenter) {\n this._bottomEdgeDistance = bottomRightPixel[1] - parentCenterY;\n }\n\n this._invalidDistances = false;\n } else {\n //Move and resize the object if needed\n let leftPixel = 0;\n let topPixel = 0;\n let rightPixel = 0;\n let bottomPixel = 0;\n\n // Left edge\n if (this._leftEdgeAnchor === HorizontalAnchor.WindowLeft) {\n leftPixel = parentMinX + this._leftEdgeDistance;\n } else if (this._leftEdgeAnchor === HorizontalAnchor.WindowRight) {\n leftPixel = parentMaxX + this._leftEdgeDistance;\n } else if (this._leftEdgeAnchor === HorizontalAnchor.Proportional) {\n leftPixel = parentMinX + this._leftEdgeDistance * parentWidth;\n } else if (this._leftEdgeAnchor === HorizontalAnchor.WindowCenter) {\n leftPixel = parentCenterX + this._leftEdgeDistance;\n }\n\n // Top edge\n if (this._topEdgeAnchor === VerticalAnchor.WindowTop) {\n topPixel = parentMinY + this._topEdgeDistance;\n } else if (this._topEdgeAnchor === VerticalAnchor.WindowBottom) {\n topPixel = parentMaxY + this._topEdgeDistance;\n } else if (this._topEdgeAnchor === VerticalAnchor.Proportional) {\n topPixel = parentMinY + this._topEdgeDistance * parentHeight;\n } else if (this._topEdgeAnchor === VerticalAnchor.WindowCenter) {\n topPixel = parentCenterY + this._topEdgeDistance;\n }\n\n // Right edge\n if (this._rightEdgeAnchor === HorizontalAnchor.WindowLeft) {\n rightPixel = parentMinX + this._rightEdgeDistance;\n } else if (this._rightEdgeAnchor === HorizontalAnchor.WindowRight) {\n rightPixel = parentMaxX + this._rightEdgeDistance;\n } else if (this._rightEdgeAnchor === HorizontalAnchor.Proportional) {\n rightPixel = parentMinX + this._rightEdgeDistance * parentWidth;\n } else if (this._rightEdgeAnchor === HorizontalAnchor.WindowCenter) {\n rightPixel = parentCenterX + this._rightEdgeDistance;\n }\n\n // Bottom edge\n if (this._bottomEdgeAnchor === VerticalAnchor.WindowTop) {\n bottomPixel = parentMinY + this._bottomEdgeDistance;\n } else if (this._bottomEdgeAnchor === VerticalAnchor.WindowBottom) {\n bottomPixel = parentMaxY + this._bottomEdgeDistance;\n } else if (this._bottomEdgeAnchor === VerticalAnchor.Proportional) {\n bottomPixel = parentMinY + this._bottomEdgeDistance * parentHeight;\n } else if (this._bottomEdgeAnchor === VerticalAnchor.WindowCenter) {\n bottomPixel = parentCenterY + this._bottomEdgeDistance;\n }\n\n // It's fine to reuse workingPoint as topLeftPixel is no longer used.\n const topLeftCoord = this._convertInverseCoords(\n instanceContainer,\n layer,\n leftPixel,\n topPixel,\n workingPoint\n );\n const left = topLeftCoord[0];\n const top = topLeftCoord[1];\n\n const bottomRightCoord = this._convertInverseCoords(\n instanceContainer,\n layer,\n rightPixel,\n bottomPixel,\n workingPoint\n );\n const right = bottomRightCoord[0];\n const bottom = bottomRightCoord[1];\n\n // Compatibility with GD <= 5.0.133\n if (this._useLegacyBottomAndRightAnchors) {\n //Move and resize the object according to the anchors\n if (this._rightEdgeAnchor !== HorizontalAnchor.None) {\n this.owner.setWidth(right - left);\n }\n if (this._bottomEdgeAnchor !== VerticalAnchor.None) {\n this.owner.setHeight(bottom - top);\n }\n if (this._leftEdgeAnchor !== HorizontalAnchor.None) {\n this.owner.setX(\n left + this.owner.getX() - this.owner.getDrawableX()\n );\n }\n if (this._topEdgeAnchor !== VerticalAnchor.None) {\n this.owner.setY(\n top + this.owner.getY() - this.owner.getDrawableY()\n );\n }\n }\n // End of compatibility code\n else {\n // Resize if right and left anchors are set\n if (\n this._rightEdgeAnchor !== HorizontalAnchor.None &&\n this._leftEdgeAnchor !== HorizontalAnchor.None\n ) {\n const width = right - left;\n this.owner.setX(\n this.owner.getX() === this.owner.getDrawableX()\n ? left\n : // It uses the position of the origin relatively to the object\n // size to apply it with the new size.\n // This is the same as doing:\n // lerp(left, right, (this.owner.getX() - this.owner.getDrawableX() / this.owner.getWidth())\n // But, the division is done at the end to avoid rounding errors.\n left +\n ((this.owner.getX() - this.owner.getDrawableX()) * width) /\n this.owner.getWidth()\n );\n this.owner.setWidth(width);\n } else {\n if (this._leftEdgeAnchor !== HorizontalAnchor.None) {\n this.owner.setX(\n left + this.owner.getX() - this.owner.getDrawableX()\n );\n }\n if (this._rightEdgeAnchor !== HorizontalAnchor.None) {\n this.owner.setX(\n right +\n this.owner.getX() -\n this.owner.getDrawableX() -\n this.owner.getWidth()\n );\n }\n }\n // Resize if top and bottom anchors are set\n if (\n this._bottomEdgeAnchor !== VerticalAnchor.None &&\n this._topEdgeAnchor !== VerticalAnchor.None\n ) {\n const height = bottom - top;\n this.owner.setY(\n this.owner.getY() === this.owner.getDrawableY()\n ? top\n : top +\n ((this.owner.getY() - this.owner.getDrawableY()) * height) /\n this.owner.getHeight()\n );\n this.owner.setHeight(height);\n } else {\n if (this._topEdgeAnchor !== VerticalAnchor.None) {\n this.owner.setY(\n top + this.owner.getY() - this.owner.getDrawableY()\n );\n }\n if (this._bottomEdgeAnchor !== VerticalAnchor.None) {\n this.owner.setY(\n bottom +\n this.owner.getY() -\n this.owner.getDrawableY() -\n this.owner.getHeight()\n );\n }\n }\n }\n }\n }\n\n doStepPostEvents(instanceContainer: gdjs.RuntimeInstanceContainer) {}\n\n private _convertCoords(\n instanceContainer: gdjs.RuntimeInstanceContainer,\n layer: gdjs.RuntimeLayer,\n x: float,\n y: float,\n result: FloatPoint\n ) {\n const isParentACustomObject =\n instanceContainer !== instanceContainer.getScene();\n if (isParentACustomObject) {\n result[0] = x;\n result[1] = y;\n return result;\n }\n return layer.convertCoords(x, y, 0, result);\n }\n\n private _convertInverseCoords(\n instanceContainer: gdjs.RuntimeInstanceContainer,\n layer: gdjs.RuntimeLayer,\n x: float,\n y: float,\n result: FloatPoint\n ) {\n const isParentACustomObject =\n instanceContainer !== instanceContainer.getScene();\n if (isParentACustomObject) {\n result[0] = x;\n result[1] = y;\n return result;\n }\n return layer.convertInverseCoords(x, y, 0, result);\n }\n }\n gdjs.registerBehavior(\n 'AnchorBehavior::AnchorBehavior',\n gdjs.AnchorRuntimeBehavior\n );\n}\n"],
5
- "mappings": "AAKA,GAAU,MAAV,UAAU,EAAV,CACE,GAAW,GAAX,UAAW,EAAX,CACE,SAAO,GAAP,OACA,+BACA,iCACA,mCACA,qCALS,WAOX,GAAW,GAAX,UAAW,EAAX,CACE,SAAO,GAAP,OACA,6BACA,mCACA,mCACA,qCALS,WAQJ,eAAoC,GAAK,eAAgB,CAa9D,YACE,EACA,EACA,EACA,CACA,MAAM,EAAmB,EAAc,GAZzC,uBAA6B,GAC7B,uBAA4B,EAC5B,wBAA6B,EAC7B,sBAA2B,EAC3B,yBAA8B,EAC9B,qCAA2C,GAQzC,KAAK,8BAAgC,CAAC,CAAC,EAAa,6BACpD,KAAK,gBAAkB,EAAa,eACpC,KAAK,iBAAmB,EAAa,gBACrC,KAAK,eAAiB,EAAa,cACnC,KAAK,kBAAoB,EAAa,iBACtC,KAAK,gCACH,EAAa,iCAAmC,OAC5C,GACA,EAAa,+BAGrB,uBAAuB,EAAiB,EAA0B,CAsBhE,MArBI,GAAgB,iBAAmB,EAAgB,gBACrD,MAAK,gBAAkB,EAAgB,gBAErC,EAAgB,kBAAoB,EAAgB,iBACtD,MAAK,iBAAmB,EAAgB,iBAEtC,EAAgB,gBAAkB,EA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AK,MAAM,eACX,KAAK,MAAM,YAKnB,GACE,KAAK,oBAAsB,GAC3B,KAAK,iBAAmB,EACxB,CACA,KAAM,GAAS,EAAS,EACxB,KAAK,MAAM,KACT,KAAK,MAAM,SAAW,KAAK,MAAM,eAC7B,EACA,EACI,MAAK,MAAM,OAAS,KAAK,MAAM,gBAAkB,EACjD,KAAK,MAAM,aAErB,KAAK,MAAM,UAAU,OAErB,AAAI,MAAK,iBAAmB,GAC1B,KAAK,MAAM,KACT,EAAM,KAAK,MAAM,OAAS,KAAK,MAAM,gBAGrC,KAAK,oBAAsB,GAC7B,KAAK,MAAM,KACT,EACE,KAAK,MAAM,OACX,KAAK,MAAM,eACX,KAAK,MAAM,eAQzB,iBAAiB,EAAkD,EAE3D,eACN,EACA,EACA,EACA,EACA,EACA,CAGA,MADE,KAAsB,EAAkB,WAExC,GAAO,GAAK,EACZ,EAAO,GAAK,EACL,GAEF,EAAM,cAAc,EAAG,EAAG,EAAG,GAG9B,sBACN,EACA,EACA,EACA,EACA,EACA,CAGA,MADE,KAAsB,EAAkB,WAExC,GAAO,GAAK,EACZ,EAAO,GAAK,EACL,GAEF,EAAM,qBAAqB,EAAG,EAAG,EAAG,IA7VxC,EAAM,wBAgWb,EAAK,iBACH,iCACA,EAAK,yBAlXC",
4
+ "sourcesContent": ["/*\nGDevelop - Anchor Behavior Extension\nCopyright (c) 2013-2016 Florian Rival (Florian.Rival@gmail.com)\n */\n\nnamespace gdjs {\n const enum HorizontalAnchor {\n None = 0,\n WindowLeft,\n WindowRight,\n Proportional,\n WindowCenter,\n }\n const enum VerticalAnchor {\n None = 0,\n WindowTop,\n WindowBottom,\n Proportional,\n WindowCenter,\n }\n\n export class AnchorRuntimeBehavior extends gdjs.RuntimeBehavior {\n _relativeToOriginalWindowSize: any;\n _leftEdgeAnchor: HorizontalAnchor;\n _rightEdgeAnchor: HorizontalAnchor;\n _topEdgeAnchor: any;\n _bottomEdgeAnchor: any;\n _invalidDistances: boolean = true;\n _leftEdgeDistance: number = 0;\n _rightEdgeDistance: number = 0;\n _topEdgeDistance: number = 0;\n _bottomEdgeDistance: number = 0;\n _useLegacyBottomAndRightAnchors: boolean = false;\n\n constructor(\n instanceContainer: gdjs.RuntimeInstanceContainer,\n behaviorData,\n owner: gdjs.RuntimeObject\n ) {\n super(instanceContainer, behaviorData, owner);\n this._relativeToOriginalWindowSize = !!behaviorData.relativeToOriginalWindowSize;\n this._leftEdgeAnchor = behaviorData.leftEdgeAnchor;\n this._rightEdgeAnchor = behaviorData.rightEdgeAnchor;\n this._topEdgeAnchor = behaviorData.topEdgeAnchor;\n this._bottomEdgeAnchor = behaviorData.bottomEdgeAnchor;\n this._useLegacyBottomAndRightAnchors =\n behaviorData.useLegacyBottomAndRightAnchors === undefined\n ? true\n : behaviorData.useLegacyBottomAndRightAnchors;\n }\n\n updateFromBehaviorData(oldBehaviorData, newBehaviorData): boolean {\n if (oldBehaviorData.leftEdgeAnchor !== newBehaviorData.leftEdgeAnchor) {\n this._leftEdgeAnchor = newBehaviorData.leftEdgeAnchor;\n }\n if (oldBehaviorData.rightEdgeAnchor !== newBehaviorData.rightEdgeAnchor) {\n this._rightEdgeAnchor = newBehaviorData.rightEdgeAnchor;\n }\n if (oldBehaviorData.topEdgeAnchor !== newBehaviorData.topEdgeAnchor) {\n this._topEdgeAnchor = newBehaviorData.topEdgeAnchor;\n }\n if (\n oldBehaviorData.bottomEdgeAnchor !== newBehaviorData.bottomEdgeAnchor\n ) {\n this._bottomEdgeAnchor = newBehaviorData.bottomEdgeAnchor;\n }\n if (\n oldBehaviorData.useLegacyTrajectory !==\n newBehaviorData.useLegacyTrajectory\n ) {\n this._useLegacyBottomAndRightAnchors =\n newBehaviorData.useLegacyBottomAndRightAnchors;\n }\n if (\n oldBehaviorData.relativeToOriginalWindowSize !==\n newBehaviorData.relativeToOriginalWindowSize\n ) {\n return false;\n }\n return true;\n }\n\n onActivate() {\n this._invalidDistances = true;\n }\n\n doStepPreEvents(instanceContainer: gdjs.RuntimeInstanceContainer) {\n const workingPoint: FloatPoint = gdjs.staticArray(\n gdjs.AnchorRuntimeBehavior.prototype.doStepPreEvents\n ) as FloatPoint;\n let parentMinX = instanceContainer.getUnrotatedViewportMinX();\n let parentMinY = instanceContainer.getUnrotatedViewportMinY();\n let parentMaxX = instanceContainer.getUnrotatedViewportMaxX();\n let parentMaxY = instanceContainer.getUnrotatedViewportMaxY();\n let parentCenterX = (parentMaxX + parentMinX) / 2;\n let parentCenterY = (parentMaxY + parentMinY) / 2;\n let parentWidth = parentMaxX - parentMinX;\n let parentHeight = parentMaxY - parentMinY;\n const layer = instanceContainer.getLayer(this.owner.getLayer());\n if (this._invalidDistances) {\n if (this._relativeToOriginalWindowSize) {\n parentMinX = instanceContainer.getInitialUnrotatedViewportMinX();\n parentMinY = instanceContainer.getInitialUnrotatedViewportMinY();\n parentMaxX = instanceContainer.getInitialUnrotatedViewportMaxX();\n parentMaxY = instanceContainer.getInitialUnrotatedViewportMaxY();\n parentCenterX = (parentMaxX + parentMinX) / 2;\n parentCenterY = (parentMaxY + parentMinY) / 2;\n parentWidth = parentMaxX - parentMinX;\n parentHeight = parentMaxY - parentMinY;\n }\n\n //Calculate the distances from the window's bounds.\n const topLeftPixel = this._relativeToOriginalWindowSize\n ? [this.owner.getDrawableX(), this.owner.getDrawableY()]\n : this._convertInverseCoords(\n instanceContainer,\n layer,\n this.owner.getDrawableX(),\n this.owner.getDrawableY(),\n workingPoint\n );\n\n // Left edge\n if (this._leftEdgeAnchor === HorizontalAnchor.WindowLeft) {\n this._leftEdgeDistance = topLeftPixel[0] - parentMinX;\n } else if (this._leftEdgeAnchor === HorizontalAnchor.WindowRight) {\n this._leftEdgeDistance = topLeftPixel[0] - parentMaxX;\n } else if (this._leftEdgeAnchor === HorizontalAnchor.Proportional) {\n this._leftEdgeDistance = (topLeftPixel[0] - parentMinX) / parentWidth;\n } else if (this._leftEdgeAnchor === HorizontalAnchor.WindowCenter) {\n this._leftEdgeDistance = topLeftPixel[0] - parentCenterX;\n }\n\n // Top edge\n if (this._topEdgeAnchor === VerticalAnchor.WindowTop) {\n this._topEdgeDistance = topLeftPixel[1] - parentMinY;\n } else if (this._topEdgeAnchor === VerticalAnchor.WindowBottom) {\n this._topEdgeDistance = topLeftPixel[1] - parentMaxY;\n } else if (this._topEdgeAnchor === VerticalAnchor.Proportional) {\n this._topEdgeDistance = (topLeftPixel[1] - parentMinY) / parentHeight;\n } else if (this._topEdgeAnchor === VerticalAnchor.WindowCenter) {\n this._topEdgeDistance = topLeftPixel[1] - parentCenterY;\n }\n\n // It's fine to reuse workingPoint as topLeftPixel is no longer used.\n const bottomRightPixel = this._relativeToOriginalWindowSize\n ? [\n this.owner.getDrawableX() + this.owner.getWidth(),\n this.owner.getDrawableY() + this.owner.getHeight(),\n ]\n : this._convertInverseCoords(\n instanceContainer,\n layer,\n this.owner.getDrawableX() + this.owner.getWidth(),\n this.owner.getDrawableY() + this.owner.getHeight(),\n workingPoint\n );\n\n // Right edge\n if (this._rightEdgeAnchor === HorizontalAnchor.WindowLeft) {\n this._rightEdgeDistance = bottomRightPixel[0] - parentMinX;\n } else if (this._rightEdgeAnchor === HorizontalAnchor.WindowRight) {\n this._rightEdgeDistance = bottomRightPixel[0] - parentMaxX;\n } else if (this._rightEdgeAnchor === HorizontalAnchor.Proportional) {\n this._rightEdgeDistance =\n (bottomRightPixel[0] - parentMinX) / parentWidth;\n } else if (this._rightEdgeAnchor === HorizontalAnchor.WindowCenter) {\n this._rightEdgeDistance = bottomRightPixel[0] - parentCenterX;\n }\n\n // Bottom edge\n if (this._bottomEdgeAnchor === VerticalAnchor.WindowTop) {\n this._bottomEdgeDistance = bottomRightPixel[1] - parentMinY;\n } else if (this._bottomEdgeAnchor === VerticalAnchor.WindowBottom) {\n this._bottomEdgeDistance = bottomRightPixel[1] - parentMaxY;\n } else if (this._bottomEdgeAnchor === VerticalAnchor.Proportional) {\n this._bottomEdgeDistance =\n (bottomRightPixel[1] - parentMinY) / parentHeight;\n } else if (this._bottomEdgeAnchor === VerticalAnchor.WindowCenter) {\n this._bottomEdgeDistance = bottomRightPixel[1] - parentCenterY;\n }\n\n this._invalidDistances = false;\n } else {\n //Move and resize the object if needed\n let leftPixel = 0;\n let topPixel = 0;\n let rightPixel = 0;\n let bottomPixel = 0;\n\n // Left edge\n if (this._leftEdgeAnchor === HorizontalAnchor.WindowLeft) {\n leftPixel = parentMinX + this._leftEdgeDistance;\n } else if (this._leftEdgeAnchor === HorizontalAnchor.WindowRight) {\n leftPixel = parentMaxX + this._leftEdgeDistance;\n } else if (this._leftEdgeAnchor === HorizontalAnchor.Proportional) {\n leftPixel = parentMinX + this._leftEdgeDistance * parentWidth;\n } else if (this._leftEdgeAnchor === HorizontalAnchor.WindowCenter) {\n leftPixel = parentCenterX + this._leftEdgeDistance;\n }\n\n // Top edge\n if (this._topEdgeAnchor === VerticalAnchor.WindowTop) {\n topPixel = parentMinY + this._topEdgeDistance;\n } else if (this._topEdgeAnchor === VerticalAnchor.WindowBottom) {\n topPixel = parentMaxY + this._topEdgeDistance;\n } else if (this._topEdgeAnchor === VerticalAnchor.Proportional) {\n topPixel = parentMinY + this._topEdgeDistance * parentHeight;\n } else if (this._topEdgeAnchor === VerticalAnchor.WindowCenter) {\n topPixel = parentCenterY + this._topEdgeDistance;\n }\n\n // Right edge\n if (this._rightEdgeAnchor === HorizontalAnchor.WindowLeft) {\n rightPixel = parentMinX + this._rightEdgeDistance;\n } else if (this._rightEdgeAnchor === HorizontalAnchor.WindowRight) {\n rightPixel = parentMaxX + this._rightEdgeDistance;\n } else if (this._rightEdgeAnchor === HorizontalAnchor.Proportional) {\n rightPixel = parentMinX + this._rightEdgeDistance * parentWidth;\n } else if (this._rightEdgeAnchor === HorizontalAnchor.WindowCenter) {\n rightPixel = parentCenterX + this._rightEdgeDistance;\n }\n\n // Bottom edge\n if (this._bottomEdgeAnchor === VerticalAnchor.WindowTop) {\n bottomPixel = parentMinY + this._bottomEdgeDistance;\n } else if (this._bottomEdgeAnchor === VerticalAnchor.WindowBottom) {\n bottomPixel = parentMaxY + this._bottomEdgeDistance;\n } else if (this._bottomEdgeAnchor === VerticalAnchor.Proportional) {\n bottomPixel = parentMinY + this._bottomEdgeDistance * parentHeight;\n } else if (this._bottomEdgeAnchor === VerticalAnchor.WindowCenter) {\n bottomPixel = parentCenterY + this._bottomEdgeDistance;\n }\n\n // It's fine to reuse workingPoint as topLeftPixel is no longer used.\n const topLeftCoord = this._convertCoords(\n instanceContainer,\n layer,\n leftPixel,\n topPixel,\n workingPoint\n );\n let left = topLeftCoord[0];\n let top = topLeftCoord[1];\n\n const bottomRightCoord = this._convertCoords(\n instanceContainer,\n layer,\n rightPixel,\n bottomPixel,\n workingPoint\n );\n const right = bottomRightCoord[0];\n const bottom = bottomRightCoord[1];\n\n // Compatibility with GD <= 5.0.133\n if (this._useLegacyBottomAndRightAnchors) {\n //Move and resize the object according to the anchors\n if (this._rightEdgeAnchor !== HorizontalAnchor.None) {\n this.owner.setWidth(right - left);\n }\n if (this._bottomEdgeAnchor !== VerticalAnchor.None) {\n this.owner.setHeight(bottom - top);\n }\n if (this._leftEdgeAnchor !== HorizontalAnchor.None) {\n this.owner.setX(\n left + this.owner.getX() - this.owner.getDrawableX()\n );\n }\n if (this._topEdgeAnchor !== VerticalAnchor.None) {\n this.owner.setY(\n top + this.owner.getY() - this.owner.getDrawableY()\n );\n }\n }\n // End of compatibility code\n else {\n // Resize if right and left anchors are set\n if (\n this._rightEdgeAnchor !== HorizontalAnchor.None &&\n this._leftEdgeAnchor !== HorizontalAnchor.None\n ) {\n const width = right - left;\n this.owner.setX(\n this.owner.getX() === this.owner.getDrawableX()\n ? left\n : // It uses the position of the origin relatively to the object\n // size to apply it with the new size.\n // This is the same as doing:\n // lerp(left, right, (this.owner.getX() - this.owner.getDrawableX() / this.owner.getWidth())\n // But, the division is done at the end to avoid rounding errors.\n left +\n ((this.owner.getX() - this.owner.getDrawableX()) * width) /\n this.owner.getWidth()\n );\n this.owner.setWidth(width);\n } else {\n if (this._leftEdgeAnchor !== HorizontalAnchor.None) {\n this.owner.setX(\n left + this.owner.getX() - this.owner.getDrawableX()\n );\n }\n if (this._rightEdgeAnchor !== HorizontalAnchor.None) {\n this.owner.setX(\n right +\n this.owner.getX() -\n this.owner.getDrawableX() -\n this.owner.getWidth()\n );\n }\n }\n // Resize if top and bottom anchors are set\n if (\n this._bottomEdgeAnchor !== VerticalAnchor.None &&\n this._topEdgeAnchor !== VerticalAnchor.None\n ) {\n const height = bottom - top;\n this.owner.setY(\n this.owner.getY() === this.owner.getDrawableY()\n ? top\n : top +\n ((this.owner.getY() - this.owner.getDrawableY()) * height) /\n this.owner.getHeight()\n );\n this.owner.setHeight(height);\n } else {\n if (this._topEdgeAnchor !== VerticalAnchor.None) {\n this.owner.setY(\n top + this.owner.getY() - this.owner.getDrawableY()\n );\n }\n if (this._bottomEdgeAnchor !== VerticalAnchor.None) {\n this.owner.setY(\n bottom +\n this.owner.getY() -\n this.owner.getDrawableY() -\n this.owner.getHeight()\n );\n }\n }\n }\n }\n }\n\n doStepPostEvents(instanceContainer: gdjs.RuntimeInstanceContainer) {}\n\n private _convertCoords(\n instanceContainer: gdjs.RuntimeInstanceContainer,\n layer: gdjs.RuntimeLayer,\n x: float,\n y: float,\n result: FloatPoint\n ) {\n const isParentACustomObject =\n instanceContainer !== instanceContainer.getScene();\n if (isParentACustomObject) {\n result[0] = x;\n result[1] = y;\n return result;\n }\n return layer.convertCoords(x, y, 0, result);\n }\n\n private _convertInverseCoords(\n instanceContainer: gdjs.RuntimeInstanceContainer,\n layer: gdjs.RuntimeLayer,\n x: float,\n y: float,\n result: FloatPoint\n ) {\n const isParentACustomObject =\n instanceContainer !== instanceContainer.getScene();\n if (isParentACustomObject) {\n result[0] = x;\n result[1] = y;\n return result;\n }\n return layer.convertInverseCoords(x, y, 0, result);\n }\n }\n gdjs.registerBehavior(\n 'AnchorBehavior::AnchorBehavior',\n gdjs.AnchorRuntimeBehavior\n );\n}\n"],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AAS,KAAK,MAAM,gBAGrC,KAAK,oBAAsB,GAC7B,KAAK,MAAM,KACT,EACE,KAAK,MAAM,OACX,KAAK,MAAM,eACX,KAAK,MAAM,eAQzB,iBAAiB,EAAkD,EAE3D,eACN,EACA,EACA,EACA,EACA,EACA,CAGA,MADE,KAAsB,EAAkB,WAExC,GAAO,GAAK,EACZ,EAAO,GAAK,EACL,GAEF,EAAM,cAAc,EAAG,EAAG,EAAG,GAG9B,sBACN,EACA,EACA,EACA,EACA,EACA,CAGA,MADE,KAAsB,EAAkB,WAExC,GAAO,GAAK,EACZ,EAAO,GAAK,EACL,GAEF,EAAM,qBAAqB,EAAG,EAAG,EAAG,IApWxC,EAAM,wBAuWb,EAAK,iBACH,iCACA,EAAK,yBAzXC",
6
6
  "names": []
7
7
  }
@@ -695,7 +695,7 @@ module.exports = {
695
695
  .addCondition(
696
696
  'IsDynamic',
697
697
  _('Is dynamic'),
698
- _('Test if an object is dynamic.'),
698
+ _('Check if an object is dynamic.'),
699
699
  _('_PARAM0_ is dynamic'),
700
700
  _('Dynamics'),
701
701
  'res/physics32.png',
@@ -727,7 +727,7 @@ module.exports = {
727
727
  .addCondition(
728
728
  'IsStatic',
729
729
  _('Is static'),
730
- _('Test if an object is static.'),
730
+ _('Check if an object is static.'),
731
731
  _('_PARAM0_ is static'),
732
732
  _('Dynamics'),
733
733
  'res/physics32.png',
@@ -759,7 +759,7 @@ module.exports = {
759
759
  .addCondition(
760
760
  'IsKinematic',
761
761
  _('Is kinematic'),
762
- _('Test if an object is kinematic.'),
762
+ _('Check if an object is kinematic.'),
763
763
  _('_PARAM0_ is kinematic'),
764
764
  _('Dynamics'),
765
765
  'res/physics32.png',
@@ -790,9 +790,9 @@ module.exports = {
790
790
  aut
791
791
  .addCondition(
792
792
  'IsBullet',
793
- _('Is treat as bullet'),
794
- _('Test if an object is being treat as a bullet.'),
795
- _('_PARAM0_ is bullet'),
793
+ _('Is treated as a bullet'),
794
+ _('Check if the object is being treated as a bullet.'),
795
+ _('_PARAM0_ is treated as a bullet'),
796
796
  _('Dynamics'),
797
797
  'res/physics32.png',
798
798
  'res/physics32.png'
@@ -825,7 +825,7 @@ module.exports = {
825
825
  .addCondition(
826
826
  'HasFixedRotation',
827
827
  _('Has fixed rotation'),
828
- _('Test if an object has fixed rotation.'),
828
+ _('Check if an object has fixed rotation.'),
829
829
  _('_PARAM0_ has fixed rotation'),
830
830
  _('Dynamics'),
831
831
  'res/physics32.png',
@@ -859,7 +859,7 @@ module.exports = {
859
859
  .addCondition(
860
860
  'IsSleepingAllowed',
861
861
  _('Is sleeping allowed'),
862
- _('Test if an object can sleep.'),
862
+ _('Check if an object can sleep.'),
863
863
  _('_PARAM0_ can sleep'),
864
864
  _('Dynamics'),
865
865
  'res/physics32.png',
@@ -898,7 +898,7 @@ module.exports = {
898
898
  .addCondition(
899
899
  'IsSleeping',
900
900
  _('Is sleeping'),
901
- _('Test if an object is sleeping.'),
901
+ _('Check if an object is sleeping.'),
902
902
  _('_PARAM0_ is sleeping'),
903
903
  _('Dynamics'),
904
904
  'res/physics32.png',
@@ -1267,7 +1267,7 @@ module.exports = {
1267
1267
  .addCondition(
1268
1268
  'LayerEnabled',
1269
1269
  _('Layer enabled'),
1270
- _('Test if an object has a specific layer enabled.'),
1270
+ _('Check if an object has a specific layer enabled.'),
1271
1271
  _('_PARAM0_ has layer _PARAM2_ enabled'),
1272
1272
  _('Filtering'),
1273
1273
  'res/physics32.png',
@@ -1303,7 +1303,7 @@ module.exports = {
1303
1303
  .addCondition(
1304
1304
  'MaskEnabled',
1305
1305
  _('Mask enabled'),
1306
- _('Test if an object has a specific mask enabled.'),
1306
+ _('Check if an object has a specific mask enabled.'),
1307
1307
  _('_PARAM0_ has mask _PARAM2_ enabled'),
1308
1308
  _('Filtering'),
1309
1309
  'res/physics32.png',
@@ -1897,7 +1897,7 @@ module.exports = {
1897
1897
  .addCondition(
1898
1898
  'JointFirstObject',
1899
1899
  _('Joint first object'),
1900
- _('Test if an object is the first object on a joint.'),
1900
+ _('Check if an object is the first object on a joint.'),
1901
1901
  _('_PARAM0_ is the first object for joint _PARAM2_'),
1902
1902
  _('Joints'),
1903
1903
  'res/physics32.png',
@@ -1913,7 +1913,7 @@ module.exports = {
1913
1913
  .addCondition(
1914
1914
  'JointSecondObject',
1915
1915
  _('Joint second object'),
1916
- _('Test if an object is the second object on a joint.'),
1916
+ _('Check if an object is the second object on a joint.'),
1917
1917
  _('_PARAM0_ is the second object for joint _PARAM2_'),
1918
1918
  _('Joints'),
1919
1919
  'res/physics32.png',
@@ -2382,7 +2382,7 @@ module.exports = {
2382
2382
  .addCondition(
2383
2383
  'RevoluteJointLimitsEnabled',
2384
2384
  _('Revolute joint limits enabled'),
2385
- _('Test if a revolute joint limits are enabled.'),
2385
+ _('Check if a revolute joint limits are enabled.'),
2386
2386
  _('Limits for revolute joint _PARAM2_ are enabled'),
2387
2387
  _('Joints/Revolute'),
2388
2388
  'JsPlatform/Extensions/revolute_joint24.png',
@@ -2461,7 +2461,7 @@ module.exports = {
2461
2461
  .addCondition(
2462
2462
  'RevoluteJointMotorEnabled',
2463
2463
  _('Revolute joint motor enabled'),
2464
- _('Test if a revolute joint motor is enabled.'),
2464
+ _('Check if a revolute joint motor is enabled.'),
2465
2465
  _('Motor of revolute joint _PARAM2_ is enabled'),
2466
2466
  _('Joints/Revolute'),
2467
2467
  'JsPlatform/Extensions/revolute_joint24.png',
@@ -2700,7 +2700,7 @@ module.exports = {
2700
2700
  .addCondition(
2701
2701
  'PrismaticJointLimitsEnabled',
2702
2702
  _('Prismatic joint limits enabled'),
2703
- _('Test if a prismatic joint limits are enabled.'),
2703
+ _('Check if a prismatic joint limits are enabled.'),
2704
2704
  _('Limits for prismatic joint _PARAM2_ are enabled'),
2705
2705
  _('Joints/Prismatic'),
2706
2706
  'JsPlatform/Extensions/prismatic_joint24.png',
@@ -2779,7 +2779,7 @@ module.exports = {
2779
2779
  .addCondition(
2780
2780
  'PrismaticJointMotorEnabled',
2781
2781
  _('Prismatic joint motor enabled'),
2782
- _('Test if a prismatic joint motor is enabled.'),
2782
+ _('Check if a prismatic joint motor is enabled.'),
2783
2783
  _('Motor for prismatic joint _PARAM2_ is enabled'),
2784
2784
  _('Joints/Prismatic'),
2785
2785
  'JsPlatform/Extensions/prismatic_joint24.png',
@@ -3459,7 +3459,7 @@ module.exports = {
3459
3459
  .addCondition(
3460
3460
  'WheelJointMotorEnabled',
3461
3461
  _('Wheel joint motor enabled'),
3462
- _('Test if a wheel joint motor is enabled.'),
3462
+ _('Check if a wheel joint motor is enabled.'),
3463
3463
  _('Motor for wheel joint _PARAM2_ is enabled'),
3464
3464
  _('Joints/Wheel'),
3465
3465
  'JsPlatform/Extensions/wheel_joint24.png',
@@ -4203,7 +4203,7 @@ module.exports = {
4203
4203
  .getCodeExtraInformation()
4204
4204
  .addIncludeFile('Extensions/Physics2Behavior/physics2tools.js')
4205
4205
  .addIncludeFile('Extensions/Physics2Behavior/physics2runtimebehavior.js')
4206
- .setFunctionName('gdjs.physics2.objectsCollide');
4206
+ .setFunctionName('gdjs.physics2.areObjectsColliding');
4207
4207
 
4208
4208
  extension
4209
4209
  .addCondition(