Keyboard Text Input

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
You want to hide the window entirely? If so, just search for this line:


super(x, y, Graphics.width, fitting_height(6))


And right below that line, add this:


self.opacity = 0


This hides the whole window background while still displaying everything inside the window.
 

RavenBlueIndigo

Veteran
Veteran
Joined
May 3, 2012
Messages
124
Reaction score
262
Primarily Uses
Mn, can I turn the window visibility on and off in a script call? EDIT: Now I am getting some undefined method opacity error. o_O
 
Last edited by a moderator:

erpicci

Villager
Member
Joined
Feb 3, 2015
Messages
29
Reaction score
21
First Language
Italian
Primarily Uses
There is always room for improvement.


I will consider adding some options to modify opacity. I'm quite busy today, so this may take some days, I hope you will understand.


PS: Thanks Sixth for your support!
 

erpicci

Villager
Member
Joined
Feb 3, 2015
Messages
29
Reaction score
21
First Language
Italian
Primarily Uses
Hello,


sorry to have kept you waiting. Release candidate version 1.1 is available (check the first post), and it now supports setting window opacity via script call, as well as moving and resizing the window.


To disable opacity, use this:

Code:
config = Scene_Text_Config.new
config.opacity = 0
variable = Scene_Text.read("Insert Text", "left", 32, true, config)
Be sure to check also new examples on the dedicated section in the first post, as they show how to use the new options.


After some thoughts I decided to use a configuration object, rather than simply adding parameters to my constructors. This ensures backward compatibility and should allow for future improvements.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
I found your topic again while searching for Neon Black's Keyboard Input script (oddly enough, this topic is the first google links for me o_O).


Just out of curiosity, I checked your code, and found some memory leaks.


This method:


def window
Window_Base.new(0,0,0,0)
end


Will always create a new window when called. The old ones will never get disposed, and this leads to a memory leak.


You call the method twice when making a new Scene_Text_Config object, so every single time that happens, 2 new windows will be created. 


Open the text input scene a few times, and you will get tons of undisposed windows, and they will eat the memory completely after some time.


You should store that window in an instance variable, so that you can access it later and dispose it properly.


The window must be disposed when leaving the Scene_Text scene (you can do that in the on_input_ok method easily), or any reference to it is lost (because you will initialize a new Scene_Text_Config object every time you open the Scene_Text scene and that new one will overwrite the old, stored one), which will, again, lead to memory leaks.
 
Last edited by a moderator:

erpicci

Villager
Member
Joined
Feb 3, 2015
Messages
29
Reaction score
21
First Language
Italian
Primarily Uses
Hello,


thanks for spotting this issue. I updated the code and put appropriate links and credits in the original post. Now windows should be disposed properly.


Thank you!
 

pedrocarsamar

Warper
Member
Joined
Jun 19, 2017
Messages
2
Reaction score
0
First Language
portuguese
Primarily Uses
RMVXA
Hello,
Nice script. Thank you very much for making it available!
 
Last edited:

erpicci

Villager
Member
Joined
Feb 3, 2015
Messages
29
Reaction score
21
First Language
Italian
Primarily Uses
I'm glad you found it useful! :)
 

Neato_McGuido

Warper
Member
Joined
Feb 4, 2018
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMVXA
Is there any way to have it call the script to make a certain event play out depending on what you type in.

For example, if you were to type "x"and have it set to a variable. Then a later event would call on that variable to perform a certain action.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
You can use this script call:
Code:
variable = Scene_Text.read("Talk to Bobby", "center", 20, false)
$game_variables[555] = variable.clone
Replace the 555 with the variable ID you want to use for this.
The cloning might not be necessary depending on when you want to use the saved text. If you check it immediately, you don't need it, but if you don't, and the player can trigger another text input before the check, the saved text will also change to the last one entered due to how strings are stored.
The Scene_Text.read part is just an example, of course, change the arguments to whatever you want/need.

After this script call, you can check the variable you used later with the regular conditional branch event command, with the script option there.
I think, the script call to use there is already explained somewhere in this topic, so I will leave out that part from here. :p
 

Neato_McGuido

Warper
Member
Joined
Feb 4, 2018
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMVXA
Alright thank you. However I seem to be having another issue. The keyboard soft locks the game if you attempt to use it during a battle. Is there any way to fix this?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,083
Members
137,583
Latest member
write2dgray
Top