Skip to content

Commit 47e9bf4

Browse files
committed
fix(playground): adding the tuto
1 parent 05d53f7 commit 47e9bf4

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

playground/extensions/extensions-4-endscreen.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,24 @@ To guarantee the correct ranking, you must set this module's score property in y
3333
```java
3434
@Override
3535
public void onEnd() {
36-
endScreenModule.setScores(gameManager.getPlayers().stream().mapToInt(p -> p.getScore()).toArray());
36+
endScreenModule.setScores(gameManager.getPlayers().stream().mapToInt(p -> p.getScore()).toArray());
3737
}
3838
```
3939

4040
The module loads by default your `logo.png` as title, you can set your own image with `setTitleRankingsSprite()`.
4141
```java
4242
endScreenModule.setTitleRankingsSprite("myCustomSprite.png");
4343
```
44+
45+
You can also display a custom text instead of the score.
46+
47+
`Referee.java`
48+
```java
49+
@Override
50+
public void onEnd() {
51+
int[] scores = { player1.getScore(), player2.getScore() };
52+
String[] text = { scores[0] + " mana", scores[1] + " mana" };
53+
54+
endScreenModule.setScores(scores, text);
55+
}
56+
```

0 commit comments

Comments
 (0)