idTech4.UI.idWindow.DrawDebug C# (CSharp) Method

DrawDebug() private method

private DrawDebug ( int time, float x, float y ) : void
time int
x float
y float
return void
		private void DrawDebug(int time, float x, float y)
		{
			if(_context == null)
			{
				return;
			}

			_context.ClippingEnabled = false;

			if(idE.CvarSystem.GetInteger("gui_debug") == 1)
			{
				_context.DrawRectangle(_drawRect.X, _drawRect.Y, _drawRect.Width, _drawRect.Height, 1, idColor.Red);
			}
			else if(idE.CvarSystem.GetInteger("gui_debug") == 2)
			{
				string str = this.Text;
				StringBuilder buffer = new StringBuilder();

				if(str.Length > 0)
				{
					buffer.AppendLine(str);
				}

				buffer.AppendFormat("Rect: {0}, {1}, {2}, {3}\n", _rect.X, _rect.Y, _rect.Width, _rect.Height);
				buffer.AppendFormat("Draw Rect: {0}, {1}, {2}, {3}\n", _drawRect.X, _drawRect.Y, _drawRect.Width, _drawRect.Height);
				buffer.AppendFormat("Client Rect: {0}, {1}, {2}, {3}\n", _clientRect.X, _clientRect.Y, _clientRect.Width, _clientRect.Height);
				buffer.AppendFormat("Cursor: {0} : {1}\n", this.UserInterface.CursorX, this.UserInterface.CursorY);

				_context.DrawText(buffer.ToString(), _textScale, _textAlign, _foreColor, _textRect, true);
			}

			_context.ClippingEnabled = true;
		}