idTech4.UI.idDeviceContext.DrawRectangle C# (CSharp) Method

DrawRectangle() public method

public DrawRectangle ( float x, float y, float width, float height, float size, Vector4 color ) : void
x float
y float
width float
height float
size float
color Vector4
return void
		public void DrawRectangle(float x, float y, float width, float height, float size, Vector4 color)
		{
			if(color.W == 0.0f)
			{
				return;
			}

			idE.RenderSystem.Color = color;

			if(ClipCoordinates(ref x, ref y, ref width, ref height) == true)
			{
				return;
			}

			AdjustCoordinates(ref x, ref y, ref width, ref height);

			DrawStretchPicture(x, y, size, height, 0, 0, 0, 0, _whiteImage);
			DrawStretchPicture(x + width - size, y, size, height, 0, 0, 0, 0, _whiteImage);
			DrawStretchPicture(x, y, width, size, 0, 0, 0, 0, _whiteImage);
			DrawStretchPicture(x, y + height - size, width, size, 0, 0, 0, 0, _whiteImage);
		}

Usage Example

示例#1
0
 private void DrawBorderAndCaption(idRectangle drawRect)
 {
     if ((_flags & WindowFlags.Border) == WindowFlags.Border)
     {
         if (_borderSize > 0)
         {
             _context.DrawRectangle(drawRect.X, drawRect.Y, drawRect.Width, drawRect.Height, _borderSize, _borderColor);
         }
     }
 }