Exemple #1
0
    /// <summary>
    /// Constructor of this class
    /// </summary>
    /// <param name="text">Scrolled text</param>
    /// <param name="position">Initial position of the text</param>
    /// <param name="duration">Duration of the effect</param>
    /// <param name="step">An increase to the position</param>
    public ScrollTextEffect(string text, Vector2 position, int duration, Vector2 step)
    {
      this.text = text;
      this.position = position;
      font = UI.Instance.GetFont(SCROLL_TEXT_FONT_NAME);
      Vector2 textSize = font.MeasureString(text);
      this.position = this.position + new Vector2(-textSize.X / 2, 0).Round();
      this.step = step;

      Duration = duration;
      Speed = 1;
      this.GraphicalOverlay = true;
    }
Exemple #2
0
 /// <summary>
 /// Constructor of this class
 /// </summary>
 public ScrollTextEffect()
 {
   Speed = 1;
   font = UI.Instance.GetFont(SCROLL_TEXT_FONT_NAME);
   this.GraphicalOverlay = true;
 }