Ejemplo n.º 1
0
        void Initialize(string str, object font, int size)
        {
            if (size < 0)
            {
                throw new ArgumentException("Font size must be greater than 0.");
            }

            if (font is string)
            {
                this.font = (string)font == "" ? Fonts.DefaultFont : Fonts.Load((string)font);
            }
            else if (font is Font)
            {
                this.font = ((Font)font).font;
            }
            else if (font is SFML.Graphics.Font)
            {
                this.font = (SFML.Graphics.Font)font;
            }
            else
            {
                this.font = Fonts.Load((Stream)font);
            }

            text   = new SFML.Graphics.Text(str, this.font, (uint)size);
            String = str;
            Name   = "Text";

            SFMLDrawable = text;
        }
Ejemplo n.º 2
0
 public Font(string source)
 {
     font = Fonts.Load(source);
 }
Ejemplo n.º 3
0
 public Font(Stream stream)
 {
     font = Fonts.Load(stream);
 }