How do you add a image icon to character's name?

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
User avatar
darkrchaos
Regular
Posts: 28
Joined: Wed Jan 28, 2015 6:18 pm
Completed: A Few
Projects: Moe Wars: Crimson Samon
Deviantart: darkrchaos
Contact:

How do you add a image icon to character's name?

#1 Post by darkrchaos » Thu Sep 03, 2015 5:29 pm

For my big 70,000 word visual novel I'm working on I would like to add "smiley" icons somewhere near the character's name. The thing is, each character has there own smiley icon. The image wouldn't change for different emotions, but would change for different characters.

The simley icons that I want add is the small devil icon on the left of this image.
Image

I don't really care where the icon is located. I guess I would like it to the right of the name. It would probably look best at the top right corner of the text box. Is this possible?

User avatar
firecat
Miko-Class Veteran
Posts: 540
Joined: Sat Oct 25, 2014 6:20 pm
Completed: The Unknowns Saga series
Projects: The Unknown Saga series
Tumblr: bigattck
Deviantart: bigattck
Skype: bigattck firecat
Soundcloud: bigattck-firecat
Contact:

Re: How do you add a image icon to character's name?

#2 Post by firecat » Thu Sep 03, 2015 6:11 pm

darkrchaos wrote:For my big 70,000 word visual novel I'm working on I would like to add "smiley" icons somewhere near the character's name. The thing is, each character has there own smiley icon. The image wouldn't change for different emotions, but would change for different characters.

The simley icons that I want add is the small devil icon on the left of this image.
Image

I don't really care where the icon is located. I guess I would like it to the right of the name. It would probably look best at the top right corner of the text box. Is this possible?
i dont know if it has never been done but i do have an idea for it.

On: http://lemmasoft.renai.us/forums/viewto ... =51&t=9233

there is a way to make a "click to continue" icon, if you were to add that maybe it will work. however that is not the solution, you looking for. instead of making click to continue, you make it into a picture that does not mess with the chatbox.

hope that helps.
Image


Image


special thanks to nantoka.main.jp and iichan_lolbot

User avatar
Zetsubou
Miko-Class Veteran
Posts: 513
Joined: Wed Mar 05, 2014 1:00 am
Completed: See my signature
Github: koroshiya
itch: zetsuboushita
Contact:

Re: How do you add a image icon to character's name?

#3 Post by Zetsubou » Thu Sep 03, 2015 6:35 pm

I see 2 ways to do this.

1. You could use images rather than text for the character names.
ie. Make a PNG with the character's name and their emoticon next to it.
eg. mc = Character("name_label.png")

2. You could implement the logic into your say screen and add the image based on the "who" argument.
eg.

Code: Select all

screen say(who, what, side_image=None, two_window=False):
    #...screen code

    if who is not None:
        if who == 'Player 1':
            add "img/player_1_icon.png" xpos 200 ypos 200
        elif who == 'Player 2':
            add "img/player_2_icon.png" xpos 200 ypos 200
Option 1 is neater, but option 2 would allow you to keep the name as raw text, thus making it scalable.
Either way, they should both achieve what you're after.
Finished games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails

Working on:
Sable's Grimoire 2

Image

User avatar
darkrchaos
Regular
Posts: 28
Joined: Wed Jan 28, 2015 6:18 pm
Completed: A Few
Projects: Moe Wars: Crimson Samon
Deviantart: darkrchaos
Contact:

Re: How do you add a image icon to character's name?

#4 Post by darkrchaos » Thu Sep 03, 2015 8:07 pm

Zetsubou wrote:I see 2 ways to do this.

1. You could use images rather than text for the character names.
ie. Make a PNG with the character's name and their emoticon next to it.
eg. mc = Character("name_label.png")

2. You could implement the logic into your say screen and add the image based on the "who" argument.
eg.

Code: Select all

screen say(who, what, side_image=None, two_window=False):
    #...screen code

    if who is not None:
        if who == 'Player 1':
            add "img/player_1_icon.png" xpos 200 ypos 200
        elif who == 'Player 2':
            add "img/player_2_icon.png" xpos 200 ypos 200
Option 1 is neater, but option 2 would allow you to keep the name as raw text, thus making it scalable.
Either way, they should both achieve what you're after.
Wow I got responses. :O

I will go with option 1, I didn't know you replace names with pictures so easily. Thanks.

Post Reply

Who is online

Users browsing this forum: enaielei