How to still show screen when calling label in new context (point and click interface)?
Posted: Mon Jan 06, 2020 1:11 pm
Hi everyone!
I'm trying to create a simple point-and-click-interface, where the player can click on various objects and see the main characters thoughts about them. When clicking on an object (like a carpet) I want to carpet to still be shown on screen, while the dialogue about the carpet should steal the full focus of the GUI (the player should not be able to click on any image buttons before the dialogue is done). I'm probably making some silly misstake - but I can't get this to work.
My test code looks like this:
I can click the carpet and get the dialog (under the label "look_at_carpet"). But when I see text "That's a strange looking carpet." I can still click the carpet again (or other image buttons on the screen), and I want to the screen to be "locked"/"greyed out" until I've completed the full "look_at_carpet"-block (seen all dialogue).
I can change the line:
... to:
... and that makes the dialogue act like I want, but if I do that the imagebutton disappears while the dialogue is displayed (since I left the screen context I guess).
I can think of a few exotic (bad) ways to solve this, but I guess there is a nice straighforward way to get the behaviour I want. I want the dialogue act like when I'm using ui.callsinnewcontext (so I can no longer click or hover any image buttons, and so all clicks anywhere on the screen takes me to the next line in the "look_at_carpet"-block, but I still want the imagebuttons to be shown (since it's strange if objects disappears when looking at them
).
Thanks a lot in advance!
I'm trying to create a simple point-and-click-interface, where the player can click on various objects and see the main characters thoughts about them. When clicking on an object (like a carpet) I want to carpet to still be shown on screen, while the dialogue about the carpet should steal the full focus of the GUI (the player should not be able to click on any image buttons before the dialogue is done). I'm probably making some silly misstake - but I can't get this to work.
My test code looks like this:
Code: Select all
screen room():
imagebutton:
xpos 650
ypos 322
xanchor 0.5
yanchor 0.5
idle "carpet.png"
hover "carpet_hover.png"
tooltip "A strange carpet."
action Jump("look_at_carpet")
$ tooltip = GetTooltip()
if tooltip:
text "[tooltip]":
text_align 0.5
xalign 0.5
label enter_room:
show bg fire
play music "audio/eating.ogg"
label room_loop:
show screen room
$ renpy.pause()
jump room_loop
label look_at_carpet:
"That's a strange looking carpet."
"I wonder if I can buy a carpet like that on eBay?"
window hide
jump room_loop
I can change the line:
Code: Select all
action Jump("look_at_carpet") Code: Select all
ui.callsinnewcontext("look_at_carpet")I can think of a few exotic (bad) ways to solve this, but I guess there is a nice straighforward way to get the behaviour I want. I want the dialogue act like when I'm using ui.callsinnewcontext (so I can no longer click or hover any image buttons, and so all clicks anywhere on the screen takes me to the next line in the "look_at_carpet"-block, but I still want the imagebuttons to be shown (since it's strange if objects disappears when looking at them
Thanks a lot in advance!