Skip to content

Commit 1fcf9bf

Browse files
committed
add some font
1 parent 70a5905 commit 1fcf9bf

File tree

4 files changed

+28
-12
lines changed

4 files changed

+28
-12
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,10 @@ The game currently uses generated placeholder assets. To add your own custom ass
1818
## License
1919

2020
[MIT](LICENSE)
21+
22+
## Credits
23+
24+
Monogram is a free and Creative Commons Zero pixel font,
25+
made by Vinícius Menézio (@vmenezio).
26+
27+
https://datagoblin.itch.io/monogram

public/monogram.ttf

10.2 KB
Binary file not shown.

src/App.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ footer {
113113
}
114114
}
115115

116+
@font-face {
117+
font-family: "Monogram";
118+
src: url("public/monogram.ttf") format("truetype");
119+
}
120+
116121
.orientation-message {
117122
position: fixed;
118123
top: 0;

src/game/scenes/GameOverScene.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,23 @@ export class GameOverScene extends Phaser.Scene {
77

88
create() {
99
const { width, height } = this.cameras.main;
10-
this.add
11-
.text(width / 2, height / 2 - 10, "BUSTED!", {
12-
fontSize: "16px",
13-
color: "#0f380f",
14-
})
15-
.setOrigin(0.5);
10+
document.fonts.load('16px "Monogram"').then(() => {
11+
this.add
12+
.text(width / 2, height / 2 - 10, "BUSTED!", {
13+
fontFamily: "Monogram",
14+
fontSize: "16px",
15+
color: "#0f380f",
16+
})
17+
.setOrigin(0.5);
1618

17-
this.add
18-
.text(width / 2, height / 2 + 10, "Press R to retry", {
19-
fontSize: "8px",
20-
color: "#0f380f",
21-
})
22-
.setOrigin(0.5);
19+
this.add
20+
.text(width / 2, height / 2 + 10, "Press R to retry", {
21+
fontFamily: "Monogram",
22+
fontSize: "16px",
23+
color: "#0f380f",
24+
})
25+
.setOrigin(0.5);
26+
});
2327

2428
this.input.keyboard?.once("keydown-R", () => this.scene.start("GameScene"));
2529
}

0 commit comments

Comments
 (0)