internal void Draw(SpriteBatch sb)
{
// If it ain't on the screen
if (!tree.collisionMap.windowSize.Intersects( this.GetDrawRectangle() ) ) return;
if (this.children == null)
{
// Draw the texture
sb.Draw(this.collisionTexture.texture, this.GetDrawRectangle(), null, this.tree.drawColor, 0f,
Vector2.Zero, SpriteEffects.None, 0.999999f);
// Draw the rectangle bounds
if( this.tree.drawGridLines )
DrawUtil.DrawClearRectangle(sb, this.GetDrawRectangle(), this.tree.borderWidth, this.tree.borderColor);
// Draw the ????
if (this.highlighted)
{
DrawUtil.DrawLine(sb,
new Point(this.rectangle.Left, this.rectangle.Top),
new Point(this.rectangle.Right, this.rectangle.Bottom),
this.tree.highlightedColor,
this.tree.borderWidth);
DrawUtil.DrawLine(sb,
new Point(this.rectangle.Right, this.rectangle.Top),
new Point(this.rectangle.Left, this.rectangle.Bottom),
this.tree.highlightedColor,
this.tree.borderWidth);
}
return;
}
foreach (Quad quad in children)
{
quad.Draw(sb);
}
}