I'm not sure the best way to title this question, or even ask this, but essentially, I'm building a simple flappy bird clone for a friend, and decided to use windows forms rather than Unity (which I would normally use for games) because of it's simplicity. I, however, ran into the issue of transparent backgrounds of labels not working over other controls (in this case a picturebox). Using this question, I was able to find a workaround for the issue, except that the picturebox in question is the top pipe, which moves every tick.
This code is from the aforementioned question, and how I deal with the issue currently:
if (ScoreText.Bounds.IntersectsWith(PipeTop_PictureBox.Bounds))
{
var pos = this.PointToScreen(ScoreText.Location);
pos = PipeTop_PictureBox.PointToClient(pos);
ScoreText.Parent = PipeTop_PictureBox;
ScoreText.Location = pos;
} else
{
ScoreText.Parent = this;
}
The problem is that it produces a rather clunky result whenever the label intersects with the pipe as seen here (don't mind the sprites, I haven't made the actual ones yet, so I'm using some spare sprites I have on my computer from a previous project). I was wondering if there was any sort of fix for this, or if this is as good as it would get.