NaNoRenO Support Thread

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.
Message
Author
User avatar
PyTom
Ren'Py Creator
Posts: 16096
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:

#16 Post by PyTom »

Ack. I changed that recently. It's now something like:

Code: Select all

$ style.menu_choice.hover_color = (255, 255, 0, 255) # yellow
$ style.menu_choice.idle_color = (0, 255, 255, 255) # cyan
Change the colors to fit your purposes. I'll update the documentation when I get a chance. Sorry about that... this changed recently. Well, sorta recently.

The problem with the "with" statement and clause is that there's an awfully large number of ways in which things can transition. So I needed a syntax that was powerful enough to express most of them. Suggestions for improvements are always appreciated.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

PixelWrangler
Regular
Posts: 103
Joined: Wed Mar 16, 2005 11:00 pm
Location: Swimming in the sea of electronic dots
Contact:

#17 Post by PixelWrangler »

I tripped over the color issue a while back... there was actually a thread elsewhere on the Lemmasoft forums that got me back up and running.

The only element I'm having trouble with right now is the Yes/No Header... I want to put a background behind it (a semi-transparent Solid), but can't figure out how to address it correctly.

Another issue I ran across was with the PROMPT functionality... when you set the prompt window to a semi-transparent color, it "ghosts" the characters when you backspace over them. Not sure why, but I changed the prompt box background to a solid color, and it works fine now.

Also, when you are positioning game menus and the like, is there a way to do so absolutely, rather than with ypos-[number] statements?

I'll puzzle over the whole syntax thing and see if I can come up with anything. The two things I'd like to be able to do are transition out an individual text box and position objects relative to other objects.

with quickdissolve e "Ow... that hurt..." with dissolve # quickly fades in the text, then fades it out more gradually after user clicks.
with dissolve player "Are you okay?" # waits for the previous text to finish transition, then fades in the player's words. Since no transition specified after, the text will do the normal "pop-out" when the user clicks.

show owie_birds at 'eileen stunned'(xpos,ypos - 100) with dissolve # display birds 100 pixels higher up and at the same horizontal position as 'eileen stunned'.

Mind you, I really don't know the underpinnings of Python and/or the PyGame implementation, so I'm not sure how feasible any of this actually is. :)

P.W.
Life is hard.
Except in ren'ai games.
Then it's a whole lot softer.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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:

#18 Post by PyTom »

PixelWrangler wrote: The only element I'm having trouble with right now is the Yes/No Header... I want to put a background behind it (a semi-transparent Solid), but can't figure out how to address it correctly.
You can do it by setting the background property on style.yesno_window. For example:

Code: Select all

$ style.yesno_window.background = Solid((0, 0, 0, 255))
You may also want to set it to an appropriate Frame.
Another issue I ran across was with the PROMPT functionality... when you set the prompt window to a semi-transparent color, it "ghosts" the characters when you backspace over them. Not sure why, but I changed the prompt box background to a solid color, and it works fine now.
Hm... I'll check this out when I get home. Do you have a code sample. Btw, when you post Ren'Py code, post it in [ code ] [ /code ] tags (remove the spaces), so the board formats it readably.
Also, when you are positioning game menus and the like, is there a way to do so absolutely, rather than with ypos-[number] statements?
Well, ypos and xpos both take integer number of pixels from a containing widget. In the case of something that's contained by the screen, this does what you want.

For example:

Code: Select all

init:
   $ style.mm_menu_window.ypos = 10
   $ style.mm_menu_window.xpos = 20

show space ninja attacking at Position(xpos=42, ypos=37)
You still may need to adjust the xanchor and yanchor properties in conjunction with this.
I'll puzzle over the whole syntax thing and see if I can come up with anything. The two things I'd like to be able to do are transition out an individual text box and position objects relative to other objects.
You can transition out a text box... try code like:

Code: Select all

e "Old soldiers never die, they just fade away..."

with dissolve
On two lines like that.

Relative positioning is harder. I'll try to address it eventually, but it's not a top priority. I'll probably try to come up with some sort of general image manipulation framework for Ren'Py. So one could write something like:

Code: Select all

image foo = im.Composite((0, 0), Image("bar.jpg:"), (100, 50), Image("baz.jpg"))
Probably won't happen for a while, tho.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Guest

#19 Post by Guest »

PyTom wrote:
PixelWrangler wrote: The only element I'm having trouble with right now is the Yes/No Header... I want to put a background behind it (a semi-transparent Solid), but can't figure out how to address it correctly.
You can do it by setting the background property on style.yesno_window. For example:

Code: Select all

$ style.yesno_window.background = Solid((0, 0, 0, 255))
You may also want to set it to an appropriate Frame.
I'd love to know how to use the Frame setting with the main menu and game menu to encapsulate all of the options, and the yes/no window to reduce its size. I've set the background of the yes/no window before. However...

1. When I set the yes/no window background, then click "yes", the application "boops" as it exits... not sure why.

2. I'm interested in putting the background behind the "Are you sure you want to exit the game?" text as well as the whole area. The whole area would work as well (even a little better), but I'd like to know how to do it for the header text itself as well (if possible).
PyTom wrote:
Another issue I ran across was with the PROMPT functionality... when you set the prompt window to a semi-transparent color, it "ghosts" the characters when you backspace over them. Not sure why, but I changed the prompt box background to a solid color, and it works fine now.
Hm... I'll check this out when I get home. Do you have a code sample. Btw, when you post Ren'Py code, post it in [ code ] [ /code ] tags (remove the spaces), so the board formats it readably.
Sorry about the lack of code tags... just forgot to do it with the theoretical code... I've done it in the past (see earlier this thread), just not this time. Gomen. :(

The code is the same format as in the tutorial:

Code: Select all

$ name = renpy.input("What is your name?", "Joe User", length=20)
The prompt dialog comes up in the dialog box, which is a semi-transparent PNG graphic defined in the same way as the tutorial game. The ghosting occurs when a character is "removed" via a backspace or delete, and the effect is cumulative (multiple passes = multiple remnants), and there are semi-transparent dashes at the bottom of each space where a letter is/was.

P.W.

PixelWrangler
Regular
Posts: 103
Joined: Wed Mar 16, 2005 11:00 pm
Location: Swimming in the sea of electronic dots
Contact:

#20 Post by PixelWrangler »

Was going to edit the above for run-on sentences... but I forgot to log in again. :P

If I think of it later, I'll try to re-create the condition and post a screenshot.

P.W.
Life is hard.
Except in ren'ai games.
Then it's a whole lot softer.

Post Reply

Who is online

Users browsing this forum: Amazon [Bot], Bing [Bot]