I have a couple of Ren'Py Questions. Please assist me.

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
Red Knight

I have a couple of Ren'Py Questions. Please assist me.

#1 Post by Red Knight »

OK, I know this may sound odd, but please try to understand my problem. I got a small picture to appear in the center (It's still covered up by the text a little. How do I raise it a little higher?). Well, when the first line of text appeared, it looked fine, but when the second line appeared, (I.E., The second character started speaking) you could see the previous text behind the current text box, as the current one appeared transparent. How do I fix this? Also, to add to this issue, I could still see the "Game Start Menu" and the Pink Background while the game was "In Session", if you will. How do I fix that?

Alessio
Miko-Class Veteran
Posts: 576
Joined: Fri May 07, 2004 9:40 am
Completed: GO! Magical Boy (2006), Angelic Orbs (soundtrack)
Projects: Cyberlin (in progress)
Location: Finland
Contact:

Re: I have a couple of Ren'Py Questions. Please assist me.

#2 Post by Alessio »

As far as I remember, Ren'Py does not clean up the screen automatically, thus you should use a fullscreen picture which will delete what was there before. Alternatively, you can display the "black" scene which is a black empty screen, and only display your image afterwards (= on top of the black background).

For positioning, refer to the show command, e.g. in the demo or the manual.

Red Knight

Re: I have a couple of Ren'Py Questions. Please assist me.

#3 Post by Red Knight »

Alessio wrote:As far as I remember, Ren'Py does not clean up the screen automatically, thus you should use a fullscreen picture which will delete what was there before. Alternatively, you can display the "black" scene which is a black empty screen, and only display your image afterwards (= on top of the black background).

For positioning, refer to the show command, e.g. in the demo or the manual.
Display the "Black" Scene? How do I do that? And by on top, do you mean type the picture code in the script under the command for the Black Scene, whatever it is?

Florian
Newbie
Posts: 6
Joined: Wed Sep 05, 2007 10:40 am
Location: Germany
Contact:

Re: I have a couple of Ren'Py Questions. Please assist me.

#4 Post by Florian »

I described the usage of "black scenes" in an article, but in a slightly different context. Maybe my description helps you:

http://www.kreativrauschen.com/blog/200 ... -in-renpy/ (scroll down to "Using backgrounds with different aspect ratios")

Red Knight

Re: I have a couple of Ren'Py Questions. Please assist me.

#5 Post by Red Knight »

Thanks. Looks like I got it. Had some issues at first, but that's because I was showing the scene as a Background and not a Scene. Anyway, thanks for that. Now I need to figure out how to position the picture further above the text. The tutorial doesn't show you how to. It just tells you about truecenter, but I need it higher than that. Also, what are the other "Color Codes", if you will?

Alessio
Miko-Class Veteran
Posts: 576
Joined: Fri May 07, 2004 9:40 am
Completed: GO! Magical Boy (2006), Angelic Orbs (soundtrack)
Projects: Cyberlin (in progress)
Location: Finland
Contact:

Re: I have a couple of Ren'Py Questions. Please assist me.

#6 Post by Alessio »

Positioning: Try it like this

Code: Select all

$ pos_flowers = Position(xpos=560, ypos=343)
...
show Flowers at pos_flowers
Colors you can define yourself:

Code: Select all

image black = Solid((0, 0, 0, 255))
image white = Solid((255, 255, 255, 255))
image cyan =  Solid((100, 150, 204, 255)) 
Ah, and please change the title of your post. "I have a couple of Ren'Py Questions" is not very helpful, neither for those who want to help nor for those who are looking for solutions. See the "On Asking Questions" post at the top of this forum.

Red Knight

Re: I have a couple of Ren'Py Questions. Please assist me.

#7 Post by Red Knight »

First, I don't think I can change my Topic since I'm a Guest User. I figured these would be simple answers and I wouldn't have to keep asking. Second, I'm a total newb, because I can't get the position thing to work, and third, why are your color codes different from the actual way they're typed?

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: I have a couple of Ren'Py Questions. Please assist me.

#8 Post by Jake »

Red Knight wrote:why are your color codes different from the actual way they're typed?
What do you mean? Why "Solid((255, 255, 255, 255))" is different from "white"?

If that's the question, then it's because the former is the actual definition of a displayable (something you can show in Ren'Py) which is that colour, and the latter is just a label, a name you give it so it's easy to refer to in your script.

As it goes, though, if you're trying to use them as backgrounds there's an easier way - if you look at the 'script.rpy' in a new Ren'Py project, near the top you'll see something along the lines of:

Code: Select all

image bg black = "#000000"
If you have this defined in your init: section, then later in the main script you can:

Code: Select all

show bg black
and it'll give everything a solid black background.

It's black because #000000 is the code for black. Specifically, the first two zeros are the red component, the second two the green component and the last two the blue; the same codes are used in HTML, many graphics tools such as Paintshop Pro and Photoshop show this code in the colour picker.

(It's wise to use a two-part name and have 'bg' as the first part for backgrounds, because Ren'Py uses the first part of the image name to decide whether to 'show' an entirely new graphic, or replace one already on the screen, so if all your backgrounds start with 'bg' it will helpfully replace the existing background graphic whenever you show a new one.)
Server error: user 'Jake' not found

Red Knight

Re: I have a couple of Ren'Py Questions. Please assist me.

#9 Post by Red Knight »

Jake wrote:

Code: Select all

image bg black = "#000000"
If you have this defined in your init: section, then later in the main script you can:

Code: Select all

show bg black
and it'll give everything a solid black background.

It's black because #000000 is the code for black. Specifically, the first two zeros are the red component, the second two the green component and the last two the blue; the same codes are used in HTML, many graphics tools such as Paintshop Pro and Photoshop show this code in the colour picker.

(It's wise to use a two-part name and have 'bg' as the first part for backgrounds, because Ren'Py uses the first part of the image name to decide whether to 'show' an entirely new graphic, or replace one already on the screen, so if all your backgrounds start with 'bg' it will helpfully replace the existing background graphic whenever you show a new one.)
That # Code thing is the way they're typed. That's what I meant. The previous poster didn't use the # Code, so I couldn't understand it. Anyway, I don't have Photoshop or Paint Shop. Is there any other way to figure out the codes? Also, can you tell me how to position images? The previous method didn't work.

Scott
Regular
Posts: 35
Joined: Thu Sep 13, 2007 6:11 am
Contact:

Re: I have a couple of Ren'Py Questions. Please assist me.

#10 Post by Scott »

A quick google yields...

Requires Java: http://www.geocities.com/humblehermit3d/csapplet.html

There are also numerous freeware programs. Google something like "hex color finder".

Alessio
Miko-Class Veteran
Posts: 576
Joined: Fri May 07, 2004 9:40 am
Completed: GO! Magical Boy (2006), Angelic Orbs (soundtrack)
Projects: Cyberlin (in progress)
Location: Finland
Contact:

Re: I have a couple of Ren'Py Questions. Please assist me.

#11 Post by Alessio »

Red Knight wrote:Anyway, I don't have Photoshop or Paint Shop. Is there any other way to figure out the [color] codes?
Google is your friend:
http://www.pitt.edu/~nisg/cis/web/cgi/rgb.html
Red Knight wrote:Also, can you tell me how to position images? The previous method didn't work.
What didn't work - could you be more specific? Do you have an error message?

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: I have a couple of Ren'Py Questions. Please assist me.

#12 Post by Jake »

Red Knight wrote: That # Code thing is the way they're typed. That's what I meant. The previous poster didn't use the # Code, so I couldn't understand it. Anyway, I don't have Photoshop or Paint Shop. Is there any other way to figure out the codes?
The answer to both these things is the same, really, you just have to understand how the #-codes are reached. Basically, a colour is defined as red, green and blue components, which mix together additively (as opposed to traditional colour-mixing, which mixes together subtractively - that is, with RGB adding two colours together results in a lighter colour, with paint you usually get a darker colour).

The components range from 0 to 255 (because that's the range of numbers stored in a single byte in memory); R255, G255, B255 is the maximum colour, and thus white; R0, G0, B0 is the minimum, and thus black. R255, G255, B0 is a full yellow, because when added together, red and green make yellow. This is the same colour mixing you'll find in any computer graphics program, including MS Paint - double-click a colour in the palette, choose 'Define Custom Colours' and then read off the Red, Green and Blue values from the boxes in the lower right.

To convert RGB values to a hex (#) code, you just need to change those 0-255 decimal values to hexadecimal. If you're on Windows, you can do this by opening calculator, choosing 'Scientific' mode in the view menu, selecting 'Dec' at the top left, typing your number in, then selecting 'Hex' to convert it to hexadecimal. So R:255, G:127, B:0 (bold orange) turns out to R:FF, G:7F, B:0. Next, just concatenate them together making sure to use two characters for each number, adding a zero in front if necessary. So the #-code for bold orange is "#ff7f00".

Alessio's example created a new 'Solid' displayable, which takes as parameters the red, green, blue and alpha components of the colour. 'Alpha' also has a range of 0-255 - it doesn't denote a colour part, but how opaque the resulting colour is. So 255 is fully-opaque, and 0 is completely transparent.

I'm not really in a position to comment on the other thing, though, if you'll excuse the pun...
Server error: user 'Jake' not found

Red Knight

Re: I have a couple of Ren'Py Questions. Please assist me.

#13 Post by Red Knight »

Alessio wrote:Positioning: Try it like this

Code: Select all

$ pos_flowers = Position(xpos=560, ypos=343)
...
show Flowers at pos_flowers
That's what didn't work.

Scott
Regular
Posts: 35
Joined: Thu Sep 13, 2007 6:11 am
Contact:

Re: I have a couple of Ren'Py Questions. Please assist me.

#14 Post by Scott »

Post your code?

User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

Re: I have a couple of Ren'Py Questions. Please assist me.

#15 Post by DaFool »

I have something similar that does work

Code: Select all

$ posphilip = Position(xpos=216, xanchor=0, ypos=10, yanchor=0)
...
show sprite philip at posphilip

Post Reply

Who is online

Users browsing this forum: No registered users