Beispiel #1
0
        public override void Draw(SpriteBatch sb)
        {
            if (Visible)
            {
                BackgroundSprite.DrawNineCut(sb, AbsoluteBounds, new Rectangle(0, 0, BackgroundSprite.Width, BackgroundSprite.Height), Color);

                if (DrawTitlebar)
                {
                    Rectangle titleBar = new Rectangle(AbsoluteLocation.X, AbsoluteLocation.Y, Size.Width, PROP_FORM_CLOSE_BUTTON_DIM + PROP_FORM_CLOSE_BUTTON_PADDING * 2);
                    BackgroundSprite.DrawNineCut(sb, titleBar, null, Color.Multiply(Color, 0.8f));
                }

                Vector2 measureText = Text.Measure();
                Text.Draw(sb, new Vector2(AbsoluteLocation.X + Size.Width / 2 - measureText.X / 2, AbsoluteLocation.Y + measureText.Y / 2));
            }
            base.Draw(sb);
            if (Visible)
            {
                foreach (Control child in ChildrenAndSubChildren)
                {
                    if (child is ToolTip)
                    {
                        child.Draw(sb);
                    }
                }
            }
        }
Beispiel #2
0
 public override void Draw(SpriteBatch sb)
 {
     if (Visible)
     {
         BackgroundSprite.DrawNineCut(sb, AbsoluteBounds, null, Color);
         ScrubberSprite.DrawNineCut(sb, scrubberPos, null, Color, 5);
     }
     base.Draw(sb);
 }