/// <summary> /// Updates the current VAO with a new font. /// Will use the current 'String' if it exists, otherwise will leave VAO as null. /// </summary> /// <param name="font">The new font size to use with this Text.</param> public void UpdateFontSize(FontSize font) { this.bitmapFont = FontFromSize(font); if (string.IsNullOrEmpty(this.String)) { return; } if (this.VAO != null) { bitmapFont.CreateString(VAO, this.String, Color, Justification); } else { this.VAO = bitmapFont.CreateString(Program, this.String, Color, Justification); this.VAO.DisposeChildren = true; } this.TextSize = new Point(bitmapFont.GetWidth(text), bitmapFont.Height); }