I have two different draw method, one of them Game1.Draw()
the other one is DrawableGameComponent.Draw() When I try to draw string with layerdepth in draw method of DrawableGameComponent, it’s not working, it’s drawing to front of spritebatch, the layerdepth value is not effecting the drawing.
So what’s the problem, how can I give layerdepth effect?
Sprites are only sorted inside a single SpriteBatch Begin/End block, it cannot possibly sort sprites that were drawn in different begin/end blocks.
If you want to achieve a layered effect you’ll need to make sure that all your drawing takes place inside a single begin/end block, or else switch to deferred soting and take much finer control over the order in which you draw things (painters algorithm)