Пример #1
0
        public override void Render(SBX batch, Rectangle destination)
        {
            var drawArea = new Rectangle(destination.Right - _edge.Width, destination.Top, _edge.Width, _edge.Height);

            batch.GUIDrawSprite(ImageMap, drawArea, _edge, Color.White, SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically);

            drawArea.Y = destination.Bottom - _edge.Height;
            batch.GUIDrawSprite(ImageMap, drawArea, _edge, Color.White, SpriteEffects.FlipHorizontally);

            drawArea.Y      = destination.Top + _edge.Height;
            drawArea.Height = destination.Height - (2 * _edge.Height);
            batch.GUIDrawSprite(ImageMap, drawArea, _center, Color.White, SpriteEffects.FlipHorizontally);
        }
Пример #2
0
        public override void Render(SBX batch, Rectangle destination)
        {
            var drawArea = new Rectangle(destination.Left, destination.Top, _edge.Width, _edge.Height);

            batch.GUIDrawSprite(ImageMap, drawArea, _edge, Color.White, SpriteEffects.FlipHorizontally);

            drawArea.X = destination.Right - _edge.Width;
            batch.GUIDrawSprite(ImageMap, drawArea, _edge, Color.White);

            drawArea.X     = destination.Left + _edge.Width;
            drawArea.Width = destination.Width - (2 * _edge.Width);
            batch.GUIDrawSprite(ImageMap, drawArea, _center, Color.White);
        }
Пример #3
0
        public override void Render(SBX batch, Rectangle destination)
        {
            // ##### Draw Background ##### //

            var drawArea = new Rectangle(
                destination.Left + BorderWidth,
                destination.Top + BorderWidth,
                destination.Width - (2 * BorderWidth),
                destination.Height - (2 * BorderWidth));

            batch.GUIDrawSprite(ImageMap, drawArea, _background, Color.White);

            // ##### Draw Corners ##### //

            drawArea.Width  = BorderWidth;
            drawArea.Height = BorderWidth;

            //Top Left
            drawArea.X = destination.Left;
            drawArea.Y = destination.Top;
            batch.GUIDrawSprite(ImageMap, drawArea, _corner, Color.White);

            //Top Right
            drawArea.X = destination.Right - BorderWidth;
            drawArea.Y = destination.Top;
            _corner.Y += BorderWidth;
            batch.GUIDrawSprite(ImageMap, drawArea, _corner, Color.White);

            //Bottom Right
            drawArea.X = destination.Right - BorderWidth;
            drawArea.Y = destination.Bottom - BorderWidth;
            _corner.Y += BorderWidth;
            batch.GUIDrawSprite(ImageMap, drawArea, _corner, Color.White);

            //Bottom Left
            drawArea.X = destination.Left;
            drawArea.Y = destination.Bottom - BorderWidth;
            _corner.Y += BorderWidth;
            batch.GUIDrawSprite(ImageMap, drawArea, _corner, Color.White);

            _corner.Y -= (3 * BorderWidth);

            // ##### Draw Edges ##### //

            //Top Edge
            drawArea.X     = destination.Left + BorderWidth;
            drawArea.Y     = destination.Top;
            drawArea.Width = destination.Width - (2 * BorderWidth) + 1;
            batch.GUIDrawSprite(ImageMap, drawArea, _edge, Color.White);

            //Bottom Edge
            drawArea.Y = destination.Bottom - BorderWidth;
            _edge.Y   += (2 * BorderWidth);
            batch.GUIDrawSprite(ImageMap, drawArea, _edge, Color.White);

            //Left Edge
            drawArea.X      = destination.Left;
            drawArea.Y      = destination.Top + BorderWidth;
            drawArea.Width  = BorderWidth;
            drawArea.Height = destination.Height - (2 * BorderWidth) + 1;
            _edge.Y        += BorderWidth;
            batch.GUIDrawSprite(ImageMap, drawArea, _edge, Color.White);

            //Right Edge
            drawArea.X = destination.Right - BorderWidth;
            _edge.Y   -= (2 * BorderWidth);
            batch.GUIDrawSprite(ImageMap, drawArea, _edge, Color.White);

            _edge.Y -= (1 * BorderWidth);
        }
Пример #4
0
 public override void Render(SBX batch, Rectangle destination)
 {
     batch.GUIDrawSprite(ImageMap, destination, _source, Color.White);
 }