Skip to content

Commit 304d149

Browse files
committed
feat(doc): text examples
1 parent 292a746 commit 304d149

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

playground/graphics/graphics-text.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ graphicEntityModule.createText("Hello World")
1414
.setFontSize(50)
1515
.setFillColor(0x000000); // Setting the text color to black
1616
```
17+
![Example](resources/text-1.png)
18+
1719
The only font family values that will work are:
1820
"Lato" and those that are available by default on all browsers.
1921
If the browser does not recognise the font family, it will be displayed in a fallback font chosen by the browser.
@@ -25,11 +27,12 @@ This class is used to display text using a bitmap font in your assets folder.
2527
```java
2628
graphicEntityModule.createBitmapText()
2729
.setText("Hello World")
28-
.setFontFamily("myCustomFont")
30+
.setFont("myCustomFont")
2931
// Assuming that you have a working 'myCustomFont.fnt' and 'myCustomFont.png' in your assets folder
3032
.setFontSize(50)
3133
.setTint(0xff0000); // Tinting it in red
3234
```
35+
![Example](resources/text-2.png)
3336

3437
Extra tips :
3538
- A little help to turn fonts into bitmap fonts : http://kvazars.com/littera/
2.92 KB
Loading
4.51 KB
Loading

0 commit comments

Comments
 (0)