[Solved] Textbutton set variable instead of jumping label?

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
Rekoija
Newbie
Posts: 15
Joined: Wed Nov 20, 2019 3:19 pm
Contact:

[Solved] Textbutton set variable instead of jumping label?

#1 Post by Rekoija »

Code: Select all

screen colorscreen():
    add "images/boxes/boxes.png"
    vbox:
        textbutton "blue" action Jump("blue"):
            xpos 200 ypos 600

label blue:
    $ color = "Blue"
Is there an easier way of doing this?
Cuz I read through a bunch of textbutton stuff about actions, and if it was explained there, I didn't understand it well enough to realize it was there, lol.

It'd be preferable if the action could set the color to blue without having to have an entire label dedicated to doing such a tiny thing.

Any help is appreciated, thanks in advance!
Last edited by Rekoija on Thu Jun 11, 2020 12:34 pm, edited 1 time in total.

User avatar
MaydohMaydoh
Regular
Posts: 165
Joined: Mon Jul 09, 2018 5:49 am
Projects: Fuwa Fuwa Panic
Tumblr: maydohmaydoh
Location: The Satellite of Love
Contact:

Re: Textbutton set variable instead of jumping label?

#2 Post by MaydohMaydoh »

You'll want the SetVariable action https://www.renpy.org/doc/html/screen_a ... etVariable

Code: Select all

textbutton "blue" action SetVariable("color", "Blue")

Post Reply

Who is online

Users browsing this forum: Google [Bot]