Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
I have some large viewported screens and stumbled upon some strange behavior. If viewport is draggable or movable by keyboard, textbox doesn't catch mouse/keyboard events and game progression stops.
screen examples_viewport_adv():
viewport:
draggable True # problem here
arrowkeys True # and here
edgescroll (200, 800)
add "some image"
label start:
show screen examples_viewport_adv
"0 step"
"1 step" # we can't get here
return
Of course I could disable draggable and arrowkeys, but it'll cause problems for mobile and disabled users. Textbox does not use mouse drag or arrow keys, so it looks more like a bug, or at least should be covered in documentation. Maybe it's also objects focus problem, I didn't dig deep enough into renpy code. So if this behavior is avoidable — any advice is appreciated
Alex wrote: ↑Thu Aug 27, 2020 2:26 pm
Try to add rather wide scrollbar at the right side of your viewport to let player scroll the viewport instead of drag it.
It could be a solution if viewport was used in another place, but in my case it's simulates players first person view, so scrollbars breaks immersion. But if nothing else helps, I afraid it'll be my only option, thanks.
Alex wrote: ↑Thu Aug 27, 2020 5:26 pm
Well, then you could make a button onscreen to advance through the game (instead of just click anywhere on screen).
screen examples_viewport_adv():
viewport:
draggable True # problem here
arrowkeys True # and here
edgescroll (200, 800)
add "some image"
key "dismiss" action Return() # magic happens here
label start:
show screen examples_viewport_adv
"0 step"
"1 step" # we can't get here
return
So if I don't find better solution or this bug will not be fixed, key "dismiss" action Return() will do the work.
Asmodeev wrote: ↑Thu Aug 27, 2020 7:03 pm
...So if I don't find better solution or this bug will not be fixed, key "dismiss" action Return() will do the work.
"It's not a bug - it's a feature" (c)
Imagine, you trying to drag the viewport but the game determines your click as a "dismiss" and advances through the game.