Imagebutton clicking is advancing the story

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
tacoen
Newbie
Posts: 13
Joined: Fri May 10, 2019 2:48 am
Contact:

Imagebutton clicking is advancing the story

#1 Post by tacoen »

How to stop click on my screen imagebutton or any other clickable advancing the story?

1. if I use Call("phone_ui"), "phone_ui" is a label. Then the story advancing
2. if I use Show('phone_face"), "phone_face" is a screen. Then the story not advancing, but the "topbar()" will be missing in the next label.

What did I miss?

Here is my code:

Code: Select all

screen topbar() :
        zorder 1022
        hbox xpos config.screen_width-72 ypos 8 ysize 64:
            imagebutton auto "ivn/smph-ico-%s.png" at size_half clicked [Call("phone_ui")] 

screen phone_face():
        tag phone_ui
        zorder 1023
        modal 1
        $ renpy.hide_screen('ivn_bar')
        frame xpos 0 ypos 0 ysize config.screen_height xsize config.screen_width:
            background "#000C"
        imagemap at phone_pickup:
              etcetra... etcetra...
              
label phone_ui():
    $ renpy.show_screen('phone_face') 
    return

label start:
	show screen topbar

        "test begin"
        
        "more text to show"
        
label two:

	"is a next label"        
       
Humble thanks.

User avatar
XxrenxX
Veteran
Posts: 267
Joined: Tue Oct 02, 2012 2:40 am
Projects: Chasing
Deviantart: bara-ettie
Location: Canada
Contact:

Re: Imagebutton clicking is advancing the story

#2 Post by XxrenxX »

Labels will advance the story, using it as a call won't change that. Adding a pause will help but as soon as the player clicks it will continue as it's not a menu.
Based on the phone_pickup you using this code as a base?

Are you trying to use as "phone_face" an imagemap menu, like a secondary menu to access in-game like the quick_menu? If it's a menu you'll want to use ShowMenu("phone_face")
As for the topbar going away, it's because of how menu's work. They will hide other menu's and the window so I'm unsure if there's a way to have it still appear during the menu unless you add in a second code into the phone_face menu to have it as such.

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: Imagebutton clicking is advancing the story

#3 Post by xavimat »

Screens are usually used in two ways, with "show screen" or "call screen":
1. To show information to the user, without stopping the flow of the label.

Code: Select all

show screen myscreen
2. To stop the play until the user has done something in that screen (like clicking on a button).

Code: Select all

call screen myscreen
In your case, I think you need to call the screen, not to show it.

BTW, it seems that you are using some very old example.
- "clicked" is not used anymore (even if it works for compatibility reasons).Use "action" for that.
- You don't need to wrap your actions in a list if there is only one action.
- renpy.show_screen is the python equivalent for "show screen", when in a label, you could use "show screen", your code will look tidier (and "renpier")
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
tacoen
Newbie
Posts: 13
Joined: Fri May 10, 2019 2:48 am
Contact:

Re: Imagebutton clicking is advancing the story

#4 Post by tacoen »

Thanks for replying to this subject.

I rewrite the code, and find that

Code: Select all

$ renpy.hide_screen('ivn_bar')
was the one causing this madness.

Problem was solved by using "ToggleScreen" in the Action.

Thanks.

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot], piinkpuddiin, snotwurm