[Solved] Character name as image

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
thebackup
Veteran
Posts: 320
Joined: Fri Mar 27, 2009 7:36 pm
Completed: Final Week, CardioQuiz, Cafe Memoria, All I Want for Christmas is a Girlfriend, Dating Sim! Re:Mastered, Dating Sim! Luna's Lovely Summer
Projects: Memoria (on hiatus), Cafe Memoria Deux (cancelled)
Organization: PixaelSoft
itch: thebackup
Location: Southern CA
Contact:

[Solved] Character name as image

#1 Post by thebackup »

After ripping some Japanese VN's graphics, I noticed several games display the speaking character's name as an image as opposed to text.

Is it possible for Ren'Py to replace the character's name in text with an image?

I'm trying something like this:

Code: Select all

$ m = Character("Mikaela", what_prefix="\"", what_suffix="\"", who_bold=False, show_two_window=True, say_who_window="m_name.png")
Then I get:

Code: Select all

Exception: Style property say_who_window is unknown.
I try other stuff like who_window, style.say_who_window, etc... but they either crash or it simply doesn't work.
Last edited by thebackup on Sun Jan 17, 2010 5:05 am, edited 1 time in total.

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: Character name as image

#2 Post by PyTom »

Yes.

define m = Character("mikaela.png", image=True, ...)
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

thebackup
Veteran
Posts: 320
Joined: Fri Mar 27, 2009 7:36 pm
Completed: Final Week, CardioQuiz, Cafe Memoria, All I Want for Christmas is a Girlfriend, Dating Sim! Re:Mastered, Dating Sim! Luna's Lovely Summer
Projects: Memoria (on hiatus), Cafe Memoria Deux (cancelled)
Organization: PixaelSoft
itch: thebackup
Location: Southern CA
Contact:

Re: Character name as image

#3 Post by thebackup »

Thanks, got it working.

User avatar
chensterrain
Veteran
Posts: 225
Joined: Sun Oct 26, 2008 2:01 am
Completed: Lucky Rabbit Reflex!, Dusk ~A Moonlight Romance~
Projects: Edge of Elsewhere
Organization: Super63
Tumblr: supersixthree
Deviantart: chensterrain
Location: London, UK
Contact:

Re: [Solved] Character name as image

#4 Post by chensterrain »

Sorry to bump such an old topic, but I was wondering if this still works with the newest version of Ren'Py / the new say screen? I'm using the following code in an init block:

Code: Select all

define ban = Character("names/mrbanner.png", image=True)
but Ren'Py doesn't seem to recognise what I type as the name of an image, it just prints it out as text. It doesn't seem to matter what image I use or whether I put it into the root directory or its own folder. Is there anything else I need to add?

Thanks! :)

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: [Solved] Character name as image

#5 Post by PyTom »

It's been renamed to show_image. So you would write:

Code: Select all

define ban = Character("names/mrbanner.png", show_image=True)
(This was to free up the image argument for use with image attributes.)
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

User avatar
chensterrain
Veteran
Posts: 225
Joined: Sun Oct 26, 2008 2:01 am
Completed: Lucky Rabbit Reflex!, Dusk ~A Moonlight Romance~
Projects: Edge of Elsewhere
Organization: Super63
Tumblr: supersixthree
Deviantart: chensterrain
Location: London, UK
Contact:

Re: [Solved] Character name as image

#6 Post by chensterrain »

Thanks! I still seem to be having the same issue with the new code, though - the image still isn't showing up at all.

User avatar
saguaro
Miko-Class Veteran
Posts: 560
Joined: Sun Feb 12, 2012 9:17 am
Completed: Locked-In, Sunrise, The Censor
Organization: Lucky Special Games
itch: saguarofoo
Location: USA
Contact:

Re: [Solved] Character name as image

#7 Post by saguaro »

I'm also having trouble using an image for the namebox.

Code: Select all

    define b = Character("bob_name.png", show_image=True, show_two_window=True)
This displays "bob_name.png" in the namebox. Does anyone have a suggestion?

User avatar
KissOfDeath
Regular
Posts: 87
Joined: Sat Feb 04, 2012 3:50 pm
Projects: Ikofá (In Development)
Location: USA
Contact:

PROBLEM: Character name as an image

#8 Post by KissOfDeath »

I have Ren'Py 6.13.8, and I'm having the same problem, the image will not show up on the textbox for the protagonist.

I defined all the images:

Code: Select all

#Sylph
image snu = "sylnu.gif"
image sbl = "sylbl.gif"
image sco = "sylco.gif"
image sma = "sylma.gif"
image ssl = "sylsly.gif"
image ssm = "sylsm.gif"
and I've declared each of those images as well:

Code: Select all

define snu = Character("Sylph", image="sylnu.gif", show_image=True, window_left_padding=150)
define sbl = Character("Sylph", image="sylbl.gif", show_image=True, window_left_padding=150)
define sco = Character("Sylph", image="sylco.gif", show_image=True, window_left_padding=150)
define sma = Character("Sylph", image="sylma.gif", show_image=True, window_left_padding=150)
define ssl = Character("Sylph", image="sylsly.gif", show_image=True, window_left_padding=150)
define ssm = Character("Sylph", image="sylsm.gif", show_image=True, window_left_padding=150)
so that they'll all appear in the textbox on command.

Can someone please tell me exactly what I need to do to fix it? I'm a total newbie with programming so could you please keep it simple also? :|

Thank you!
"Build your own pyramids, write your own hieroglyphs." -Kendrick Lamar
-KissOfDeath

Completed:
RE:Set Episode(s) 1 and 2 (Proofreader)
*A Troll's Fairy Tale* http://lemmasoft.renai.us/forums/viewto ... 11&t=20160 (Proofreader)

sciencewarrior
Veteran
Posts: 356
Joined: Tue Aug 12, 2008 12:02 pm
Projects: Valentine Square (writer) Spiral Destiny (programmer)
Location: The treacherous Brazilian Rainforest
Contact:

Re: PROBLEM: Character name as an image

#9 Post by sciencewarrior »

Define the images like this:

Code: Select all

#Sylph
image side sylph nu = "sylnu.gif"
image side sylph bl = "sylbl.gif"
image side sylph co = "sylco.gif"
image side sylph ma = "sylma.gif"
image side sylph sl = "sylsly.gif"
image side sylph sm = "sylsm.gif"
Now you only have to declare one character, and tell it to use images "side sylph <something>"

Code: Select all

define s = Character("Sylph", image="sylph", show_image=True, window_left_padding=150)
then you pass the appropriate expression abbreviation as a tag in your say statements:

Code: Select all

s sm "One expression"
s nu "Another expression"
Keep your script in your Dropbox folder.
It allows you to share files with your team, keeps backups of previous versions, and is ridiculously easy to use.

User avatar
KissOfDeath
Regular
Posts: 87
Joined: Sat Feb 04, 2012 3:50 pm
Projects: Ikofá (In Development)
Location: USA
Contact:

Re: PROBLEM: Character name as an image

#10 Post by KissOfDeath »

I only understood how to define the images, which was the first part of what you wrote. You lost me here:
sciencewarrior wrote: Now you only have to declare one character, and tell it to use images "side sylph <something>"

Code: Select all

define s = Character("Sylph", image="sylph", show_image=True, window_left_padding=150)
then you pass the appropriate expression abbreviation as a tag in your say statements:

Code: Select all

s sm "One expression"
s nu "Another expression"
I'm sorry, I just do not understand. I've tried to do it exactly as you've said, but the images just will not show up. I've got the space for it in the textbox, all the emotions I need are defined, but I just do not get it. Meh~! I never knew programming was so arduous. This is the part I don't understand:
sciencewarrior wrote:

Code: Select all

s sm "One expression"
s nu "Another expression"
Where exactly do I define this part? Right under where I defines the

Code: Select all

define s = Character("Sylph", image="sylph", show_image=True, window_left_padding=150)
and though you said I only need to define that part once, do I need to change

Code: Select all

"Sylph, image="sylph",..."
to

Code: Select all

"Sylph, image="sylph(insert emotion initials).gif",..."
:?:

This is just all sooo confusing to me, but I really want to learn so I can write killer(as in good) VNs.
Thanks Again!
"Build your own pyramids, write your own hieroglyphs." -Kendrick Lamar
-KissOfDeath

Completed:
RE:Set Episode(s) 1 and 2 (Proofreader)
*A Troll's Fairy Tale* http://lemmasoft.renai.us/forums/viewto ... 11&t=20160 (Proofreader)

sciencewarrior
Veteran
Posts: 356
Joined: Tue Aug 12, 2008 12:02 pm
Projects: Valentine Square (writer) Spiral Destiny (programmer)
Location: The treacherous Brazilian Rainforest
Contact:

Re: PROBLEM: Character name as an image

#11 Post by sciencewarrior »

KissOfDeath wrote: This is the part I don't understand:
sciencewarrior wrote:

Code: Select all

s sm "One expression"
s nu "Another expression"
What I was trying to say is that, to show the appropriate image, when you write the dialogue, you pass the appropriate emotion tag.
When you created the character, you defined image="sylph", so when you write a line of dialogue like this:

Code: Select all

s some_emotion "Hi, this is a line of dialogue from Sylph."
Ren'py will look for an image previously defined as image side sylph some_emotion
Keep your script in your Dropbox folder.
It allows you to share files with your team, keeps backups of previous versions, and is ridiculously easy to use.

User avatar
KissOfDeath
Regular
Posts: 87
Joined: Sat Feb 04, 2012 3:50 pm
Projects: Ikofá (In Development)
Location: USA
Contact:

Re: [Solved] Character name as image

#12 Post by KissOfDeath »

Ohhhh, alrighty, I'll try that later on today. Thank you.
"Build your own pyramids, write your own hieroglyphs." -Kendrick Lamar
-KissOfDeath

Completed:
RE:Set Episode(s) 1 and 2 (Proofreader)
*A Troll's Fairy Tale* http://lemmasoft.renai.us/forums/viewto ... 11&t=20160 (Proofreader)

User avatar
KissOfDeath
Regular
Posts: 87
Joined: Sat Feb 04, 2012 3:50 pm
Projects: Ikofá (In Development)
Location: USA
Contact:

Re: [Solved] Character name as image

#13 Post by KissOfDeath »

I tried it again, but I just cannot the darn image to show up.
I think I'll just ask someone to code it for me... too much stress~!
Thank you for trying to explain this to me though. I truly appreciate it.
"Build your own pyramids, write your own hieroglyphs." -Kendrick Lamar
-KissOfDeath

Completed:
RE:Set Episode(s) 1 and 2 (Proofreader)
*A Troll's Fairy Tale* http://lemmasoft.renai.us/forums/viewto ... 11&t=20160 (Proofreader)

Post Reply

Who is online

Users browsing this forum: Bing [Bot]