Ren'Py Programatically Hide and Show the user interface?

DarkLoki

Semi-Functional Human
Game Developer
Oct 25, 2018
644
961
247
Hello community. I am playing around with RenPy. I have worked and taught in MS shops for the last 20 years so programming itself s/b easy. I just cant find the correct syntax though. What I'm looking for is how to programmatically implement the equivalent of pressing the "H" key. I would like to do a "pan up" image (similar to what you see every time you meet a new character in Something Unlimited and others). Got the pan/zoom to work nicely, but all the standard UI elements are still there.

Code:
transform panzoom:
    xalign 0.54
    yalign 1.0
    linear 12.0 yalign 0.0
    
#then to call:
    show kitch_zoom at panzoom
Works great, couldn't be better. Now if I could just clear the screen of everything else while this is going on and put things back after. Have worked on this for >2 days and tried every Hail Mary I could find. Please help and thank you in advance
 

guest1492

Member
Apr 28, 2018
390
334
174
If you're using a screen, there's the action.

If not using a screen, internally the HideInterface action uses renpy.call_in_new_context("_hide_windows").
 
  • Heart
  • Like
Reactions: DarkLoki and Midzay

DarkLoki

Semi-Functional Human
Game Developer
Oct 25, 2018
644
961
247
If you're using a screen, there's the action.

If not using a screen, internally the HideInterface action uses renpy.call_in_new_context("_hide_windows").
Try:
Code:
show kitch_zoom at panzoom
window hide
pause
This:

148 show kitch_zoom at panzoom
149 renpy.call_in_new_context("_hide_windows")
150 pause

produced this:

File "game/kitchen.rpy", line 149: expected statement.
renpy.call_in_new_context("_hide_windows")^

I've attached the entire log file but at this point I dont know what I dont know. Thanx for trying View attachment log.txt
 
  • Like
Reactions: osanaiko

osanaiko

Engaged Member
Modder
Jul 4, 2017
3,423
6,588
707
> I have worked and taught in MS shops for the last 20 years so programming itself s/b easy.

You might think that, but "programming" is a lot of different skills, knowledge and understanding wrapped up which is absolutely not universal across all programming languages or environments. Better to take an attitude that this is a new thing which you need to learn more about to become proficient.

The "renpy" line is a python statement, not a Renpy Script statement. Those need to be prefixed with "$" to be run correctly by the interpreter. (you can also have blocks of multiple lines interpreted as python with the "python:" keyword.

I suggest you take some time to review the syntax documentation - Renpy allows the mixture of 3 DSLs, and normal python, with context/keyword/syntax determining how each line is interpreted.

Regards your actual problem, not just the misunderstanding of the syntax:

if "window hide" did not hide the dialogue box, then there is something very strange (or highly customized) about your script. Or by "no dice" did you mean you want to hide something else, like the quick menu as well?
 
Last edited:

DarkLoki

Semi-Functional Human
Game Developer
Oct 25, 2018
644
961
247
> I have worked and taught in MS shops for the last 20 years so programming itself s/b easy.

You might think that, but "programming" is a lot of different skills, knowledge and understanding wrapped up which is absolutely not universal across all programming languages or environments. Better to take an attitude that this is a new thing which you need to learn more about to become proficient.

The "renpy" line is a python statement, not a Renpy Script statement. Those need to be prefixed with "$" to be run correctly by the interpreter. (you can also have blocks of multiple lines interpreted as python with the "python:" keyword.

I suggest you take some time to review the syntax documentation - Renpy allows the mixture of 3 DSLs, and normal python, with context/keyword/syntax determining how each line is interpreted.

Regards your actual problem, not just the misunderstanding of the syntax:

if "window hide" did not hide the dialogue box, then there is something very strange (or highly customized) about your script. Or by "no dice" did you mean you want to hide something else, like the quick menu as well?
Thank you for the reply. I have been working with this for a few months and am aware RenPy is Python. I am constantly referencing the official documentation, but often run into syntax that looks perfectly legit, yet it doesn't work. I only assumed it SHOULD BE easy to understand as I've been working in C#, .Net and MDC for the last 10 years.

No Dice = Didnt Work

edited: Just tried:

$ renpy.call_in_new_context("_hide_windows")

That was the TICKET! Thanx again! You probably just helped me fix a dozen other things I have yet to try!
 
  • Like
Reactions: osanaiko