Page 1 of 1

Dialog locks with viewport screen

Posted: Wed Aug 26, 2020 9:05 pm
by Asmodeev
Hi!

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.

Test:

Code: Select all

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

Re: Dialog locks with viewport screen

Posted: Thu Aug 27, 2020 1:58 pm
by namastaii
could you try putting

Code: Select all

modal False
at the top of the screen before the viewport?

Re: Dialog locks with viewport screen

Posted: Thu Aug 27, 2020 2:26 pm
by Alex
Asmodeev wrote:
Wed Aug 26, 2020 9:05 pm
... So if this behavior is avoidable — any advice is appreciated
Try to add rather wide scrollbar at the right side of your viewport to let player scroll the viewport instead of drag it.

Re: Dialog locks with viewport screen

Posted: Thu Aug 27, 2020 3:48 pm
by Asmodeev
namastaii wrote:
Thu Aug 27, 2020 1:58 pm
could you try putting

Code: Select all

modal False
at the top of the screen before the viewport?
Sadly, it's didn't help, as with modal True
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.

Re: Dialog locks with viewport screen

Posted: Thu Aug 27, 2020 5:26 pm
by Alex
Well, then you could make a button onscreen to advance through the game (instead of just click anywhere on screen).

Code: Select all

textbutton "Next" action Return()

Re: Dialog locks with viewport screen

Posted: Thu Aug 27, 2020 7:03 pm
by Asmodeev
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).

Code: Select all

textbutton "Next" action Return()
This is actually can be a "plan B", thanks!

In the meantime, Andy_kl gave some useful hints that I currently test, one of those already gave some good (but not perfect) results:

Code: Select all

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.

Re: Dialog locks with viewport screen

Posted: Fri Aug 28, 2020 3:04 pm
by Alex
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.