newbie with questions
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
-
- Newbie
- Posts: 8
- Joined: Tue Jul 25, 2006 5:55 pm
- Contact:
newbie with questions
Hi I'm new to Ren'Py and I'm trying my darnest to figure it out and I think I'm doing pretty good so far. But I have a question. I'm trying to make a simple BL visual novel and so far the programing is doing good but I won't know is there any way that i could have a character portrait apper above the frame but only for a couple scence where I'd have art taking up the whole screen and the characters would be off screen.
I'm not sure I'm explaining this right so I made picuter to show sorta what I want http://chibialex.com/blog/muffin.jpg
The muffin would be the art the, yellow box would be the text frame and the balck and white image is the charater portrait.
Thanks in advance for the help.
I'm not sure I'm explaining this right so I made picuter to show sorta what I want http://chibialex.com/blog/muffin.jpg
The muffin would be the art the, yellow box would be the text frame and the balck and white image is the charater portrait.
Thanks in advance for the help.
-
- Veteran
- Posts: 290
- Joined: Thu Jun 29, 2006 2:10 pm
- Projects: Elect: Ascendance
- Location: Philippines
- Contact:
Hiya!
Im new here myself. Dont know if this will help you any but you might want to check this thread of jake's: http://lemmasoft.renai.us/forums/viewtopic.php?t=1149
It has a way to show portraits and the like. Maybe there's a way you could only use it for part-game.
Im new here myself. Dont know if this will help you any but you might want to check this thread of jake's: http://lemmasoft.renai.us/forums/viewtopic.php?t=1149
It has a way to show portraits and the like. Maybe there's a way you could only use it for part-game.
Jake's system should work. If you don't want to use the whole thing, though, here's what PyTom gave me when I asked for the same system :
Put this somewhere in your script (around your initialization parts).
Then create a Character object for each portrait/character:
This creates a character named "Marie", which displays a portrait "marie.jpg" with text padded 148 pixels to the right (so it isn't over the portrait).
Then all you have to do is go
Code: Select all
init -50:
python:
def side_say(who, what, side=None, **kwargs):
if side:
ui.layer('faces');
ui.image(side, xpos=10, ypos=589, xanchor='left', yanchor='bottom') # define the position of portraits here
ui.close();
renpy.display_say(who, what, **kwargs)
$ config.transient_layers = ['transient','faces']
$ config.layers = ['master','transient','overlay','faces']
Then create a Character object for each portrait/character:
Code: Select all
init:
$ marie = Character("Marie", function=side_say, side='marie.jpg', window_left_padding=148)
Then all you have to do is go
Code: Select all
marie "I'm talking with a portrait on my left."
- 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:
While the code I gave monele will work in most cases, it might fail in some odd cases, like when used with the {p} or {w} text tags. Here's an updated version:
Use it like:
I will probably be releasing an updated version of this code as an extra with 5.5.4, a version that supports predictive loading of the side image.
In general, the function= argument of Charcter is deprecated, in favor of show_function=. This is a fairly new change.
Code: Select all
init -1:
python:
def side_show_say(who, what,
who_args={},
what_args={},
window_args={},
image=False,
side=None,
**kwargs):
ui.window(**window_args)
ui.hbox()
if side:
ui.image(side)
ui.vbox(style='say_vbox')
if who:
if image:
renpy.ui.add(renpy.display.im.image(who, loose=True, **who_args))
else:
renpy.ui.text(who, **who_args)
rv = renpy.ui.text(what, **what_args)
ui.close()
ui.close()
return rv
Code: Select all
init:
$ e = Character(u'Eileen', color=(200, 255, 200, 255),
show_function=side_show_say,
show_side="cyan.png")
In general, the function= argument of Charcter is deprecated, in favor of show_function=. This is a fairly new change.
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?)
Software > Drama • https://www.patreon.com/renpytom
- 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:
Yeah, the problem is that Character and the associated functions have turned into a real mess. Probably in 5.6 I'll be reorganizing that whole thing, which may lead to some incompatible changes, but will probably lead to better code when the whole thing is done.
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?)
Software > Drama • https://www.patreon.com/renpytom
-
- Newbie
- Posts: 8
- Joined: Tue Jul 25, 2006 5:55 pm
- Contact:
-
- Newbie
- Posts: 8
- Joined: Tue Jul 25, 2006 5:55 pm
- Contact:
- 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:
The way to have multiple portraits with my code is to declare multiple characters. So you can declare heather_happy, heather_sad, heather_mad, and so on as separate Characters, with separate side images.
The Character class is somewhat misnamed, as it's less the representation of a single character, and more a way of saying how dialogue is shown to the user.
The Character class is somewhat misnamed, as it's less the representation of a single character, and more a way of saying how dialogue is shown to the user.
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?)
Software > Drama • https://www.patreon.com/renpytom
Example code :
Then
(note : just replace "function" by "show_function" and "side" by "show_side"... my code is a bit old ^^)
Code: Select all
$ kat = Character("kat_name", function=side_say, side='kat.png')
$ katmad = Character("kat_name", function=side_say, side='katmad.png')
$ kathap = Character("kat_name", function=side_say, side='kathap.png')
Code: Select all
kat "What do you mean ?"
katmad "Are you making fun of me ?!"
kathap "Oh it was just a joke !"
(note : just replace "function" by "show_function" and "side" by "show_side"... my code is a bit old ^^)
-
- Newbie
- Posts: 8
- Joined: Tue Jul 25, 2006 5:55 pm
- Contact:
ok I think I under stand.
So the set up in the init would be
init -1:
python:
def side_show_say(who, what,
who_args={},
what_args={},
window_args={},
image=False,
side=None,
**kwargs):
ui.window(**window_args)
ui.hbox()
if side:
ui.image(side)
ui.vbox(style='say_vbox')
if who:
if image:
renpy.ui.add(renpy.display.im.image(who, loose=True, **who_args))
else:
renpy.ui.text(who, **who_args)
rv = renpy.ui.text(what, **what_args)
ui.close()
ui.close()
return rv
init: #Peter's mugshot
$ pete = Character("peter_name", function=side_say, side='peter_port.png')
$ peteblush= Character("peter_name", function=side_say, side='petemad.png')
$ petehap = Character("peter_name", function=side_say, side='peterhap.png')
then to call it in the game it would be
pete "What do you mean ?"
petemad "Are you making fun of me ?!"
petehap "Oh it was just a joke !"
no have to use the show or hide commands? How would i turn off the portrates? Coudl I still do it with the hide comand? I'm sorry I'm pester everone with this. And there more question after this but first I want to get this nailed down
So the set up in the init would be
init -1:
python:
def side_show_say(who, what,
who_args={},
what_args={},
window_args={},
image=False,
side=None,
**kwargs):
ui.window(**window_args)
ui.hbox()
if side:
ui.image(side)
ui.vbox(style='say_vbox')
if who:
if image:
renpy.ui.add(renpy.display.im.image(who, loose=True, **who_args))
else:
renpy.ui.text(who, **who_args)
rv = renpy.ui.text(what, **what_args)
ui.close()
ui.close()
return rv
init: #Peter's mugshot
$ pete = Character("peter_name", function=side_say, side='peter_port.png')
$ peteblush= Character("peter_name", function=side_say, side='petemad.png')
$ petehap = Character("peter_name", function=side_say, side='peterhap.png')
then to call it in the game it would be
pete "What do you mean ?"
petemad "Are you making fun of me ?!"
petehap "Oh it was just a joke !"
no have to use the show or hide commands? How would i turn off the portrates? Coudl I still do it with the hide comand? I'm sorry I'm pester everone with this. And there more question after this but first I want to get this nailed down
Ain't looking in details (*darn tired @_@*) but it looks about right. Don't forget to indent lines in blocks though.
And you don't need to hide portraits that are displayed using this. They just appear along with the text, and only with that text.
If you mean having text with no portrait, well... just create a regular Character object I guess ?
And you don't need to hide portraits that are displayed using this. They just appear along with the text, and only with that text.
If you mean having text with no portrait, well... just create a regular Character object I guess ?
- 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:
That's right, except you want to use show_function instead of function, and show_side instead of side. But the basic idea is right.
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?)
Software > Drama • https://www.patreon.com/renpytom
Who is online
Users browsing this forum: No registered users