Exemplo 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;
        }
Exemplo n.º 2
0
 public Font(string source)
 {
     font = Fonts.Load(source);
 }
Exemplo n.º 3
0
 public Font(Stream stream)
 {
     font = Fonts.Load(stream);
 }