@@ -239044,6 +239044,7 @@ Config.INPUT_FIELD_Y = 400;
239044239044Config.INPUT_FIELD_FONT_SIZE = "42px";
239045239045Config.INPUT_FIELD_FONT_COLOR = (0, _colorKeysDefault.default).WHITE;
239046239046Config.INPUT_FIELD_FONT_COLOR_INCORRECT = (0, _colorKeysDefault.default).RED_MILD;
239047+ // 🗨️ Speech Bubble
239047239048Config.SPEECH_BUBBLE_HEIGHT = 70;
239048239049// 🎲 Game
239049239050Config.AI_PROMPT_VALIDATE_ANSWER = "Du bist ein Spielleiter einer Partie Stadt Land Fluss. Die Kategorie lautet: {{category}}. Der Spieler hat die Antwort {{answer}} gegeben. Ist die Antwort korrekt? Antworte mit ja oder nein.";
@@ -239673,7 +239674,7 @@ class GameMasterFace {
239673239674 fontSize: "32px",
239674239675 color: (0, _colorKeysDefault.default).BLACK
239675239676 }).setOrigin(0, 0);
239676- this.message.setWordWrapWidth(this.mainScene.sys.canvas.width - (0, _configDefault.default).GAME_MASTER_MESSAGE_X, true);
239677+ this.message.setWordWrapWidth(this.mainScene.sys.canvas.width - (0, _configDefault.default).GAME_MASTER_MESSAGE_X - 50 , true);
239677239678 // Set the alpha to 0 of message and speech bubble so it is invisible at the beginning
239678239679 this.message.setAlpha(0);
239679239680 this.speechBubble.setAlpha(0);
@@ -239730,8 +239731,11 @@ class GameMasterFace {
239730239731 });
239731239732 }
239732239733 _redrawSpeechBubble(graphicsObject, message, color, offsetX, offsetY) {
239733- const speechBubbleMinWidth = 50; // Minimum width of the speech bubble
239734- const speechBubbleWidth = speechBubbleMinWidth + message.text.length * 19; // 19px per character is a good amount
239734+ const speechBubbleMinWidth = 50;
239735+ const pixelPerCharacter = 19; // 19px per character is a good amount
239736+ const speechBubbleMaxWidth = this.mainScene.sys.canvas.width - 200;
239737+ const speechBubbleExtraWidth = message.text.length * pixelPerCharacter < speechBubbleMaxWidth ? message.text.length * pixelPerCharacter : speechBubbleMaxWidth;
239738+ const speechBubbleWidth = speechBubbleMinWidth + speechBubbleExtraWidth;
239735239739 const speechBubbleExtraHeight = message.height > 50 ? message.height : 0;
239736239740 graphicsObject.clear();
239737239741 graphicsObject.fillStyle(color, 1);
0 commit comments