Skip to content

Commit

Permalink
Merge pull request #22 from ByteMyDust/post-mortem
Browse files Browse the repository at this point in the history
🐛 fix: hint text not appearing on screen
  • Loading branch information
Nandan-18 authored Sep 25, 2023
2 parents b5d46cc + 71a7cc1 commit 3c5700f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/scenes/game.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/scenes/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export default class Game extends Phaser.Scene {
// Create the text to display inside the hint box
const randomnum = this.getRandomNum(1, 50);
const message = gameTipsMap.get(Math.floor(randomnum));
console.log(message);

// Calculate text position to center it within the hint box
const textX = textBoxX + textBoxWidth / 2;
Expand All @@ -162,6 +163,7 @@ export default class Game extends Phaser.Scene {
text = this.add.text(textX, textY, message!, {
fontFamily: 'Arial',
fontSize: '32px',
color: '#000000',
backgroundColor: '#ffffff', // White text color
wordWrap: { width: textBoxWidth - 40 }, // Wrap text within the hint box with some padding
align: 'center', // Center-align the text
Expand Down

0 comments on commit 3c5700f

Please sign in to comment.