Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// <summary>
- /// Returns the position of any given character in m_Text.
- /// </summary>
- /// <param name="CharacterIndex">The index of the character.</param>
- /// <returns>THe position of the character indexed by <paramref name="CharacterIndex"/></returns>
- private Vector2 CharacterPosition(int CharacterIndex)
- {
- float SquareWidth = m_Font.MeasureString(GetLine(1)).X;
- float SquareHeight = m_Font.MeasureString(GetLine(1)).Y * m_NumLinesInText;
- Vector2 CharSize = m_Font.MeasureString(GetLine(1));
- float XPosition = (CharacterIndex * CharSize.X) / SquareWidth;
- float YPosition = (CharacterIndex * CharSize.Y) / SquareHeight;
- return new Vector2(XPosition, YPosition);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement