Probleme using an image instead of a name on a character

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
javiert239
Newbie
Posts: 20
Joined: Fri Jul 24, 2015 10:34 pm
Contact:

Probleme using an image instead of a name on a character

#1 Post by javiert239 »

Hi eveyone.
I'm new and I have a little problem.
I want to use an image for the name of my characters instead of plain text. Acordding to the manuals, this would be the code:
init:
$ jane = Character("jane_label.png", image=True)

However, when I do this I don't get the images that is in the game directory but I get a plain text that said jane_label.png.
Any idea why I get this error? I have to configure something else?

User avatar
orz
Regular
Posts: 126
Joined: Tue Apr 21, 2015 10:19 pm
Contact:

Re: Probleme using an image instead of a name on a character

#2 Post by orz »

I believe it does that when it doesn't find the file. Where exactly do you have "jane_label.png" saved?

User avatar
SinnyROM
Regular
Posts: 166
Joined: Mon Jul 08, 2013 12:25 am
Projects: Blue Birth
Organization: Cosmic Static Games
Contact:

Re: Probleme using an image instead of a name on a character

#3 Post by SinnyROM »

I think you got that from the old wiki documentation (http://www.renpy.org/wiki/renpy/doc/tut ... Characters). Currently the image parameter takes in a string, the image tag (http://www.renpy.org/doc/html/dialogue.html#Character).

If you're not using side images, you can use that functionality to create an image for a name.

Code: Select all

    image side jane_name = "images/jane_name.png"
    $ j = Character("", image="jane_name")
Another way is creating and passing in a new parameter in the character definition prefixed with show_ to use in the say screen.

Code: Select all

    $ j = Character("", show_name_image="jane_name.png")

Code: Select all

screen say(who, what, side_image=None, two_window=True,
    name_image=None  # new parameter
):

    # Add the name_image to the screen
    add name_image

    # rest of code

javiert239
Newbie
Posts: 20
Joined: Fri Jul 24, 2015 10:34 pm
Contact:

Re: Probleme using an image instead of a name on a character

#4 Post by javiert239 »

Thanks, I didn't see the warning message, xD
I used the metod of the side images and work great.
Thanks again.

Post Reply

Who is online

Users browsing this forum: Amazon [Bot], Google [Bot], Ocelot, Semrush [Bot]