Imagebutton question

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
renpyhelp
Regular
Posts: 71
Joined: Tue Feb 27, 2018 2:01 am
Contact:

Imagebutton question

#1 Post by renpyhelp »

I need a little help with imagebuttons

I have an imagebutton on a screen as this...

imagebutton:
idle "help1"
hover "help2"
xpos 313 ypos 3
action Jump("help3")

this brings up the help3 image on click. I need it to be able to remove the help3 image on a mouse click or button press. Is there a way to make that possible? I just can't seem to find anyway possible. Also need it to have it not be able to interact with anything else on the screen while the picture is up.

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

Re: Imagebutton question

#2 Post by Alex »

I'm not quite understand what your trying to achieve. When you click this button, it makes the game jump to label "help3".
If you want to force the player to interact with your screen only then add modal True property to screen - https://www.renpy.org/doc/html/screens. ... -statement
But don't forget to hide your screen

Code: Select all

screen scr_name():
    modal True
    imagebutton:
        idle "help1"
        hover "help2"
        xpos 313 ypos 3
        action [Jump("help3"), Hide("scr_name")]
https://www.renpy.org/doc/html/screen_actions.html

renpyhelp
Regular
Posts: 71
Joined: Tue Feb 27, 2018 2:01 am
Contact:

Re: Imagebutton question

#3 Post by renpyhelp »

The problem I have is that if I have them jump to that label which is in a different part of the code, once that interaction ends, it continues the story.
I basically want it to jump to the label and then jump back to the screen once it's finished. does "modal True" do just that?

I'm rather new to renpy but learning fast, so I may not be too helpful in my explanations, but I'll do my best.

I can manually tell the label to jump back to THAT specific screen again, but that seems rather tedious if I need A LOT of screens to go to that label.

irredeemable
Regular
Posts: 78
Joined: Thu Feb 08, 2018 7:57 am
Contact:

Re: Imagebutton question

#4 Post by irredeemable »

You could use Call instead of Jump and include the screen name as an argument. I would say that if you need "A LOT" of screens to go to a particular label there's probably a better way of doing things. You say "remove the help3 image," does that mean you're only using the label to display an image? In that case you could display the image from the screen rather than jumping to a label.

Post Reply

Who is online

Users browsing this forum: Ocelot