Notice: fwrite(): Write of 8192 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96
Remove window?
Main Menu
  • Welcome to The RPG Maker Resource Kit.

Remove window?

Started by Gando, February 22, 2008, 05:45:49 PM

0 Members and 1 Guest are viewing this topic.

Gando

Hi,

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


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=Event systems i've created]
Event steal system
http://rmrk.net/index.php/topic,23659.0.html
[/spoiler]

[spoiler=Signature]
"To err is human, to ARRRRR is pirate." ♫♪火
[/spoiler]

[spoiler=Don't look here!!]

[/spoiler]

modern algebra

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:


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.