您可以用透明像素替换不需要的像素:
//extract pixel data from texture
Texture2D topTexture = ...
Color[] topTextureData = new Color[topTexture.Width * topTexture.Height];
topTexture.GetData<Color>(topTextureData);
for(int x = 0; x < topTexture.Width; x++)
{
//depending on how you represent lines, set transparent all the pixels at and below line
//basically, for each x dimension, you find where the line is - you have to
//write the method for getting this y, as I don't know how you represent lines
int lineY = GetLineYAtThisX(x);
//all the pixels at (and below) the line are set transparent
for(int y = lineY; y < topTexture.Height; y++)
{
topTextureData[x + y * topTexture.Width] = Color.Transparent;
}
}
//save this data into another texture, so you don't ruin the original one.
Texture2D maskedTopTexture = new Texture2D(GraphicsDevice, topTexture.Width, topTexture.Height);
maskedTopTexture.SetData<Color>(topTextureData);
您甚至不必为底部的一个这样做,只需在其上方绘制顶部的一个。