0
\$\begingroup\$

There is a way to load a sprite-font without using the Monogame Pipeline tool?

I am creating a Game-Engine using Monogame, i cant use the Monogame Pipeline tool because the way that Game-Engine manage the Content Files is different, and it needs to read the source file, not the .xnb file that Monogame Pipeline tool create.

\$\endgroup\$
0
\$\begingroup\$

No, the SpriteFont content type starts as instructions to the content pipeline to convert a specific font at a specific size (in pt) into a set of textures for every UTF-8 character. Since a .SpriteFont doesn't contain any textures, it has to be compiled by the content pipeline to be imported in MonoGame as a SpriteFont.

\$\endgroup\$
  • \$\begingroup\$ Well, but there is an way for compiling the .spritefont files to .xnb using a executable separated?, like when i want to compile something, i just call <name_of_the_executable> $file_to_compile$ $output$? \$\endgroup\$ – ParallexSoftware Dec 15 '19 at 17:35
  • \$\begingroup\$ If you're gonna go through that trouble, you're better off using the MGCB, because it it will compile the content and copy it to your output folder for you on each build. It's a lot less troublesome that way. \$\endgroup\$ – fdrobidoux Dec 16 '19 at 14:05
  • \$\begingroup\$ well, i need to not use the MGCB because i am creating a complete GameEngine. \$\endgroup\$ – ParallexSoftware Dec 16 '19 at 16:12
  • \$\begingroup\$ Then you'll need to learn by yourself how to create texture data from the multiple font formats available which all vary sgnificantly. Here's my advice: Focus on making a game, not an engine. MonoGame is a great base for your game, and you'll be better off taking what's included and work with it. If MGCB is what grinds your gears the most, I suggest you give NoPipeline a try. But from what I gather, you're biting off more than you can chew. \$\endgroup\$ – fdrobidoux Dec 16 '19 at 17:41
  • \$\begingroup\$ The problem is: i am actualy creating a Game Engine not a Game \$\endgroup\$ – ParallexSoftware Jan 5 at 19:17
0
\$\begingroup\$

As it turns out, there is a way to load a SpriteFont without the need of MGCB, and to make it better.

You'll need to use SpriteFontPlus. It generates SpriteFont objects dynamically from normal image files.

\$\endgroup\$
  • \$\begingroup\$ i will try that latter \$\endgroup\$ – ParallexSoftware Jan 23 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.