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\$

2 Answers 2

1
\$\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\$
1
  • \$\begingroup\$ i will try that latter \$\endgroup\$
    – Aragubas
    Commented Jan 23, 2020 at 11:57
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\$
6
  • \$\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\$
    – Aragubas
    Commented Dec 15, 2019 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
    Commented Dec 16, 2019 at 14:05
  • \$\begingroup\$ well, i need to not use the MGCB because i am creating a complete GameEngine. \$\endgroup\$
    – Aragubas
    Commented Dec 16, 2019 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
    Commented Dec 16, 2019 at 17:41
  • \$\begingroup\$ The problem is: i am actualy creating a Game Engine not a Game \$\endgroup\$
    – Aragubas
    Commented Jan 5, 2020 at 19:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .