void UpdateCharacters() { int maxSize = Height / (Pointer.Height - 3); int start = NumberOfLines > maxSize ? (NumberOfLines - 1) - maxSize : 0; int end = NumberOfLines; string displayLocalText = ""; for (int i = start; i < end; i++) { displayLocalText += TextLines[i] + (i == end - 1 ? "" : "\n"); } string[] lines = displayLocalText.Split('\n'); for (int i = 0; i < lines.Length - 1; i++) { lines[i] = lines[i].Insert(lines[i].Length, "\n"); } int charIndex = (_keyboardString.Length - displayLocalText.Length); for (int i = 0; i < lines.Length; i++) { int height = 0; int width = 0; string copyLines = lines[i]; for (int j = 0; j < lines[i].Length; j++) { string subStr = copyLines.Substring(0, j + 1); string character = lines[i][j].ToString(); Vector2 dim = subStr.Replace("\n", "").Size(TextFont); Vector2 charSize = character.Size(TextFont); height = (int)(dim.Y * (i + 1)) + 2; width = (int)dim.X + 2; Point location = new Point(width, height); CharBucket.Update(charIndex, location, charSize.ToPoint()); charIndex++; } } }