Loading SpriteFont through a different class than Game.cs
Posted
by
MintyAnt
on Game Development
See other posts from Game Development
or by MintyAnt
Published on 2012-03-21T04:13:36Z
Indexed on
2012/03/21
5:40 UTC
Read the original article
Hit count: 499
I am trying to load up a single SpriteFont to print some debug information. In our current game, we load up both Textures and Music through a ResourceManager. They are both loaded with a filestream, and thus do not require Content.Load
SoundEffect soundEffect = SoundEffect.FromStream( fs );
Since this ResourceManager does not inherit from Game or is like Game.cs, I cannot use the usual method:
SpriteFont spriteFont = Content.Load<SpriteFont>(resource.Key.Item2);
Anyone have any idea how I can either: -Load the SpriteFont a different way -Create my own Contentmanager
© Game Development or respective owner