idTech4.UI.idSimpleWindow.Draw C# (CSharp) Method

Draw() public method

public Draw ( float x, float y ) : void
x float
y float
return void
		public void Draw(float x, float y)
		{
			if(_visible == false)
			{
				return;
			}

			CalculateClientRectangle(0, 0);

			_context.FontFamily = _fontFamily;

			_drawRect.Offset(x, y);
			_clientRect.Offset(x, y);
			_textRect.Offset(x, y);

			SetupTransforms(x, y);

			if((_flags & WindowFlags.NoClip) == WindowFlags.NoClip)
			{
				_context.ClippingEnabled = false;
			}

			DrawBackground(_drawRect);
			DrawBorderAndCaption(_drawRect);

			if(_textShadow > 0)
			{
				string shadowText = idHelper.RemoveColors(_text);

				idRectangle shadowRect = _textRect;
				shadowRect.X += _textShadow;
				shadowRect.Y += _textShadow;

				_context.DrawText(shadowText, _textScale, _textAlign, idColor.Black, shadowRect, (_flags & WindowFlags.NoWrap) == 0, -1);
			}

			_context.DrawText(_text, _textScale, _textAlign, _foreColor, _textRect, (_flags & WindowFlags.NoWrap) == 0, -1);
			_context.SetTransformInformation(Vector3.Zero, Matrix.Identity);

			if((_flags & WindowFlags.NoClip) == WindowFlags.NoClip)
			{
				_context.ClippingEnabled = true;
			}

			_drawRect.Offset(-x, -y);
			_clientRect.Offset(-x, -y);
			_textRect.Offset(-x, -y);
		}