Esempio n. 1
0
 private void OnPositionChanged(object sender, EventArgs e)
 {
     _textSprite?.SetBoundsToText();
     _textSprite?.SetBounds(
         _textSprite.Bounds.CopyAtPosition(Bounds.GetHandlePosition(BoxHandle.CENTER), BoxHandle.CENTER)
         );
 }
Esempio n. 2
0
 public void SetText(string newText)
 {
     if (Font != null)
     {
         Text = newText;
         if (_textSprite == null)
         {
             _textSprite = new TextSprite(newText, Font, new Rectangle(0, 0, 1000, 1000));
         }
         _textSprite.SetBounds(new Rectangle(
                                   _textSprite.Bounds.X,
                                   _textSprite.Bounds.Y,
                                   1000,
                                   1000));
         _textSprite.SetText(newText);
         _textSprite.SetBoundsToText();
         SetBounds(_textSprite.Bounds);
     }
 }