3 Replies - 4965 Views - Last Post: 18 October 2012 - 01:45 PM

#1 DaT3dster  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 17-October 12

XNA sprite hiding/removing

Posted 17 October 2012 - 05:26 PM

Can someone help me with hiding/removing a sprite that was drawn before? I cant seem to find what im looking for by searching through the internet.
Is This A Good Question/Topic? 0
  • +

Replies To: XNA sprite hiding/removing

#2 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 859
  • View blog
  • Posts: 2,307
  • Joined: 28-March 11

Re: XNA sprite hiding/removing

Posted 17 October 2012 - 07:47 PM

*** Moved to XNA ***
Was This Post Helpful? 0
  • +
  • -

#3 MrShoes  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 314
  • View blog
  • Posts: 490
  • Joined: 13-June 12

Re: XNA sprite hiding/removing

Posted 18 October 2012 - 12:32 AM

If you drew a sprite using SpriteBatch.Draw();, then check where you call that method. If in the Game1.cs Draw() method, it will keep refreshing. What you need is some kind of boolean check, like if(enemy.IsAlive) spriteBatch.Draw(enemy.Sprite); otherwise it will always be drawn.
Was This Post Helpful? 1
  • +
  • -

#4 DaT3dster  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 17-October 12

Re: XNA sprite hiding/removing

Posted 18 October 2012 - 01:45 PM

View PostMrShoes, on 18 October 2012 - 12:32 AM, said:

If you drew a sprite using SpriteBatch.Draw();, then check where you call that method. If in the Game1.cs Draw() method, it will keep refreshing. What you need is some kind of boolean check, like if(enemy.IsAlive) spriteBatch.Draw(enemy.Sprite); otherwise it will always be drawn.


Thanks for the help!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1