public void AddLeftLabel(string fontName, string labelString, Color labelColor, float labelScale) { labelString = AddLineBreaksToString(labelString, 25); WTLabelComponent lc = new WTLabelComponent("leftLabelComponent", fontName, labelString, labelColor, labelScale); lc.label.anchorX = 0; lc.label.x = horizontalPadding_; leftLabelComponent = lc; AddComponent(lc); this.height = Mathf.Max(height_, lc.label.textRect.height * lc.label.scaleY + verticalPadding_ * 2); lc.label.y = height_ / 2f; }
public void AddCenterLabel(string fontName, string labelString, Color labelColor, float labelScale) { WTLabelComponent lc = new WTLabelComponent("centerLabelComponent", fontName, labelString, labelColor, labelScale); lc.label.x = width_ / 2f; centerLabelComponent = lc; AddComponent(lc); this.height = Mathf.Max(height_, lc.label.textRect.height * lc.label.scaleY + verticalPadding_ * 2); lc.label.y = height_ / 2f; }