Question

Existe-t-il un moyen d'utiliser des polices personnalisées dans XNA?

Était-ce utile?

La solution

Bien sûr, vous devez importer la police dans votre système. Ajoutez la police au catalogue du système de police ou ajoutez via le panneau de configuration. Lorsqu'il est prêt (redémarrer Visual Studio), utilisez le modèle personnalisé pour SpriteFont dans Visual Studio, qui génère un fichier XML. Un exmaple:

<?xml version="1.0" encoding="utf-8"?>
<!--
This file contains an xml description of a font, and will be read by the XNA
Framework Content Pipeline. Follow the comments to customize the appearance
of the font in your game, and to change the characters which are available to draw
with.
-->
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
  <Asset Type="Graphics:FontDescription">

    <!--
    Modify this string to change the font that will be imported.
    -->
    <FontName>Moire</FontName>
...
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top