Cookbook Recipes requests

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
User avatar
Formedras
Regular
Posts: 40
Joined: Sat Oct 04, 2008 3:11 am
Projects: Ninja TK
Contact:

Cookbook Recipes requests

#1 Post by Formedras » Thu Oct 16, 2008 2:58 am

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?
http://www.google.com/profiles/tizalka
Current Project:
Ninja TK

User avatar
delta
Epitome of Generic
Posts: 525
Joined: Sat Dec 22, 2007 12:59 pm
Projects: yes
Contact:

Re: Cookbook Recipes requests

#2 Post by delta » Thu Oct 16, 2008 9:55 am

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.

User avatar
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

#3 Post by herenvardo » Thu Oct 16, 2008 9:57 pm

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.
Mostly agree. Although I must say that my first impression when I saw the thread's title, "Cookbook recipes requests", I thought "great idea!" :P Formedras' requests in particular are so specific and might be more appropriatelly answered here; but a thread like this might encourage people to suggest what would they think of as good additions to the Cookbook.

In order to make this post at least a bit useful for Formedras, here goes a specific answer ;):
Formedras wrote:2.) How do I set the transparency level of the text window?
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:1.) How do I place the character's name ABOVE the text window, like on Wikipedia's entry on Ren'Py?
Sorry, but I've been unable to figure this one out :(. I tried to tinker with style.say_who_window.yoffset but didn't get any useful result. Although using the show_function argument of the Character constructor should allow to achieve this, I hope there is a simpler way for it.
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 :P

User avatar
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

#4 Post by PyTom » Thu Oct 16, 2008 10:00 pm

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
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
Formedras
Regular
Posts: 40
Joined: Sat Oct 04, 2008 3:11 am
Projects: Ninja TK
Contact:

Re: Cookbook Recipes requests

#5 Post by Formedras » Fri Oct 17, 2008 2:04 am

herenvardo wrote:Formedras' requests in particular are so specific and might be more appropriatelly answered here
From the Cookbook index:
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.
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.)

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.
http://www.google.com/profiles/tizalka
Current Project:
Ninja TK

User avatar
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

#6 Post by PyTom » Fri Oct 17, 2008 2:10 am

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
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
Formedras
Regular
Posts: 40
Joined: Sat Oct 04, 2008 3:11 am
Projects: Ninja TK
Contact:

Re: Cookbook Recipes requests

#7 Post by Formedras » Fri Oct 17, 2008 2:48 am

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?
http://www.google.com/profiles/tizalka
Current Project:
Ninja TK

User avatar
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

#8 Post by PyTom » Fri Oct 17, 2008 3:01 am

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
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Ocelot, Sergei Falcon