CatWithTheNameOfADog
CatWithTheNameOfADog

Reputation: 29

Spritefont Files not Loading Monogame Xamarin

I have been struggling to get spritefonts to work in a game i'm porting from Android to IOS in monogame. everything is exactly the same, except the spritefonts do not seem to be copying over to the debugging device. everything else in the game seems to be working just fine besides the font issue. does anyone have any idea how to get these files to copy over? i've tried just about everything from the pipeline to the configuration in Xamarin. here are screenshots of the error: https://i.sstatic.net/h8wYo.png https://i.sstatic.net/HWBSv.png

Upvotes: 1

Views: 258

Answers (2)

CatWithTheNameOfADog
CatWithTheNameOfADog

Reputation: 29

I figured out the problem. due to how the pipeline is different on IOS monogame i had to make a couple changes.

you need to:

1 compile your spritefont into a .xnb

2 set build action to Content

3 make sure it copies to output directory (copy if newer/always copy)

i hope this helps, it took me way to long to figure this out.

Upvotes: 0

Victor Chelaru
Victor Chelaru

Reputation: 4837

Are you able to load other content (such as textures)? You want to make sure that your content is using the correct build action for the platform, and that your Android project has all content under the Assets/content folder.

This page discusses how to add assets to your game. It uses .pngs, but it's the same for adding XNBs as well:

http://developer.xamarin.com/guides/cross-platform/game_development/monogame/introduction/part2/

Upvotes: 1

Related Questions