How to add dispose the window method when I press the button

Tapael

Veteran
Veteran
Joined
Oct 23, 2021
Messages
31
Reaction score
8
First Language
n
Primarily Uses
RMVXA
After posting a few times before, I've looked and tried in many ways, but I still haven't solved it.


First of all, my basic code is like this.

[#spoiler]
class Window_Test < Window_Base
def initialize(x = 256,y = 192,width = 130, height = 50)

super(x,y,width,height)

end



def event_text(text)
return unless text.is_a?(String)
draw_text(text, 0, 0, 128, 25)
end




def draw_text(text, x, y, text_width, text_height, aligment = 0)
contents.draw_text(x, y, text_width, text_height, text, aligment)
end
end
[#/spoiler]


And the execution method is to create an auto-execution event on the map, and to create a script in the same way as above.
1660895290432.png


Next is the problem.

I've been running this script

I want to make the window disappear when I press the decision key or cancel key.

I don't know how to add it in the code above.


+ Can I use the sentence display function through the script in a way similar to window display?



If you specify the size (width and height) and where it will be displayed, and enter the sentence to be displayed, the sentence will be deleted by pressing the decision key.



plz help me.
 

Latest Threads

Latest Profile Posts

Sometimes I wonder why I still try and recruit others to help with my games. It never works.
ScreenShot_10_3_2022_4_27_17.png
welp, thanks to Luna MV, I was able to add the Balloon as a window... thus allowing me to edit the font color and outline... so now it looks like comic bubbles above characters. I have NO idea why I couldn't get this to work through more conventional means, but here we are.
CUTE CUTE CUTE.gif
I cannot cease doing cute art
War and Wonder is a 100% choice-based open-world visual novel.
1664821313732.png
1664821466359.png
1664821547746.png
Going live soon on Twitch, and will continue Fortunastreet's game "Verloren". For those who are curious, you are welcome to join ;)

-> Franz' Twitch channel

Forum statistics

Threads
125,757
Messages
1,173,262
Members
164,916
Latest member
Syczewski
Top