Screen Interaction Issues

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
meiri
Regular
Posts: 177
Joined: Wed Jun 25, 2014 6:21 pm
Projects: Tutor Tabitha, Movement
Organization: Blue Bottlecap Games
Location: East Coast, US
Contact:

Screen Interaction Issues

#1 Post by meiri »

So, I've crossed out the issue below because I've gotten some functions to work, but now I've got issues overall with the interaction of the screen. I've programmed everything in now, so maybe my code will make a little more sense.
I'll show the overall code and then state some of the issues.

Code: Select all

screen home:
    tag menu
    add "browser_gfx/home_screen_bg.png"
    imagebutton auto "browser_gfx/home_icon1_%s.png" focus_mask True action Show("deeble_home")
    imagebutton auto "browser_gfx/home_icon2_%s.png" focus_mask True action Show("deeble_home")  
    imagebutton auto "browser_gfx/home_button_%s.png" xpos 0 ypos 0 focus_mask True action Jump("not_done")
        
screen deeble_home:
    $ site = "d_home"
    tag menu
    use home
    add "browser_gfx/deeble_search_bg.png"
    imagebutton auto "browser_gfx/deeble_search_searchbox_%s.png" focus_mask True action Show("deeble_results")
    use browser_bar

screen deeble_results:
    $ site = "d_results"
    tag menu
    use home
    add "browser_gfx/deeble_results_bg.png"
    imagebutton auto "browser_gfx/deeble_results_ad_%s.png" focus_mask True action Jump("dont_click")
    imagebutton auto "browser_gfx/deeble_results_tdn_%s.png" focus_mask True action Show("tdn")
    imagebutton auto "browser_gfx/deeble_results_swb_%s.png" focus_mask True action Show("swb") 
    use browser_bar
    
screen tdn:
    $ site = "tdn"
    $ viewedtdn = True
    use home
    add "browser_gfx/tdn_bg.png"
    use browser_bar
    
screen swb:
    $ site = "swb"
    $ viewedswb = True
    use home
    add "browser_gfx/swb_bg.png"
    use browser_bar
    
screen browser_bar:
    modal False
    tag menu
    add "browser_gfx/scrollbar.png"
    add "browser_gfx/toolbar_bg.png"
    imagebutton auto "browser_gfx/toolbar_buttons_%s.png" focus_mask True action Show("home")
    
    if site == "d_home":
        imagebutton auto "browser_gfx/toolbar_back_%s.png" focus_mask True action NullAction()
        add "browser_gfx/toolbar_info_deeblehome.png"
    if site == "d_results":
        imagebutton auto "browser_gfx/toolbar_back_%s.png" focus_mask True action Show("deeble_home")
        add "browser_gfx/toolbar_info_deebleresults.png"
    if site == "tdn":
        imagebutton auto "browser_gfx/toolbar_back_%s.png" focus_mask True action Show("deeble_results")
        add "browser_gfx/toolbar_info_tdn.png"
    if site == "swb":
        imagebutton auto "browser_gfx/toolbar_back_%s.png" focus_mask True action Show("deeble_results")
        add "browser_gfx/toolbar_info_swb.png"
    else:
        imagebutton auto "browser_gfx/toolbar_back_%s.png" focus_mask True action NullAction()
  • At the end there is a series of code that says "if site == 'name': ". The issue here is that the imagebuttons under each of those if statements do not work. They also don't respond to hover/unhover actions. This hasn't been working since the striked out issue posted below.
  • In screen browser_bar, before the if statements, there is an imagebutton. This imagebutton will work in screen deeble_home and occasionally deeble_results, but does not work at all in screen tdn or screen swb. Not at all sure why it works in some screens and not in others.
  • Sometimes the imagebuttons in screen deeble_results do not work until several consecutive clicks. This leads me to believe that maybe there is an issue loading/predicting the screen but if I'm right Ren'Py loads screens before hand, so this is a total mystery.
I'm now going to particulary draw attention to screen deeble_results.

Code: Select all

screen deeble_results:
    $ site = "d_results"
    tag menu
    use home
    add "browser_gfx/deeble_results_bg.png"
    imagebutton auto "browser_gfx/deeble_results_ad_%s.png" focus_mask True action Jump("dont_click")
    imagebutton auto "browser_gfx/deeble_results_tdn_%s.png" focus_mask True action Show("tdn")
    imagebutton auto "browser_gfx/deeble_results_swb_%s.png" focus_mask True action Show("swb") 
    use browser_bar
There is an imagebutton that jumps to label dont_click. At the end of label dont_click it calls screen deeble_results. Now, if you click this imagebutton BEFORE clicking either of the other two, it simply takes you to label dont_click and calls screen deeble_results. However, if you click on of the other two imagebuttons (which will take you to screen tdn of swb), then go back to screen deeble_results and click the imagebutton that goes to label dont_click, the dialogue in label dont_click will take place on one of the other two screens, tdn or swb. I almost think that this has to do with using renpy.call_screen at the end of label dont_click but I'm not sure why.

Lastly, lets say you go to screen swb. If when in screen swb, you click in the screen where this

Code: Select all

 imagebutton auto "browser_gfx/deeble_results_ad_%s.png" focus_mask True action Jump("dont_click")
imagebutton was previously located, then it will act as if you have clicked that imagebutton.

In my opinion, my code doesn't seem to have many issues or problems, and it doesnt return tracebacks or anything, but its an obvious issue to have random things happening when you click the screen. Any help would be GREATLY appreciated, and if you need more information let me know.
Thanks again.

I'm using several screens that are layered on top of each other. By zorder I mean the stacked order from bottom --> top or from top --> bottom.
There are two screens which I have that I stack and add to other screens using "use". However, the screen on the very top isnt letting any of the buttons underneath it be used, nor does IT react.
I've tried using modal False but it has no effect.
Does it have something to do with the fact that this screen on the top is functional as well?
Anyways, here is my code

Code: Select all

screen home:
    tag menu
    add "browser_gfx/home_screen_bg.png"
    
    imagebutton auto "browser_gfx/home_icon1_%s.png" focus_mask True action Show("deeble_home")
    imagebutton auto "browser_gfx/home_icon2_%s.png" focus_mask True action Show("deeble_home")  
    imagebutton auto "browser_gfx/home_button_%s.png" xpos 0 ypos 0 focus_mask True action Jump("not_done")
        
screen deeble_home:
    $ site = "d_home"
    tag menu
    use home
    add "browser_gfx/deeble_search_bg.png"
    add "browser_gfx/scrollbar.png"
    imagebutton auto "browser_gfx/deeble_search_searchbox_%s.png" focus_mask True action Show("deeble_results")
    use browser_bar

screen deeble_results:
    $ site = "d_results"
    tag menu
    use home
    add "browser_gfx/scrollbar.png"
    add "browser_gfx/deeble_results_bg.png"
    
screen browser_bar:
    modal False
    add "browser_gfx/toolbar_bg.png"
    imagebutton auto "browser_gfx/toolbar_buttons_%s.png" focus_mask True action Show("home")
    
    if site == "d_home":
        imagebutton auto "browser_gfx/toolbar_back_%s.png" action NullAction()
        add "browser_gfx/toolbar_info_deeblehome.png"
    if site == "d_results":
        imagebutton auto "browser_gfx/toolbar_back_%s.png" action Show("deeble_home")
        add "browser_gfx/toolbar_info_deebleresults.png"
    if site == "tdn":
        imagebutton auto "browser_gfx/toolbar_back_%s.png" action Show("deeble_results")
        add "browser_gfx/toolbar_info_tdn.png"
    if site == "swb":
        imagebutton auto "browser_gfx/toolbar_back_%s.png" action Show("deeble_results")
        add "browser_gfx/toolbar_info_swb.png"
    else:
        imagebutton auto "browser_gfx/toolbar_back_%s.png" action NullAction()
        add "browser_gfx/toolbar_info_deeblehome.png"
So screen "home" is on bottom, screen "browser_bar" is on top.
All the functions in screen "deeble_home" do not work unless I comment out "use browser_bar"
Definitely let me know if there's any other information I can supply.
Thanks (again) in advance.[/s]
Last edited by meiri on Sat Oct 18, 2014 7:28 pm, edited 2 times in total.
What's in a loop? A loop iterated in any other way would output as sweet.
--
Have a look at my GxG kinetic novel, Movement, if you have the chance?

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

Re: ability to interact w screens regardless of zorder.

#2 Post by Alex »

Just a shot in the dark - what's the size of images used in "browser_bar" screen, aren't they fullscreen?

User avatar
meiri
Regular
Posts: 177
Joined: Wed Jun 25, 2014 6:21 pm
Projects: Tutor Tabitha, Movement
Organization: Blue Bottlecap Games
Location: East Coast, US
Contact:

Re: ability to interact w screens regardless of zorder.

#3 Post by meiri »

Alex wrote:Just a shot in the dark - what's the size of images used in "browser_bar" screen, aren't they fullscreen?
Yes, they are.
What's in a loop? A loop iterated in any other way would output as sweet.
--
Have a look at my GxG kinetic novel, Movement, if you have the chance?

User avatar
fluxus
Regular
Posts: 133
Joined: Thu Jun 19, 2014 8:06 am
Projects: Animal Anaesthesia (a teaching game)
Contact:

Re: ability to interact w screens regardless of zorder.

#4 Post by fluxus »

If adding a jpg to a screen creates a wall hindering clicks on that screen in hitting another screen underneath, even if the jpg'ed screen isn't modal, I'm all ears - that sounds useful :)

I don't get how it'd stop interactions with the jpg'ed screen's own imagebuttons, though.

User avatar
meiri
Regular
Posts: 177
Joined: Wed Jun 25, 2014 6:21 pm
Projects: Tutor Tabitha, Movement
Organization: Blue Bottlecap Games
Location: East Coast, US
Contact:

Re: Screen Interaction Issues

#5 Post by meiri »

As the issue here has changed, but is still very related to it, Ive changed the original post although the first post is still there. Still looking for any help :)
What's in a loop? A loop iterated in any other way would output as sweet.
--
Have a look at my GxG kinetic novel, Movement, if you have the chance?

User avatar
meiri
Regular
Posts: 177
Joined: Wed Jun 25, 2014 6:21 pm
Projects: Tutor Tabitha, Movement
Organization: Blue Bottlecap Games
Location: East Coast, US
Contact:

Re: Screen Interaction Issues

#6 Post by meiri »

- Still searching for any help.
What's in a loop? A loop iterated in any other way would output as sweet.
--
Have a look at my GxG kinetic novel, Movement, if you have the chance?

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

Re: Screen Interaction Issues

#7 Post by Alex »

Try to change all those if / if / if to ==> if / elif / elif / else.
Looks like for now, if site == "d_home" you got an appropriate imagebutton, but on top of it you also got the same-looking insensitive button because of this part

Code: Select all

    if site == "swb":
        imagebutton auto "browser_gfx/toolbar_back_%s.png" focus_mask True action Show("deeble_results")
        add "browser_gfx/toolbar_info_swb.png"
    else:
        imagebutton auto "browser_gfx/toolbar_back_%s.png" focus_mask True action NullAction()

User avatar
meiri
Regular
Posts: 177
Joined: Wed Jun 25, 2014 6:21 pm
Projects: Tutor Tabitha, Movement
Organization: Blue Bottlecap Games
Location: East Coast, US
Contact:

Re: Screen Interaction Issues

#8 Post by meiri »

Alex wrote:Try to change all those if / if / if to ==> if / elif / elif / else.
Looks like for now, if site == "d_home" you got an appropriate imagebutton, but on top of it you also got the same-looking insensitive button because of this part

Code: Select all

    if site == "swb":
        imagebutton auto "browser_gfx/toolbar_back_%s.png" focus_mask True action Show("deeble_results")
        add "browser_gfx/toolbar_info_swb.png"
    else:
        imagebutton auto "browser_gfx/toolbar_back_%s.png" focus_mask True action NullAction()
Thank you so much! This definitely fixed the back button issue and helped me pinpoint the other issue.

...

If anyone wonders, the issue was that I never added "tag menu" to screen tdn and screen swb. Which was why it reacted to a screen that was no longer there. And to think I struggled so hard...
What's in a loop? A loop iterated in any other way would output as sweet.
--
Have a look at my GxG kinetic novel, Movement, if you have the chance?

Post Reply

Who is online

Users browsing this forum: Andredron, Google [Bot]