I have a class named “MarblesRemainingInBag” with an Update and Draw method in it. If I call the update method for this class from my main class shouldn’t the draw method in the class be called after calling the update method?
My main class is : “public class Game1 : Microsoft.Xna.Framework.Game”
and in the update method I call the Update method of my “MarblesRemainingInBag” class
ex:
marbsRemaining.Update(graphics.GraphicsDevice);
My MarblesRemainingClass is shown below
public class MarblesRemainingInBag
{
SpriteFont Scorefont;
public Vector2 marbleCountLocation;
public Vector2 Origin;
public int totalMarbles;
public MarblesRemainingInBag(SpriteFont font, int CountLocationX, int CountLocationY)
{
Scorefont = font;
Origin.X = 0;
Origin.Y = 0;
marbleCountLocation.X = CountLocationX;
marbleCountLocation.Y = CountLocationY;
}
public void countUpdate(int marbRemaining)
{
totalMarbles = marbRemaining;
}
public void Update(GraphicsDevice graphics)
{
}
public void Draw(SpriteBatch spriteBatch)
{
spriteBatch.DrawString(Scorefont, "Total :" + totalMarbles, marble, Color.WhiteSmoke, .5f, Origin, 1.0f, SpriteEffects.None, 0.5f);
}
}