Page 1 of 1

making a theme function

Posted: Sun Aug 23, 2009 2:32 pm
by ShiraiJunichi
I would like to make a theme function. I believe I read that ren'py doesn't support user defined functions (more than one line long)... So I thought maybe a subroutine would work. But putting a call statement inside of an init block seems to always give me errors.

Also, in creating my own theme, it seems like I'm setting a lot of styles to have the same values. If I wanted to set all labels, buttons, prompts, etc. to have the same styles (perhaps with minor changes afterward), is there a way to do that which is easier than setting them all individually?

Re: making a theme function

Posted: Sun Aug 23, 2009 2:55 pm
by luminarious
Styles are based on inheritance, right? So defining them for the parent should enable them for several children. Also, there was a function for changing a style's parent, I believe.

Re: making a theme function

Posted: Sun Aug 23, 2009 11:14 pm
by PyTom
Themes are usually python function, but for a single game you can use an init python block. There are a relatively small number of styles a theme has to define, and they are listed at:

http://www.renpy.org/wiki/renpy/doc/ref ... stom_Theme

Re: making a theme function

Posted: Mon Aug 24, 2009 12:23 am
by ShiraiJunichi
Yes, I've seen that list and I think it's incomplete. It says nothing about style.say_label, style.say_dialogue, style.say_window, or style.menu_choice. I assume there are a few that I'm missing. Information about these styles is scattered around the documentation, which made finding it difficult.

As for just using an init block, I didn't want to worry about init block priority... It's not a big deal though. I would like to clarify one thing though- are call statements inside init blocks illegal?