コード例 #1
0
        public void Draw(SpriteBatch spriteBatch, Rectangle destination)
        {
            // Margin
            destination = Margin.Apply(destination);

            // Borders
            spriteBatch.FillRectangle(destination, Border.Color);
            destination = Border.Margins.Apply(destination);

            // Padding
            destination = Padding.Apply(destination);

            spriteBatch.FillRectangle(destination, Background);
        }
コード例 #2
0
        public void Draw(SpriteBatch spriteBatch, RectangleF destination)
        {
            spriteBatch.DrawSpacing(Widget.Scale(Margin), Widget.Scale(destination), Margin.Color);
            if (Rise.Debug.UI)
            {
                spriteBatch.DrawSpacing(Widget.Scale(Margin), Widget.Scale(destination), Color.Cyan * 0.5f);
            }
            destination = Margin.Apply(destination);

            spriteBatch.DrawSpacing(Widget.Scale(Border), Widget.Scale(destination), Border.Color);
            destination = Border.Apply(destination);

            spriteBatch.FillRectangle(Widget.Scale(destination), BackgroundColor);

            if (Rise.Debug.UI)
            {
                spriteBatch.DrawSpacing(Widget.Scale(Padding), Widget.Scale(destination), Color.Magenta * 0.5f);
            }
        }
コード例 #3
0
 public Rectangle GetContent(Rectangle rectangle)
 {
     return(Margin.Apply(Border.Apply(Padding.Apply(rectangle))));
 }
コード例 #4
0
 public Rectangle GetContent(Rectangle rectangle)
 => Margin.Apply(Border.Margins.Apply(Padding.Apply(rectangle)));