I have a problem with DrawString() in XNA. I use multiple SpriteBatches for several logical layers. For example: background, objects, menus and so on.
In my menu batch, I draw a menu (the big grey box in the background), the buttons (the smaller grey boxes on the menu) and the strings for the buttons.
The Problem: http://ompldr.org/vaGw4YQ/Unbenannt.png
But for some reason, the strings aren't drawn completely. Does anyone know why?
EDIT:
_menuLayer.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);
if (_menu != null)
{
_menuLayer.Draw(_menuBoard, new Vector2(graphics.PreferredBackBufferWidth / 2 - 160, graphics.PreferredBackBufferHeight / 2 - 240), Color.White);
}
_menuLayer.End();
_buttonLayer.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);
if (_menu != null)
{
foreach (Button button in _menu.Buttons)
{
if (button.Pressed)
{
_buttonLayer.Draw(_menuButtonPressed, button.Location, Color.White);
_buttonLayer.DrawString(_text, button.Text, button.GiveStringLocation(_text), Color.Black);
}
else
{
_buttonLayer.Draw(_menuButton, button.Location, Color.White);
_buttonLayer.DrawString(_text, button.Text, button.GiveStringLocation(_text), Color.Black);
}
}
}
_buttonLayer.End();
Arial
20
0
true
~