Skip to content

Commit efe82b2

Browse files
authored
Create Draw_Text_String_Custom_Font_File_With_SFML_Library.md
1 parent 95a94ad commit efe82b2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Draw Text String Custom Font File With SFML Library
2+
i just code with ttf file.
3+
4+
```c++
5+
sf::Font font_stratum;
6+
font_stratum.loadFromFile("C:/Users/Amiral/source/repos/CsGoSFML/Debug/fonts/stratum2bold.ttf");
7+
8+
sf::Color color_yellow_nople = sf::Color::Color(255, 255, 0, 220);
9+
sf::Color color_black_alpha = sf::Color::Color(0, 0, 0, 150);
10+
11+
sf::Text text_player_name;
12+
text_player_name.setFont(font_stratum);
13+
text_player_name.setCharacterSize(14);
14+
text_player_name.setColor(color_yellow_nople);
15+
text_player_name.setOutlineColor(color_black_alpha);
16+
text_player_name.setOutlineThickness(1);
17+
18+
window.draw(text_player_name);
19+
```

0 commit comments

Comments
 (0)