On Screen, Labels and Return()

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
spinningtime7
Newbie
Posts: 6
Joined: Thu May 27, 2021 1:21 am
Contact:

On Screen, Labels and Return()

#1 Post by spinningtime7 »

Code: Select all

screen location_map:
    textbutton "room":
        xalign 0.5
        yalign 0.3
        action [SetVariable("place","room"),Call("visit_place")]
    textbutton "garden":
        xalign 0.5
        yalign 0.6
        action [SetVariable("place","garden"),Call("visit_place"),Return()]
    textbutton "Bus":
        xalign 0.5
        yalign 0.9
        action [SetVariable("place","Darkness"),Call("visit_place"),Return(),NullAction()]
label visit_place:
    $ k = "icon {}".format(place)
    scene expression k
    "You are in [place]"
    menu:
        "Meet People":
            call event1
        "Move to another place":
            call screen location_map
    return

label event1:
    "Something happened"
    return
Hey guys, I just tried the code and it works. But can somebody explain the difference between the 3 textbuttons in relation to my code? Is there any significance in adding Return() in this case?

Also, when I choose the option to "Move to another place" Why is it that when the three textbutton appears, the button that I selected previously is... whiter, as if renpy tried to track which button I pressed. What If i want to make the color of buttons the same.

Also what exactly does Return() do. What happen if I put expression in Return(arg)?

Really appreciate if somebody could help me gain some insight.

spinningtime7
Newbie
Posts: 6
Joined: Thu May 27, 2021 1:21 am
Contact:

Re: On Screen, Labels and Return()

#2 Post by spinningtime7 »

Oh god. I solved my own problem. How do I close this thread

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], piinkpuddiin