File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -32,22 +32,22 @@ SpriteFont font = fontBakeResult.CreateSpriteFont(GraphicsDevice);
32
32
33
33
# Loading SpriteFont from AngelCode BMFont
34
34
``` c#
35
- Texture2D texture ;
36
- using (var stream = TitleContainer .OpenStream (" Fonts/test_0.png" ))
35
+ Texture2D texture ;
36
+ using (var stream = TitleContainer .OpenStream (" Fonts/test_0.png" ))
37
+ {
38
+ texture = Texture2D .FromStream (GraphicsDevice , stream );
39
+ }
40
+
41
+ string fontData ;
42
+ using (var stream = TitleContainer .OpenStream (" Fonts/test.fnt" ))
43
+ {
44
+ using (var reader = new StreamReader (stream ))
37
45
{
38
- texture = Texture2D . FromStream ( GraphicsDevice , stream );
46
+ fontData = reader . ReadToEnd ( );
39
47
}
48
+ }
40
49
41
- string fontData ;
42
- using (var stream = TitleContainer .OpenStream (" Fonts/test.fnt" ))
43
- {
44
- using (var reader = new StreamReader (stream ))
45
- {
46
- fontData = reader .ReadToEnd ();
47
- }
48
- }
49
-
50
- _font = BMFontLoader .LoadXml (fontData , texture );
50
+ _font = BMFontLoader .LoadXml (fontData , texture );
51
51
```
52
52
53
53
Full sample is here:
You can’t perform that action at this time.
0 commit comments