From 90b08e23f4de334add1a25ac42abbe7f03d0fd8e Mon Sep 17 00:00:00 2001 From: goynov Date: Wed, 26 Nov 2025 17:49:08 +0200 Subject: [PATCH] refactoring --- src/components/InteractiveObjects/TextObject.js | 4 ++-- src/mixins/GameEnvironmentMixin.js | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/InteractiveObjects/TextObject.js b/src/components/InteractiveObjects/TextObject.js index d6749fe..838bb5f 100644 --- a/src/components/InteractiveObjects/TextObject.js +++ b/src/components/InteractiveObjects/TextObject.js @@ -12,8 +12,8 @@ class TextObject { txt.maxWidth = obj.width; txt.textAlign = 'center'; txt.font = obj.fontPath; - txt.anchorX = 'center'; - txt.anchorY = 'bottom'; + txt.anchorX = obj.anchorX || 'center'; + txt.anchorY = obj.anchorY || 'bottom'; txt.curveRadius = 0; txt.outlineColor = 0xffffff; txt.outlineWidth = '15%'; diff --git a/src/mixins/GameEnvironmentMixin.js b/src/mixins/GameEnvironmentMixin.js index e978ee7..41306a8 100644 --- a/src/mixins/GameEnvironmentMixin.js +++ b/src/mixins/GameEnvironmentMixin.js @@ -168,8 +168,7 @@ export default { gameEngine.activeObjects.add(io.object); if (this.env != 'GameDesigner'){ if (i.data.$go?.type == 'player3d'){ - let hero = new Hero(io, i.data.$go); - hero.init(gameEngine); + let hero = new Hero(gameEngine, io, i.data.$go); }else{ if (io.source?.animations?.length){ gameEngine.playAnimation(gameEngine.scene, io.source.animations[0]);