Release of xNa 1.0 refresh & spritefont

Source: Internet
Author: User

 

At last, Ms released the long-awaited xna1.0 upgrade package on the 24 th. You can click here to download. On the basis of ensuring compatibility with the original version, this package has improved the class library, including fonts, sound effects, and other aspects.

This section mainly describes how to draw a font. In this version, the font Drawing operation can be greatly simplified. You can use any font installed in the system to display text. According to the methods described in the SDK, content papeline will compile the font you specified into one during compilation. when using the xNb file, you only need to create one spritefont class and then load the file, just as simple as loading the texture. Then, you can use the new method drawstring of spritebatch to display text.
It must be noted that the methods described in the SDK are created in the project. in the spiritfont file, the data between the <fontname> tags is the font name you want to use, such as the common "Times New Roman" and "". Of course, make sure that these fonts are installed in your system. The <Start> marker is the starting character or the number of the actual character, and the <End> marker is the ending character. For example:

<Start> & amp; #32; </start>
<End> & #126; </end>

In Unicode, all characters from 32nd to 126 are generated, that is, English ~ Z, a common symbol, and

<Start> 1 </start>
<End> You </end>

All characters between "1" and "you" are generated. Note: When drawstring is used to display text, the displayed characters must be in the range you specified; otherwise, an exception is thrown. In addition, because there are many Chinese characters, content pipleline takes a lot of time to process these characters, so the first buildProgramIt may be very, very, very slow .....

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.