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