public UIInputBox(string text, string info, FontSet fonts, UIAnchor anchor, Func<float> width, Func<int> xOff, Func<int> yOff) : base(anchor, width, () => fonts.font_default.Height, xOff, yOff) { Text = text; Info = info; Fonts = fonts; }
public UIButton(string buttontexname, string buttontext, FontSet font, Action clicked, UIAnchor anchor, Func<float> width, Func<float> height, Func<int> xOff, Func<int> yOff) : base(anchor, width, height, xOff, yOff) { tName = buttontexname; Text = buttontext; TextFont = font; ClickedTask = clicked; }
public UILabel(string btext, FontSet font, UIAnchor anchor, Func<int> xOff, Func<int> yOff, Func<int> maxx = null) : base(anchor, () => 0, () => 0, xOff, yOff) { Text = btext; TextFont = font; Width = () => (float)TextFont.MeasureFancyLinesOfText(MaxX != null ? TextFont.SplitAppropriately(Text, MaxX()) : Text, BColor).X; Height = () => (float)TextFont.MeasureFancyLinesOfText(MaxX != null ? TextFont.SplitAppropriately(Text, MaxX()) : Text, BColor).Y; MaxX = maxx; }
/// <summary> /// Prepares the FontSet system. /// </summary> public void Init(Client tclient) { TheClient = tclient; Standard = new FontSet("standard", this); Standard.Load(GLFonts.Standard.Name, GLFonts.Standard.Size); Fonts.Add(Standard); SlightlyBigger = new FontSet("slightlybigger", this); SlightlyBigger.Load(GLFonts.Standard.Name, GLFonts.Standard.Size + 5); Fonts.Add(SlightlyBigger); }
public UITextLink(Texture ico, string btext, string btexthover, string btextclick, FontSet font, Action clicked, UIAnchor anchor, Func<int> xOff, Func<int> yOff) : base(anchor, () => 0, () => 0, xOff, yOff) { Icon = ico; ClickedTask = clicked; Text = btext; TextHover = btexthover; TextClick = btextclick; TextFont = font; Width = () => font.MeasureFancyText(Text, BColor) + (Icon == null ? 0 : font.font_default.Height); Height = () => TextFont.font_default.Height; }
/// <summary> /// Gets a font by a specified name. /// </summary> /// <param name="fontname">The name of the font.</param> /// <param name="fontsize">The size of the font.</param> /// <returns>The specified font.</returns> public FontSet GetFont(string fontname, int fontsize) { string namelow = fontname.ToLowerFast(); for (int i = 0; i < Fonts.Count; i++) { if (Fonts[i].font_default.Size == fontsize && Fonts[i].Name == namelow) { return(Fonts[i]); } } FontSet toret = new FontSet(fontname, this); toret.Load(fontname, fontsize); Fonts.Add(toret); return(toret); }
/// <summary> /// Gets a font by a specified name. /// </summary> /// <param name="fontname">The name of the font.</param> /// <param name="fontsize">The size of the font.</param> /// <returns>The specified font.</returns> public FontSet GetFont(string fontname, int fontsize) { string namelow = fontname.ToLowerFast(); for (int i = 0; i < Fonts.Count; i++) { if (Fonts[i].font_default.Size == fontsize && Fonts[i].Name == namelow) { return Fonts[i]; } } FontSet toret = new FontSet(fontname, this); toret.Load(fontname, fontsize); Fonts.Add(toret); return toret; }