public override void Draw(DrawContext context)
 {
     // To render the scrolled panel, we just adjust our offset before rendering our child controls as
     // a normal PanelControl
     context.DrawOffset.Y = -scrollTracker.ViewRect.Y;
     base.Draw(context);
 }
        public override void Draw(DrawContext context)
        {
            base.Draw(context);
            Texture2D drawTexture = texture ?? context.BlankTexture;

            Vector2 actualSourceSize = SourceSize ?? Size;
            Rectangle sourceRectangle = new Rectangle
            {
                X = (int)origin.X,
                Y = (int)origin.Y,
                Width = (int)actualSourceSize.X,
                Height = (int)actualSourceSize.Y,
            };
            Rectangle destRectangle = new Rectangle
            {
                X = (int)context.DrawOffset.X,
                Y = (int)context.DrawOffset.Y,
                Width = (int)Size.X,
                Height = (int)Size.Y
            };
            context.SpriteBatch.Draw(drawTexture, destRectangle, sourceRectangle, Color);
        }
        public override void Draw(DrawContext context)
        {
            int childCount = ChildCount;
            if (childCount < 2)
            {
                // Default rendering behavior if we don't have enough
                // children to flip through.
                base.Draw(context);
                return;
            }
            Vector2 origin = context.DrawOffset;
            int iCurrent = tracker.CurrentPage;

            float horizontalOffset = tracker.CurrentPageOffset;
            context.DrawOffset = origin + new Vector2 { X = horizontalOffset };
            this[iCurrent].Draw(context);

            if (horizontalOffset > 0)
            {
                // The screen has been dragged to the right, so the edge of another
                // page is visible to the left.
                int iLeft = (iCurrent + childCount - 1) % childCount;
                context.DrawOffset.X = origin.X + horizontalOffset - tracker.EffectivePageWidth(iLeft);
                this[iLeft].Draw(context);
            }

            if (horizontalOffset + this[iCurrent].Size.X < context.Device.Viewport.Width)
            {
                // The edge of another page is visible to the right.
                // Note that if we have two pages, it's possible that a page will be
                // drawn twice, with parts of it visible on each edge of the screen.
                int iRight = (iCurrent + 1) % childCount;
                context.DrawOffset.X = origin.X + horizontalOffset + tracker.EffectivePageWidth(iCurrent);
                this[iRight].Draw(context);
            }
        }
        public override void Draw(DrawContext context)
        {
            base.Draw(context);

            if (dropShadow)
                context.SpriteBatch.DrawString(font, Text, context.DrawOffset + new Vector2(2,2), Color.Black);

            context.SpriteBatch.DrawString(font, Text, context.DrawOffset, Color);
        }
        public override void Draw(DrawContext context)
        {
            base.Draw(context);
            Texture2D drawTexture = texture ?? context.BlankTexture;

            Vector2 actualSourceSize = SourceSize ?? Size;
            Rectangle sourceRectangle = new Rectangle
            {
                X = (int)origin.X,
                Y = (int)origin.Y,
                Width = (int)actualSourceSize.X,
                Height = (int)actualSourceSize.Y,
            };
            Rectangle destRectangle = new Rectangle
            {
                X = (int)context.DrawOffset.X,
                Y = (int)context.DrawOffset.Y,
                Width = (int)Size.X,
                Height = (int)Size.Y
            };
            destinationRectangle = destRectangle;
            context.SpriteBatch.Draw(drawTexture, destRectangle, sourceRectangle, Color);
            
            if (hasText)
            {
                context.SpriteBatch.DrawString(font, Text, new Vector2(destRectangle.X + destRectangle.Width / 2, destRectangle.Y + destRectangle.Height / 2) + new Vector2(2,2), Color.Black, 0f, 
                    new Vector2(font.MeasureString(Text).X / 2, font.MeasureString(Text).Y / 2), 1f, SpriteEffects.None, 1f);
                context.SpriteBatch.DrawString(font, Text, new Vector2(destRectangle.X + destRectangle.Width / 2, destRectangle.Y + destRectangle.Height / 2), Color.White, 0f,
                    new Vector2(font.MeasureString(Text).X / 2, font.MeasureString(Text).Y / 2), 1f, SpriteEffects.None, 1f);
            }

            if (hasTripleText)
            {
                context.SpriteBatch.DrawString(font, Text, new Vector2(destRectangle.X + destRectangle.Width / 2, destRectangle.Y + destRectangle.Height / 2 - (font.MeasureString(Text).Y / 4) - (font.MeasureString(Text).Y / 2)) + new Vector2(2, 2), Color.Black, 0f,
                    new Vector2(font.MeasureString(Text).X / 2, font.MeasureString(Text).Y / 2), 1f, SpriteEffects.None, 1f);
                context.SpriteBatch.DrawString(font, Text, new Vector2(destRectangle.X + destRectangle.Width / 2, destRectangle.Y + destRectangle.Height / 2 - (font.MeasureString(Text).Y / 4) - (font.MeasureString(Text).Y / 2)), Color.White, 0f,
                    new Vector2(font.MeasureString(Text).X / 2, font.MeasureString(Text).Y / 2), 1f, SpriteEffects.None, 1f);

                context.SpriteBatch.DrawString(font2, Text2, new Vector2(destRectangle.X + destRectangle.Width / 2, destRectangle.Y + destRectangle.Height / 2 + (font.MeasureString(Text2).Y / 4)) + new Vector2(2, 2), Color.Black, 0f,
                    new Vector2(font2.MeasureString(Text2).X / 2, font2.MeasureString(Text2).Y / 2), 1f, SpriteEffects.None, 1f);
                context.SpriteBatch.DrawString(font2, Text2, new Vector2(destRectangle.X + destRectangle.Width / 2, destRectangle.Y + destRectangle.Height / 2 + (font.MeasureString(Text2).Y / 4)), Color.White, 0f,
                    new Vector2(font2.MeasureString(Text2).X / 2, font2.MeasureString(Text2).Y / 2), 1f, SpriteEffects.None, 1f);
            }
            else if (hasDoubleText)
            {
                context.SpriteBatch.DrawString(font, Text, new Vector2(destRectangle.X + destRectangle.Width / 2, destRectangle.Y + destRectangle.Height / 2 - (font.MeasureString(Text).Y / 2)) + new Vector2(2, 2), Color.Black, 0f,
                    new Vector2(font.MeasureString(Text).X / 2, font.MeasureString(Text).Y / 2), 1f, SpriteEffects.None, 1f);
                context.SpriteBatch.DrawString(font, Text, new Vector2(destRectangle.X + destRectangle.Width / 2, destRectangle.Y + destRectangle.Height / 2 - (font.MeasureString(Text).Y / 2)), Color.White, 0f,
                    new Vector2(font.MeasureString(Text).X / 2, font.MeasureString(Text).Y / 2), 1f, SpriteEffects.None, 1f);

                context.SpriteBatch.DrawString(font2, Text2, new Vector2(destRectangle.X + destRectangle.Width / 2, destRectangle.Y + destRectangle.Height / 2 + (font.MeasureString(Text2).Y / 2)) + new Vector2(2, 2), Color.Black, 0f,
                    new Vector2(font2.MeasureString(Text2).X / 2, font2.MeasureString(Text2).Y / 2), 1f, SpriteEffects.None, 1f);
                context.SpriteBatch.DrawString(font2, Text2, new Vector2(destRectangle.X + destRectangle.Width / 2, destRectangle.Y + destRectangle.Height / 2 + (font.MeasureString(Text2).Y / 2)), Color.White, 0f,
                    new Vector2(font2.MeasureString(Text2).X / 2, font2.MeasureString(Text2).Y / 2), 1f, SpriteEffects.None, 1f);
            }
        }
 public override void Draw(DrawContext context)
 {
     base.Draw(context);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="context"></param>
 public virtual void Draw(DrawContext context)
 {
     Vector2 origin = context.DrawOffset;
     for(int i=0; i<ChildCount; i++)
     {
         Control child = children[i];
         if (child.Visible)
         {
             context.DrawOffset = origin + child.Position;
             child.Draw(context);
         }
     }
 }