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!