Ren'py macro
Ren'py macro
Hello! I have a suggestion but maybe someone has told about it before me. Sometimes I need to implement the same code in several places of ren'py scripts. For example, some of my buttons have different location and image background but the same conditional actions. I think it's good idea to implement in engine something like macro(if it's feasible). Sorry if I've chosen wrong place to make this topic.
There's no point in standing around with your mouth open waiting for talent to fall from the sky. You make your own. No matter what you're doing, the most essential thing is not to give up.
- PyTom
- Ren'Py Creator
- Posts: 15893
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Ren'py macro
Right now, you can do this with the screen language use statement.
Something like that.
Code: Select all
screen file_button(number):
textbutton "[number]" action FileAction(number)
screen save:
vbox:
use file_button(1)
use file_button(2)
use file_button(3)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
Re: Ren'py macro
Yes, of course I can create screens with parameters and use these screens, but I think it would be fine if something like C pre-processor had been as engine feature. It's just suggestion, so don't mind if you think that's bad or unnecessary idea 
There's no point in standing around with your mouth open waiting for talent to fall from the sky. You make your own. No matter what you're doing, the most essential thing is not to give up.
Who is online
Users browsing this forum: No registered users