private void BuildVAO(TextBox.TextBoxEntry entry, string text) { this.vaos.Add(new Text(Shaders.FontShader, entry.Font, text, entry.Color, BMFont.Justification.Left) { Padding = new Point(entry.Position, 0) }); }
private void BuildVAOs() { for (int index = 0; index < this.vaos.Count; ++index) { this.vaos[index].Dispose(); this.vaos[index] = (Text)null; } this.vaos.Clear(); if (this.lines.Count > this.MaximumLines && this.allowScrollBar && this.scrollBar != null) { if (this.scrollBar.Name == null || !UserInterface.Elements.ContainsKey(this.scrollBar.Name)) { this.Parent.AddElement((UIElement)this.scrollBar); } } else if (this.Parent != null && this.scrollBar != null) { this.Parent.RemoveElement((UIElement)this.scrollBar); } for (int currentLine = this.CurrentLine; currentLine <= this.MaximumLines + this.CurrentLine && (currentLine < this.lines.Count && currentLine >= 0); ++currentLine) { if (this.lines[currentLine].Count != 0) { TextBox.TextBoxEntry entry = this.lines[currentLine][0]; string text = ""; for (int index = 0; index < this.lines[currentLine].Count; ++index) { if (entry.Color != this.lines[currentLine][index].Color || entry.Font != this.lines[currentLine][index].Font) { if ((uint)text.Length > 0U) { this.BuildVAO(entry, text); } entry = this.lines[currentLine][index]; text = this.lines[currentLine][index].Text; } else { text += this.lines[currentLine][index].Text; } } if ((uint)text.Length > 0U) { this.BuildVAO(entry, text); } } } this.CalculateVisibilityTime(); this.dirty = false; }