コード例 #1
0
ファイル: UIInputBox.cs プロジェクト: Morphan1/Voxalia
 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;
 }
コード例 #2
0
ファイル: UIButton.cs プロジェクト: Morphan1/Voxalia
 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;
 }
コード例 #3
0
ファイル: UILabel.cs プロジェクト: Morphan1/Voxalia
 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;
 }
コード例 #4
0
 /// <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);
 }
コード例 #5
0
ファイル: UITextLink.cs プロジェクト: Morphan1/Voxalia
        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;
        }
コード例 #6
0
        /// <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);
        }
コード例 #7
0
ファイル: FontSetEngine.cs プロジェクト: Morphan1/Voxalia
 /// <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);
 }
コード例 #8
0
ファイル: FontSetEngine.cs プロジェクト: Morphan1/Voxalia
 /// <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;
 }