Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[RESOLVED] Erasing Pictures in Scripts

Aeioe

Member

I posted this in the sticky at top but figured it may be better on its own:

In Window_Status I've added a bunch of little images with numbers next to them like this:
Code:
self.contents.font.color = system_color
    self.contents.draw_text(05, 130, 96, 32, "Skills")
    @mining = Sprite.new
    @mining.bitmap = RPG::Cache.picture("GG Mining")
    @mining.x = 20
    @mining.y = 180
    @mining.z = 100 # 1 - 9999+.

This works fine in the status menu, but when I exit the menu all the words disappear as they should but the images stay up. How can I delete those images at window close?

Thank you!
~Aeioe
 
Make a new dispose method for the window with a super in it, so it will do all the stuff in its normal dispose method that it inherits from Window_Base.
Code:
  def dispose
    #replace this with sprite disposal
    super
  end
Put it in your Window_Status, and put the sprite disposing there.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top