Search found 114 matches
- Sat Aug 27, 2022 6:41 am
- Forum: Ren'Py Questions and Announcements
- Topic: [Solved] Concatenate string and variable within menu choice
- Replies: 4
- Views: 336
Re: Concatenate string and variable within menu choice
More pythonic: https://www.renpy.org/doc/html/statement_equivalents.html#renpy.display_menu You can also alter the choice screen a bit to use .format then pass the args and kwargs . screen choice(items): style_prefix "choice" vbox: for i in items: textbutton i.caption.format(*i.args, **i.kwargs) act...
- Tue Aug 23, 2022 2:41 am
- Forum: Ren'Py Questions and Announcements
- Topic: Calling a list value using a key
- Replies: 1
- Views: 253
- Sun Aug 21, 2022 3:35 am
- Forum: Ren'Py Questions and Announcements
- Topic: [Solved] How to best write out and organize conditional logic when using buttons?
- Replies: 5
- Views: 333
Re: How to best write out and organize conditional logic when using buttons?
What I mean is, if I want to display a bar in the area that the button is, will displaying the bar "above" the button (I assume it would be on another layer?) prevent interaction with the button? Does including that bar in the same frame as the button work without negative interactions? The bar is ...
- Sat Aug 20, 2022 11:37 pm
- Forum: Ren'Py Questions and Announcements
- Topic: how to pass arguments to label?
- Replies: 1
- Views: 251
Re: how to pass arguments to label?
You can't through Jump (no *args/**kwargs) action but can through Call action. Either use Call action instead or maybe try this workaround. init python: _Jump = Jump def jump(label, *args, **kwargs): store.args = args store.kwargs = kwargs renpy.jump(label) def Jump(label, *args, **kwargs): return F...
- Sat Aug 20, 2022 5:54 pm
- Forum: Ren'Py Questions and Announcements
- Topic: [Solved] How to best write out and organize conditional logic when using buttons?
- Replies: 5
- Views: 333
Re: How to best write out and organize conditional logic when using buttons?
Hi all, sorry to ask yet another question, but I was wondering how best to handle things like choosing which event to run from a button with multiple conditions at play? It's better to have a single action on the button like a Jump() or Call() which redirects the player to the label with the comple...
- Sat Aug 20, 2022 11:45 am
- Forum: Ren'Py Questions and Announcements
- Topic: Using MatrixColor Opacity Matrix in a python function?
- Replies: 4
- Views: 333
Re: Using MatrixColor Opacity Matrix in a python function?
Have you tried using Transform for the mask then use alpha?BunnyInfernal wrote: ↑Fri Aug 19, 2022 5:54 pmIs there a way to use OpacityMatrix from inside a python function for a DynamicDisplayable? My plan is to have the value change base on an in-game variable.
Code: Select all
mask = Transform("mask.png", alpha=variable)
- Mon Aug 15, 2022 1:44 am
- Forum: Ren'Py Questions and Announcements
- Topic: [SOLVED] return Transform(self.path, size=(self.sizes)) + pos(self.x, self.y) ?
- Replies: 2
- Views: 291
Re: return Transform(self.path, size=(self.sizes)) + pos(self.x, self.y) ?
Transform and any other Displayables all accepts the **properties parameter. This parameter is commonly known as **kwargs (keyword arguments). **kwargs is just a dict, you can pass the dict through key1=value, key2=value or **dict syntax. Now the Displayables' **properties is quite special since it...
- Wed Aug 10, 2022 1:31 pm
- Forum: Ren'Py Questions and Announcements
- Topic: Quest updates with the use of lists
- Replies: 4
- Views: 437
Re: Quest updates with the use of lists
Thank you! I might be a bit tired looking at all this coding, but I don't understand what do you mean by making a Steps0 property. I think it may look something like this: I wrongly phrased that. What I mean is that make the "steps" a property of the class "QuestC" since as far as I understood the ...
- Wed Aug 10, 2022 10:27 am
- Forum: Ren'Py Questions and Announcements
- Topic: Quest updates with the use of lists
- Replies: 4
- Views: 437
Re: Quest updates with the use of lists
Try making Steps0 a property of the class QuestC also. class QuestC(object): def __init__(self, ID, name, description, steps, active = False, completed = False): self.ID = ID self.name = name self.description = description self.active = active self.completed = completed self.steps = steps self.updat...
- Wed Aug 10, 2022 7:15 am
- Forum: Ren'Py Questions and Announcements
- Topic: [SOLVED] How to change the background of the selected textbutton ?
- Replies: 9
- Views: 326
Re: How to change the background of the selected textbutton ?
It's a pity... I didn't even know that I could use this syntax and write "if/else" in one line! That part is actually a Python thing called ternary operation and is just a syntactic sugar. The rest are Ren'Py related. If you want you can use normal conditionals as well if you're feeling overwhelmed...
- Tue Aug 09, 2022 8:59 pm
- Forum: Ren'Py Questions and Announcements
- Topic: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
- Replies: 22
- Views: 410
Re: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
Just specify the selected property for the button.
Code: Select all
textbutton "Get Results":
selected False
- Tue Aug 09, 2022 8:09 pm
- Forum: Ren'Py Questions and Announcements
- Topic: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
- Replies: 22
- Views: 410
Re: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
Previously, I said that Return() action intentionally ends the called screen. I also included a link before for actions beside Return. Looking at that link as a reference, you can use SetScreenVariable() variable instead to store the current check and make conditions inside your screen to dynamicall...
- Tue Aug 09, 2022 7:53 pm
- Forum: Ren'Py Questions and Announcements
- Topic: [SOLVED] How to change the background of the selected textbutton ?
- Replies: 9
- Views: 326
Re: How to change the background of the selected textbutton ?
You can just use variables for this. screen test(): default selected = -1 hbox: for i in range(3): textbutton "[i]": action SetScreenVariable("selected", i) background (None if selected != i else "#f00") this is amazing. Where do you find such examples? I've been googling all day but haven't found ...
- Tue Aug 09, 2022 2:23 pm
- Forum: Ren'Py Questions and Announcements
- Topic: [SOLVED] How to change the background of the selected textbutton ?
- Replies: 9
- Views: 326
Re: How to change the background of the selected textbutton ?
You can just use variables for this.
Code: Select all
screen test():
default selected = -1
hbox:
for i in range(3):
textbutton "[i]":
action SetScreenVariable("selected", i)
background (None if selected != i else "#f00")
- Tue Aug 09, 2022 1:57 pm
- Forum: Ren'Py Questions and Announcements
- Topic: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
- Replies: 22
- Views: 410
Re: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
If what you mean is that the passing result can be either... ([ON, ON, ON], [OFF, OFF, ON], [OFF, ON, ON]) or... ([ON, ON, ON], [X, X, ON], [X, ON, ON]) or... ([ON, ON, ON], [X, OFF, ON], [OFF, ON, ON]) and etc... Then its probably much better to create helper functions to do the comparison. init py...