[Solved] Hiding text box using a button.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
-
- Regular
- Posts: 195
- Joined: Tue Dec 15, 2009 4:20 am
- Projects: The Duke's Daughter
- Location: Cape Town
- Contact:
[Solved] Hiding text box using a button.
This seemed to me something easy, but I'm having no success. What I want is an on-screen button that has the same effect as pressing 'h' or the middle mouse button has, i.e. it hides the text box. Then when the user clicks a button, reveals the same text that was previously displayed. The closest I could figure is using the Hide() function as the action of the button, but when I click to get the text box back it goes on to the next line, which is not the behavior I want. Have I missed the simple solution to this?
Last edited by number473 on Wed Jan 18, 2012 4:11 pm, edited 2 times in total.
Mental weather report: Cloudy with a possibility of brain storms.
-
- Regular
- Posts: 107
- Joined: Fri Jul 02, 2010 3:03 pm
- Projects: That's The Way The Cookie Crumbles
- Organization: TwinTurtle Games
- Contact:
Re: Hiding text box using a button.
How are you re-showing the text box? If you're just left-clicking the mouse, then of course it's going to go to the next line of text.
You could try it this way
Put this on top of the say screen
if show_screen:
And instead of Hide() your button action would be ToggleVariable("show_screen").
You could try it this way
Put this on top of the say screen
if show_screen:
And instead of Hide() your button action would be ToggleVariable("show_screen").
-
- Regular
- Posts: 195
- Joined: Tue Dec 15, 2009 4:20 am
- Projects: The Duke's Daughter
- Location: Cape Town
- Contact:
Re: Hiding text box using a button.
Thank you for the suggestion. However, the button will be hidden as well with the text box. I want to avoid putting an unbidden button on the screen if possible.
I think you gave me an idea, however. I'll try adding a transparent full-screen button that shows the window
Will try that later.
edit: That didn't work. There was an error when trying to reshow the say screen.
I think you gave me an idea, however. I'll try adding a transparent full-screen button that shows the window
Will try that later.
edit: That didn't work. There was an error when trying to reshow the say screen.
The above did work. I managed to get the desired behavior by using the key screen statement to check when the mouse button is clicked or a button pressed, so I didn't have to put an on-screen button.You could try it this way
Put this on top of the say screen
if show_screen:
Mental weather report: Cloudy with a possibility of brain storms.
- PyTom
- Ren'Py Creator
- Posts: 16088
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: [Solved] Hiding text box using a button.
Use HideInterface() as the action.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
-
- Regular
- Posts: 195
- Joined: Tue Dec 15, 2009 4:20 am
- Projects: The Duke's Daughter
- Location: Cape Town
- Contact:
Re: [Solved] Hiding text box using a button.
Aha! I guessed there must be an easy way, I just couldn't find it. Thank you.
Mental weather report: Cloudy with a possibility of brain storms.
Who is online
Users browsing this forum: Google [Bot], henne, Majestic-12 [Bot]