1
votes

Im drawing two rectangles. One is orange, and the other is pink.

 spriteBatch.Draw(texture, mainRect, mainColor_Current);
 spriteBatch.Draw(texture, goalRect, goalColor_Current);

They use the same texture, only with different colors. Somehow i end up with this.
The white isn't its own square, its just the half of the pink square that overlaps with the orange square.

Why is this? And how do i fix it?

(also, the texture I'm using is a 1x1 white pixel with no alpha channel).

1
What is the desired outcome? Have you tried passing a different BlendState to spriteBatch.Begin()?itsme86

1 Answers

1
votes

Turns out i needed to pass BlendState.Opaque into SpriteBatch.Begin().

spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.Opaque);