June 2007
Intermediate to advanced
288 pages
8h 47m
English
The Text class is based on the UIElement class, but adds properties and methods to manage the text that it is to display. We have already seen the Text element in our examples; now it is time to examine how it works a little more closely.
The Text element uses a Font to render the text. The font resource is exactly the same as that used to render text using the Bitmap class. These are loaded and assigned to a particular text element. You can use different fonts for different text elements, depending on your requirements.
Text text = new Text(); Font ninaB = Resources.GetFont(Resources.FontResources.NinaB); text.Font = ninaB;
You can also select the alignment and wrapping behavior of the text.
text.TextWrap = true; text.TextAlignment ...
Read now
Unlock full access