Hi,
i try to load Font from my own Bitmapfont,in XNA its works just fine,but in mono game i do something wrong?
The .spritefont files are loaded correctly.(And effects,pictures as well)
But my BitmapFont.png are not loaded. Only getting errors.
Like:
Invalid Cast Exception
From “Microsoft.Xna.Framework.Graphics.Texture2D” to “Microsoft.Xna.Framework.Graphics.SpriteFont”.
Did i miss some settings? I just dont know…
Or i have to to it on my own?Would be a mess for older Projects,that used that feature ;/
Anyways this Framework Project is awesome,keep it up =D
Can you show the loading code that is failing? It sounds like you are trying to load a png instead of a .spritefont content file.
Okay, i think it needs, some more information…
I want to load this
to get this result
Same Code in Monogame doesnt work. I get the error message…
Strange,strange just strange… —>>rebuild soloution to the rescue…<<----
Okay, now its working… i changed the Content Processor once again to “MonoGame SpriteFont from Texture”.
And did a rebuild… and now it works.
This happend as i am writing this… let this here for other people, thanks for the attention
1111
4
Just curious how the heck you load font from png ?
just test it yourself there no more code involved it is a awesome feature of the framework,
i started with this blog entry http://blogs.msdn.com/b/shawnhar/archive/2007/04/26/bitmap-fonts-in-xna.aspx
Just take a look at the screenshot, and take my font pic as a test .