Image name for character instead string

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
Mirrodin
Regular
Posts: 114
Joined: Sun Mar 19, 2017 2:56 pm
Contact:

Image name for character instead string

#1 Post by Mirrodin »

Hi mates,


I try to have an image instead string for the name of the character.
In some renpy game i see that is possible but i dont know how to do that.

I tried this but not working

Code: Select all

    # 1.5 Image name
image n_invocation = "interface/nom/Invocation.png"

    # 1.1 Definition
define m_fr = Character(n_invocation, color="#c8c8ff", image="m", condition='lang == "francais"', who_xpos=500)

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: Image name for character instead string

#2 Post by xavimat »

My first guess, use {image=} text tag: https://www.renpy.org/doc/html/text.html#text-tag-image

Code: Select all

define e = Character("{image=interface/nom/Invocation.png}")
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
Mirrodin
Regular
Posts: 114
Joined: Sun Mar 19, 2017 2:56 pm
Contact:

Re: Image name for character instead string

#3 Post by Mirrodin »

It works thanks !

Post Reply

Who is online

Users browsing this forum: Google [Bot], MSN [Bot]