A Few Questions about Frames

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
Nyamo-chan
Newbie
Posts: 6
Joined: Sun Jun 11, 2006 11:15 pm
Contact:

A Few Questions about Frames

#1 Post by Nyamo-chan »

It's another newbie of Ren'Py! [Yeah, I know. That was REALLY unexpected. xD]

Anyway...my questions:

a) How do I make my own frames for a Ren'Py game?
b) Can I change my button style [I don't mean the color]? If so, how?

Thanks in advance for taking your time to read this. ^_^

[By the way, no need for a welcome, I've posted here as a guest before. XD]

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:

Re: A Few Questions about Frames

#2 Post by PyTom »

Nyamo-chan wrote:a) How do I make my own frames for a Ren'Py game?
You just create a png file, say "frame.png", with your frame inside it. You then include code in your game like:

Code: Select all

init:
     $ style.window.background = Frame("frame.png", 32, 16)
This declares the frame. The two numbers are the size of the borders in the horizontal and vertical directions, respectively... Frame stretches things that are not within these borders.

b) Can I change my button style [I don't mean the color]? If so, how?
The short answer is yes, and you probably want to do so by changing style.button.background, style.button.xminimum, and maybe other properties on style.button and style.button_text.

If you can give me an idea of what you want, I can advise you better.

Oh, and welcome anyway!
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

Nyamo-chan
Newbie
Posts: 6
Joined: Sun Jun 11, 2006 11:15 pm
Contact:

Re: A Few Questions about Frames

#3 Post by Nyamo-chan »

PyTom wrote:
Nyamo-chan wrote:a) How do I make my own frames for a Ren'Py game?
You just create a png file, say "frame.png", with your frame inside it. You then include code in your game like:

Code: Select all

init:
     $ style.window.background = Frame("frame.png", 32, 16)
This declares the frame. The two numbers are the size of the borders in the horizontal and vertical directions, respectively... Frame stretches things that are not within these borders.
So...the numbers are the pixel sizes for the directions of the borders?

PyTom wrote:
b) Can I change my button style [I don't mean the color]? If so, how?
The short answer is yes, and you probably want to do so by changing style.button.background, style.button.xminimum, and maybe other properties on style.button and style.button_text.

If you can give me an idea of what you want, I can advise you better.
I mean like, if you have a frame you made yourself, and you want the button's frames to be matching with the text. Basically, I'm asking if you can make your own frames for the buttons.

PyTom wrote:Oh, and welcome anyway!
Eheheh. Thanks.

Oh, and I have another question.

Above the main text window, is it possible to have a small box with the character who's speaking's name in it? (Wind -a breath of heart- for example.)

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:

Re: A Few Questions about Frames

#4 Post by PyTom »

Nyamo-chan wrote:So...the numbers are the pixel sizes for the directions of the borders?
Yes. Basically, the situation looks like this:

Code: Select all

A|B|C
-+-+-
D|E|F
-+-+-
G|H|I
So there are 9 regions. The numbers set how wide the various borders are, with the first number setting how wide the left and right borders are (so the width of ADG and CFI), while the second number set how tall the top and bottom borders are (the height of ABC and GHI).

When the time comes to scale a frame, A, C, G and I are not scaled at all. D and F are scaled vertically, but not horizontally, while B and H are scaled horizontally but not vertically. E is scaled in both directions.

Clear? As mud.
I mean like, if you have a frame you made yourself, and you want the button's frames to be matching with the text. Basically, I'm asking if you can make your own frames for the buttons.
Okay, you can do this by setting style.button.background to your frame. You'd also want to set style.button.hover_background to another frame, so the user gets some indication a button is selected. You need to set that second, so setting style.button.background doesn't overwrite it.

You may also want to set

style.button.xminumum and style.button.xmaximum, since if the size of the button is smaller then the non-scalable part of the frame, bad things can happen.
Above the main text window, is it possible to have a small box with the character who's speaking's name in it? (Wind -a breath of heart- for example.)
Yes. See extras/two_window_say.rpy.
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

monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#5 Post by monele »

PyTom wrote:bad things can happen
You mean like when crossing the streams ?

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:

#6 Post by PyTom »

monele wrote:You mean like when crossing the streams ?
Almost, but not quite, exactly unlike that.
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

Nyamo-chan
Newbie
Posts: 6
Joined: Sun Jun 11, 2006 11:15 pm
Contact:

#7 Post by Nyamo-chan »

Thanks for the fast response, PyTom. ^^ You're really dedicated to helping out all those confused Ren'Py users. XD

By the way, I have yet another question...I know it's not about frames, but I'm too lazy to make another thread. x.x

What are all the transitions, and do they apply to character images, too?

monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#8 Post by monele »

I'd suggest giving a look at the Ren'Py demo for a ... demo of all transitions. Those that come to mind are Fade, Dissolve, ImageTransition. I think there's some CropRight too.
And yes, they can apply to pretty much anything displayed on screen.

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:

#9 Post by PyTom »

Actually, transitions are always from an old screen to a new screen. So they, by definition, apply to everything on the screen.
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

Nyamo-chan
Newbie
Posts: 6
Joined: Sun Jun 11, 2006 11:15 pm
Contact:

#10 Post by Nyamo-chan »

monele wrote:I'd suggest giving a look at the Ren'Py demo for a ... demo of all transitions. Those that come to mind are Fade, Dissolve, ImageTransition. I think there's some CropRight too.
And yes, they can apply to pretty much anything displayed on screen.
That I did.

But I recall Eileen said something about there being more transitions...

Post Reply

Who is online

Users browsing this forum: Duhop, Google [Bot]