XNA - How to make an image disappear after x seconds? -
sorry bother everyone, can't find tutorials on xna come here help, how make wait before disposing?
protected override void draw(gametime gametime) { graphicsdevice.clear(color.black); // todo: add drawing code here mbatch.begin(); mbatch.draw(mthequantumbros2, new rectangle(300, 150, mthequantumbros2.width, mthequantumbros2.height), color.white); //how make wait 3 seconds before disposing? mbatch.dispose(); mbatch.end(); base.draw(gametime); }
you can use elapsed time after application has been open x seconds disapear
if (gametime.totalgametime.totalseconds <= 3) { mbatch.begin(); mbatch.draw(mthequantumbros2, new rectangle(300, 150, mthequantumbros2.width, mthequantumbros2.height), color.white); //how make wait 3 seconds before disposing? mbatch.end(); }
Comments
Post a Comment