Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FormattedTextRenderer"/> class.
        /// </summary>
        /// <param name="format">The text format.</param>
        /// <param name="defaultColor">The default color.</param>
        /// <param name="fontSize">The font size.</param>
        /// <param name="fontFamily">The font family.</param>
        /// <param name="alignment">The text alignment.</param>
        public FormattedTextRenderer(string format, Color defaultColor, float fontSize, string fontFamily, TextAlignment alignment)
        {
            Format       = format;
            DefaultColor = defaultColor;
            FontSize     = fontSize;
            FontFamily   = fontFamily;
            Alignment    = alignment;

            Parse();
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FormattedTextLabel"/> class
 /// with initial display values.
 /// </summary>
 /// <param name="format">The text format.</param>
 /// <param name="defaultColor">The default color.</param>
 /// <param name="fontSize">The font size.</param>
 /// <param name="fontFamily">The font family.</param>
 /// <param name="alignment">The text alignment.</param>
 public FormattedTextLabel(string format, Color defaultColor, float fontSize, string fontFamily, TextAlignment alignment)
 {
     DoubleBuffered        = true;
     _renderer             = new FormattedTextRenderer(format, defaultColor, fontSize, fontFamily, alignment);
     _scrollingTimer.Tick += ScrollingTimerOnTick;
 }