Right, I know, I know, I'm dumb.
If you couldn't tell, I'm new here
Thing is, seemingly nowhere in these guides does it say how I'm to create buttons. What I came up with after googling for like 30 minutes is this:
button:
text "example"
action Jump("on_smile_1")
I'm not a complete noobie to this stuff though, so I know what this button is supposed to do; when you click the button that says "example" you will jump forward in the code to the point "on_smile_1". But that doesn't work. When I launch my project it brings up:
File "game/script.rpy", line 52: expected statement.
button:
^
File "game/script.rpy", line 55: expected statement.
button:
^
Which I think might have something to do with indentation, but I'm not sure considering how many different types of indentation I've tried on this damn thing
What I want is to have two or more buttons appear in the middle of the bottom of the screen side by side and clicking those (through the action property) will work just like choice menu buttons . It seems that buttons are easier to move around on the screen than choice menu buttons, which is why I want to use them. Unless one of you can tell me how I'm to move around choice menu buttons? They seem quite glued to the center of the screen.
Thanks
How do I create buttons?
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.
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.
Re: How do I create buttons?
Alrighto, so I kept messing around and there was in fact a spot I'd missed over in screens.rpy called style choice_vbox. Messing with the xalign and yalign there'll do ya.
Re: How do I create buttons?
One thing that still would be nice, is getting the two (or more) options to go next to each other in a nice line rather than on top of each other. Is this plausible?
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3785
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: How do I create buttons?
the syntax is
Ren'Py includes a handy documentation if you ever forget these things. Just look at the bottom left of the program.
Code: Select all
textbutton "example"
jump on_smile_1
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Re: How do I create buttons?
Thank youImperf3kt wrote:the syntax isCode: Select all
textbutton "example" jump on_smile_1
So I tried this instead of the choice menu,but i get this error when the game reaches the point where the button comes in:
While running game code:
File "game/script.rpy", line 54, in script
textbutton "Forgive"
Exception: Sayer 'textbutton' is not defined.
I believe the game thinks that 'textbutton' is actually a character, therefore an undefined 'sayer'. But as has been discovered throughout this thread, I could be wrong.
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3785
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: How do I create buttons?
Its waaaay too early here...
What you want is a choice menu:
What you want is a choice menu:
Code: Select all
menu:
"option 1":
jump on_smile_1
"option 2":
jump another_label
#carry on
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Who is online
Users browsing this forum: No registered users