Skip to content

Commit d39d853

Browse files
authored
Update README.md
1 parent f9c3f72 commit d39d853

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,22 @@ SpriteFont font = fontBakeResult.CreateSpriteFont(GraphicsDevice);
3232

3333
# Loading SpriteFont from AngelCode BMFont
3434
```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))
3745
{
38-
texture = Texture2D.FromStream(GraphicsDevice, stream);
46+
fontData = reader.ReadToEnd();
3947
}
48+
}
4049

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);
5151
```
5252

5353
Full sample is here:

0 commit comments

Comments
 (0)