示例#1
0
        private void createFill(Vector2 pos, Vector2 size, Color4 color)
        {
            RectFill leftRectangle = new RectFill(
                new Vector2(pos.X + 1, pos.Y + 12),
                new Vector2(11, size.Y - 22),
                color);

            RectFill topRectangle = new RectFill(
                new Vector2(pos.X + 12, pos.Y + 1),
                new Vector2(size.X - 21, 11),
                color);

            RectFill rightRectangle = new RectFill(
                new Vector2(pos.X + size.X - 10, pos.Y + 12),
                new Vector2(11, size.Y - 22),
                color);

            RectFill bottomRectangle = new RectFill(
                new Vector2(pos.X + 12, pos.Y + size.Y - 10),
                new Vector2(size.X - 21, 11),
                color);

            RectFill centerRectangle = new RectFill(
                new Vector2(pos.X + 12, pos.Y + 12),
                new Vector2(size.X - 22, size.Y - 22),
                color);

            fill.Add(leftRectangle);
            fill.Add(topRectangle);
            fill.Add(rightRectangle);
            fill.Add(bottomRectangle);
            fill.Add(centerRectangle);
        }
示例#2
0
        private void createSides(Vector2 pos, Vector2 size, Color4 color)
        {
            RectFill topSide = new RectFill(
                new Vector2(pos.X, pos.Y),
                new Vector2(size.X, 1),
                color);

            RectFill leftSide = new RectFill(
                new Vector2(pos.X, pos.Y),
                new Vector2(1, size.Y),
                color);

            RectFill bottomSide = new RectFill(
                new Vector2(pos.X, pos.Y + size.Y),
                new Vector2(size.X, 1),
                color);

            RectFill rightSide = new RectFill(
                new Vector2(pos.X + size.X - 1, pos.Y),
                new Vector2(1, size.Y),
                color);


            sides.Add(topSide);
            sides.Add(leftSide);
            sides.Add(bottomSide);
            sides.Add(rightSide);
        }