character image on the textbox?
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.
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.
character image on the textbox?
i know this is a popular question but i cant find any tutorial that looks like it would work with the new version of renpy ://
i would like to have my protagonists sprite on the side of the text box, but only their, and only when they talk.
i need to make a character specific text box for that? do i need to mess up with different files?
i would like to have my protagonists sprite on the side of the text box, but only their, and only when they talk.
i need to make a character specific text box for that? do i need to mess up with different files?
Re: character image on the textbox?
ok i dont know if its the new version or if im messing it up but im using this. https://www.renpy.org/doc/html/side_image.html the invisible character section.
and the code there looks like this
define p = Character("Player", image="player")
image side player happy = "side_player_happy.png"
image side player concerned = "side_player_concerned.png"
label start:
p happy "This is shown with the 'side player happy' image."
my code looks like this
define m = Character('Max', color="#ffffff", image="max")
image side max neutral = ("side_max_neutral.png")
label start:
m neutral ".{w=0.2}.{w=0.2}."
and i get an error that no image tag is associated with the speaking character
and the code there looks like this
define p = Character("Player", image="player")
image side player happy = "side_player_happy.png"
image side player concerned = "side_player_concerned.png"
label start:
p happy "This is shown with the 'side player happy' image."
my code looks like this
define m = Character('Max', color="#ffffff", image="max")
image side max neutral = ("side_max_neutral.png")
label start:
m neutral ".{w=0.2}.{w=0.2}."
and i get an error that no image tag is associated with the speaking character
- Divona
- Miko-Class Veteran
- Posts: 678
- Joined: Sun Jun 05, 2016 8:29 pm
- Completed: The Falconers: Moonlight
- Organization: Bionic Penguin
- itch: bionicpenguin
- Contact:
Re: character image on the textbox?
The only way for me to replicate the error is to remove image="max" out of Character(), or define the same character again without the use of image="max". The code you provided above is fine, the problem is likely to be else where in your code.
Re: character image on the textbox?
i ended up doingDivona wrote:The only way for me to replicate the error is to remove image="max" out of Character(), or define the same character again without the use of image="max". The code you provided above is fine, the problem is likely to be else where in your code.
define m = Character('Max', color="#ffffff", image= "max")
image side max = "side_max.png"
m ".{w=0.2}.{w=0.2}."
and it works??
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3636
- Joined: Mon Dec 14, 2015 5:05 am
- Location: Your monitor
- Contact:
Re: character image on the textbox?
I don't know if using the new GUI makes a difference, as I am still using the old GUI, even though I've updated renpy, so please keep that in mind.
Anyway, renpy still does as expected when I use the following:
$ Eileen = Character(None, show_side_image=Image("images/Eileen_side_image.png", xalign=0.01, yalign=0.99))
This is positioned for a 1280x720 screen, adjust as neccessary using the xalign / yalign variables.
What this does, is every time I define "Eileen" to be speaking, it'll show a "side image" every time only that character speaks.
For example, the following was made with the new GUI:
http://puu.sh/t2eEJ/b97986e43d.png
It's not aligning as expected though...
E: Okay, after a few quick tests, it seems the new GUI doesn't function the same way at all. Please disregard the above post.
I have since read through file:///C:/Program%20Files%20(x86)/renpy/renpy-6.99.11-sdk/doc/side_image.html and realised how silly it was for me to comment :p
Anyway, renpy still does as expected when I use the following:
$ Eileen = Character(None, show_side_image=Image("images/Eileen_side_image.png", xalign=0.01, yalign=0.99))
This is positioned for a 1280x720 screen, adjust as neccessary using the xalign / yalign variables.
What this does, is every time I define "Eileen" to be speaking, it'll show a "side image" every time only that character speaks.
For example, the following was made with the new GUI:
http://puu.sh/t2eEJ/b97986e43d.png
It's not aligning as expected though...
Code: Select all
## The script of the game goes in this file.
## Declare characters used by this game. The color argument colorizes the name
## of the character.
define e = Character('Eileen')
$ Eileen = Character(None, show_side_image=Image("images/Eileen.png", xalign=0.5, yalign=0.99))
## The game starts here.
label start:
## Show a background. This uses a placeholder by default, but you can add a
## file (named either "bg room.png" or "bg room.jpg") to the images
## directory to show it.
scene bg room
## This shows a character sprite. A placeholder is used, but you can replace
## it by adding a file named "eileen happy.png" to the images directory.
show eileen happy
## These display lines of dialogue.
"Hello, world."
e "You've created a new Ren'Py game."
e "Once you add a story, pictures, and music, you can release it to the world!"
## This ends the game.
return
I have since read through file:///C:/Program%20Files%20(x86)/renpy/renpy-6.99.11-sdk/doc/side_image.html and realised how silly it was for me to comment :p
Who is online
Users browsing this forum: Bing [Bot], Google [Bot], minyan

