Is there a limit in drawn objects?
Hello to everyone,
I'm experiencing a very annoying matter in my game editor. I created a form and when the user adds an object to the editor the object is drawn. But the problem is that sometimes I press to add the object and is not drawn and other times it is drawn but the previous one is missing.... Could anyone give me a tip??
Here's my draw code :
GraphicsDevice.Clear(Color.Beige);
spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.BackToFront, SaveStateMode.SaveState);
// Draws all the objects
//?????????????????????????
if (avatar_pressed == true)
{
avatar.Draw(spriteBatch);
}
foreach (Obstacle obstacle in obstacles)
{
obstacle.Draw(spriteBatch);
}
foreach (Tiles tile in tiles)
{
tile.Draw(spriteBatch);
}
if (back_selected == true)
{
background.Draw(spriteBatch);
}
spriteBatch.End();