Ejemplo n.º 1
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            NinePatch patch = Selected ? NinePatchSelected : NinePatchNormal;

            patch.Draw(spriteBatch, AbsolutePosition, Width - patch.LeftWidth - patch.RightWidth, (int)GeeUIMain.Font.MeasureString(WindowText).Y, 0f, EffectiveOpacity);

            string text = TextView.TruncateString(WindowText, WindowContentView.ContentBoundBox.Width);

            spriteBatch.DrawString(GeeUIMain.Font, text, AbsolutePosition + new Vector2(patch.LeftWidth, patch.TopHeight), Color.Black * EffectiveOpacity);

            if (WindowContentView != null)
            {
                WindowContentView.Width = Width;
                Vector2 windowTextSize = GeeUIMain.Font.MeasureString(WindowText);
                var     barHeight      = (patch.TopHeight + patch.BottomHeight + windowTextSize.Y);
                WindowContentView.Height.Value = Height.Value - (int)barHeight;
            }

            base.Draw(spriteBatch);
        }