Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
rds1983 authored Jan 16, 2022
1 parent 1e38488 commit 2da82b8
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ Full sample is here:

# Loading SpriteFont from AngelCode BMFont
```c#
Texture2D texture;
using (var stream = TitleContainer.OpenStream("Fonts/test_0.png"))
{
texture = Texture2D.FromStream(GraphicsDevice, stream);
}

string fontData;
using (var stream = TitleContainer.OpenStream("Fonts/test.fnt"))
{
Expand All @@ -64,7 +58,7 @@ using (var stream = TitleContainer.OpenStream("Fonts/test.fnt"))
}

// As we use font with one texture, always return it independently from requested name
SpriteFont font = BMFontLoader.Load(fontData, name => texture, GraphicsDevice);
SpriteFont font = BMFontLoader.Load(fontData, name => TitleContainer.OpenStream("Fonts/" + name), GraphicsDevice);
```

Full sample is here:
Expand Down

0 comments on commit 2da82b8

Please sign in to comment.