RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Remove window?

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 86
To err is human, to ARRRRR is pirate. ???
Hi,

i'm very new to scripting and i reccently made my first window. Here is the script:

Code: [Select]
class Window_First < Window_Base
  #------------------------------------------------#
  # Object Initialization                                         #               
  #------------------------------------------------#
  def initialize
    super(0, 0, 256, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
   
    refresh
  end
 
  #------------------------------------------------#
  # Refresh                                                        #
  #------------------------------------------------#
  def refresh
    self.contents.clear

    self.contents.draw_text(0, 0, 256, 32, "Hello, World", 1)
 end
end


And my question is, how can you make it so when the person playing the game can remove the window by pressing a button, lets say C?  I belive it has something to do with $window.dispose but i can't quite figure it out >.<
Thx.

//Gando
Spoiler for Event systems i've created:

Spoiler for Signature:
"To err is human, to ARRRRR is pirate." ♫♪火

Spoiler for Don't look here!!:


*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
So, this window is not in a scene? Well, yeah, if you set the window to the global variable $window_first (or whatever name) then you could make an event which looks like this:

Code: [Select]
Conditional Branch:  Button C is being pressed
  Script: $window_first.dispose
Branch End

If you didn't want to dispose the window, $window_first.visible = false would work as well.