Page 1 of 1

Probleme using an image instead of a name on a character

Posted: Fri Jul 24, 2015 10:42 pm
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?

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

Posted: Fri Jul 24, 2015 11:32 pm
by orz
I believe it does that when it doesn't find the file. Where exactly do you have "jane_label.png" saved?

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

Posted: Sat Jul 25, 2015 1:25 am
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

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

Posted: Sun Jul 26, 2015 5:05 pm
by javiert239
Thanks, I didn't see the warning message, xD
I used the metod of the side images and work great.
Thanks again.