Cookbook Recipes requests
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.
Cookbook Recipes requests
I got two requests for things that should be really simple. Note that I'm not necessarily asking for the code to be posted here on the forum, but rather in the Cookbook on the Ren'Py wiki. (Threads fall and become unfindable. Recipes can at least be properly sorted by content rather than time.)
Both of these would probably go in the User Interface section on the Cookbooks page.
1.) How do I place the character's name ABOVE the text window, like on Wikipedia's entry on Ren'Py?
2.) How do I set the transparency level of the text window?
Both of these would probably go in the User Interface section on the Cookbooks page.
1.) How do I place the character's name ABOVE the text window, like on Wikipedia's entry on Ren'Py?
2.) How do I set the transparency level of the text window?
Re: Cookbook Recipes requests
Well, hm. It's true that stuff on the forum is really not that easy to find, but making a cookbook recipe of every styling or configuration one-liner is totally not feasible either.
The rest is left as an exercise for the reader.
- herenvardo
- Veteran
- Posts: 359
- Joined: Sat Feb 25, 2006 11:09 am
- Location: Sant Cugat del Vallès (Barcelona, Spain)
- Contact:
Re: Cookbook Recipes requests
Mostly agree. Although I must say that my first impression when I saw the thread's title, "Cookbook recipes requests", I thought "great idea!"delta wrote:Well, hm. It's true that stuff on the forum is really not that easy to find, but making a cookbook recipe of every styling or configuration one-liner is totally not feasible either.
In order to make this post at least a bit useful for Formedras, here goes a specific answer
That's the easiest one. For any kind of window, you adjust the transparency by playing with the alpha channel in the window's background property. Specifically, for the text window displayed by say statements, you can adjust that property on a per-character basis: adding the argument window_background="#000000FF" would make the window black, fully opaque; while something like window_background="#0000FF40" would make it blue, 25% opaque (75% transparent). I think (but I'm not sure of this), that this property is inherited from style.say_window, so setting the property there should define the default for all say windows that don't define their own background.Formedras wrote:2.) How do I set the transparency level of the text window?
Sorry, but I've been unable to figure this one outFormedras wrote:1.) How do I place the character's name ABOVE the text window, like on Wikipedia's entry on Ren'Py?
I have failed to meet my deadlines so many times I'm not announcing my projects anymore. Whatever I'm working on, it'll be released when it is ready 
- 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: Cookbook Recipes requests
To get two window mode, you set the show_two_window argument to Character to true.
Code: Select all
init python:
e = Character("Eileen", show_two_window=True)
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: Cookbook Recipes requests
From the Cookbook index:herenvardo wrote:Formedras' requests in particular are so specific and might be more appropriatelly answered here
In other words, what I was asking was probably EXACTLY the kind of thing that should be in the cookbook. It's specific, and it's pretty likely to be used by more than just me. What do other people think? (Actually look at the Cookbook page rather than just using the quote I pulled to make your decision.)Note that many of these are meant to accomplish specific tasks, and aren't very good examples of Ren'Py code that is used to write games.
And if it isn't, then why the heck is there such an easy and obvious thing such as having the game developer preset fullscreen? (After all, you're already supposed to be looking at everything ELSE in the options.rpy file.)
Anyway, I've got one more request; probably something only Py'Tom can answer, and even more likely something that really DOESN'T belong in the Cookbook, since it's has no foreseeable purpose, except possibly to prep a Ren'Py game to play on PS3 Linux on an SDTV or EDTV or for some crazy person (and I've thought a lot about this...) to try to port Ren'Py to XBMC to use on XBMC for Xbox. (No, I don't think that is possible, since XBMC for Xbox doesn't use SDL.)
Here it is: How does a scriptwriter destruct the Ren'Py game's screen and construct a new one with the same content? (The purpose of this would be to shrink the resolution of an 800x600 game down to 640x480, which doesn't actually change the screen size.)
The best way to do this, probably, would be to have an init python block to have a PS3 Linux SDTV user insert into each game's "game" directory so that the dev doesn't have to worry about it. I already know how to change the game's resolution live, but I don't know how to change the window's.
This, of course, is more of a player's request than a developer's, and it doesn't make sense for me to ask since I don't have a PS3 and I've already noted that the likelyhood of Ren'Py for XBMC is virtually nil due to the nature of both programs. It's just something that's been bugging me for a couple of days.
- 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: Cookbook Recipes requests
One can scale the screen down by setting the RENPY_SCALE_FACTOR environment variable to an appropriate number for example, to scale an 800x600 game to 640x480, you'd set RENPY_SCALE_FACTOR to 640.0 / 800.0 = 0.8
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: Cookbook Recipes requests
Thanks again, PyTom. I noticed one thing about the show_two_window code while I was copying it over to the cookbook. (Yes, I still think it's cookbook-worthy.)
You gave an "init python" but made the Eileen character starting with a $. Isn't that some sort of syntax error? Shouldn't it be one or the other but not both?
You gave an "init python" but made the Eileen character starting with a $. Isn't that some sort of syntax error? Shouldn't it be one or the other but not both?
- 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: Cookbook Recipes requests
Yeah, I do occasionally make mistakes. Sorry about that!
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
Who is online
Users browsing this forum: Bing [Bot], Ocelot, Sergei Falcon

