Dialog locks with viewport screen

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.
Post Reply
Message
Author
User avatar
Asmodeev
Newbie
Posts: 5
Joined: Wed Aug 26, 2020 8:32 pm
Contact:

Dialog locks with viewport screen

#1 Post by Asmodeev » Wed Aug 26, 2020 9:05 pm

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

User avatar
namastaii
Eileen-Class Veteran
Posts: 1348
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Dialog locks with viewport screen

#2 Post by namastaii » 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?

User avatar
Alex
Lemma-Class Veteran
Posts: 2578
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Dialog locks with viewport screen

#3 Post by Alex » Thu Aug 27, 2020 2:26 pm

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.

User avatar
Asmodeev
Newbie
Posts: 5
Joined: Wed Aug 26, 2020 8:32 pm
Contact:

Re: Dialog locks with viewport screen

#4 Post by Asmodeev » Thu Aug 27, 2020 3:48 pm

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.

User avatar
Alex
Lemma-Class Veteran
Posts: 2578
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Dialog locks with viewport screen

#5 Post by Alex » 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()

User avatar
Asmodeev
Newbie
Posts: 5
Joined: Wed Aug 26, 2020 8:32 pm
Contact:

Re: Dialog locks with viewport screen

#6 Post by Asmodeev » Thu Aug 27, 2020 7:03 pm

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.

User avatar
Alex
Lemma-Class Veteran
Posts: 2578
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Dialog locks with viewport screen

#7 Post by Alex » Fri Aug 28, 2020 3:04 pm

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.

Post Reply

Who is online

Users browsing this forum: Alex, Google [Bot]