public override void DrawCore(SpriteBatch spriteBatch, GuiRect finalRect) { base.DrawCore(spriteBatch, finalRect); Rectangle r = new Rectangle( Convert.ToInt32(finalRect.X), Convert.ToInt32(finalRect.Y), Convert.ToInt32(finalRect.Width), Convert.ToInt32(finalRect.Height)); GuiPainter.DrawRectangle(spriteBatch, r, Color.White, fTexture); }
protected override void DoDraw(SpriteBatch spriteBatch, GuiPoint point, Rectangle clipRect) { Rectangle r = new Rectangle( point.X + Offset.X, point.Y + Offset.Y, RenderSize.Width, RenderSize.Height); if (BackgroundColor != Color.Transparent) { GuiPainter.DrawRectangle(spriteBatch, r, BackgroundColor, fTexture); } base.DoDraw(spriteBatch, point, clipRect); }
protected override void DoDraw(SpriteBatch spriteBatch, GuiPoint point, Rectangle clipRect) { int outerX0 = point.X + Offset.X; int outerY0 = point.Y + Offset.Y; int innerX0 = outerX0 + Border.Left; int innerY0 = outerY0 + Border.Top; int outerWidth = RenderSize.Width; int outerHeight = RenderSize.Height; int innerWidth = outerWidth - Border.Width; int innerHeigth = outerHeight - Border.Height; if (BorderColor != Color.Transparent) { Rectangle topRect = new Rectangle(outerX0, outerY0, outerWidth - Border.Right, Border.Top); Rectangle bottomRect = new Rectangle(innerX0, outerY0 + innerHeigth + Border.Top, outerWidth, Border.Bottom); Rectangle leftRect = new Rectangle(outerX0, innerY0, Border.Left, outerHeight); Rectangle rightRect = new Rectangle(outerX0 + innerWidth + Border.Left, outerY0, Border.Right, outerHeight - Border.Bottom); if (Border.Top > 0) { GuiPainter.DrawRectangle(spriteBatch, topRect, BorderColor, fTexture); } if (Border.Bottom > 0) { GuiPainter.DrawRectangle(spriteBatch, bottomRect, BorderColor, fTexture); } if (Border.Left > 0) { GuiPainter.DrawRectangle(spriteBatch, leftRect, BorderColor, fTexture); } if (Border.Right > 0) { GuiPainter.DrawRectangle(spriteBatch, rightRect, BorderColor, fTexture); } } if (BackgroundColor != Color.Transparent) { Rectangle innerRect = new Rectangle(innerX0, innerY0, innerWidth, innerHeigth); GuiPainter.DrawRectangle(spriteBatch, innerRect, BackgroundColor, fTexture); } if (Content != null) { Rectangle childRect = new Rectangle(clipRect.Left + Border.Left, clipRect.Top + Border.Top, innerWidth, innerHeigth); Content.Draw(spriteBatch, new GuiPoint(point.X + Offset.X + Border.Left, point.Y + Offset.Y + Border.Top), childRect); } //base.DoDraw(spriteBatch, point, clipRect); }
protected override void DoDraw(SpriteBatch spriteBatch, GuiPoint point, Rectangle clipRect) { Rectangle r = new Rectangle( point.X + Offset.X, point.Y + Offset.Y, RenderSize.Width, RenderSize.Height); if (BackgroundColor != Color.Transparent) { GuiPainter.DrawRectangle(spriteBatch, r, BackgroundColor, fTexture); } if (Childs != null) { foreach (var child in Childs) { GuiPoint childPoint = new GuiPoint( point.X + Offset.X + child.X, point.Y + Offset.Y + child.Y); child.Control.Draw(spriteBatch, childPoint, clipRect); } } }