FontTextureProcessor.GetCharacterForIndex Method

Maps a glyph index to a character.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Syntax

protected virtual char GetCharacterForIndex (
         int index
)

Parameters

  • index
    The glyph index. This is a zero-based index that corresponds to the position of the glyph in the original character. This value begins at the upper-left corner of the texture and increases when moving to the right and down.

Return Value

The character represented by the specified glyph index.

Remarks

This method is designed to be overridden by a subclass of this processor. For example, if the original texture contains the characters A, B, and C, in that order, this method should return "A" when passed 0, "B" when passed 1, and "C" when passed 2. Subclasses of this processor may override this method to control which characters a bitmap font represents.

If not overridden, the default implementation of this function assumes a Unicode order of character code points starting at code point 32—the space character. In other words, it assumes that a character index of zero corresponds to a space character, a character index of 1 corresponds to an exclamation point ("!"), and so on.

See Also

Reference

FontTextureProcessor Class
FontTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Platforms

Windows XP SP2, Windows Vista