Adding a side image with different expressions (ANSWERED)

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
Nayara NightRoo
Regular
Posts: 27
Joined: Wed Aug 28, 2013 12:13 pm
Projects: The Curse
Location: Spain
Contact:

Adding a side image with different expressions (ANSWERED)

#1 Post by Nayara NightRoo »

Well, hi!

The fact is I have been trying to add a side image to a character, but I have several problems:
-I need it at right.
-I need it to have different expressions.
-And I have no idea of the size it should have.

If someone could help me, I would be grateful. :)
Last edited by Nayara NightRoo on Tue Sep 03, 2013 6:13 am, edited 1 time in total.
If you can't do anything, why do you worry? And if you can do something... why do you worry?
The Curse | Honest Critique

User avatar
Talann
Regular
Posts: 132
Joined: Thu May 09, 2013 12:02 pm
Projects: Shooting Stars, REBORN
Contact:

Re: Adding a side image with different expressions

#2 Post by Talann »

I made a video quite a while ago explaining how to create side images.
You can check it out here

...And urh, sorry for my crappy voice ;-;

EDIT: I also forgot that I haven't added differen't expressions and such to the video so here is an example code for different expressions that I created for my project Shooting Stars:

Code: Select all

define t = Character('Tay', color="#c8ffc8", image="tay", window_left_padding=160,)
image side tay normal= "side_normal.png"
image side tay sad= "side_sad.png"
image side tay happy= "side_happy.png"
image side tay vhappy= "side_vhappy.png"
image side tay blush= "side_blush.png"
image side tay angry= "side_angry.png"
image side tay shocked= "side_shocked.png"

init:
    $ offScreen = Position(xpos=1, xanchor='left', ypos=0)
...And to put the side image at right, just change the xanchor and window_padding to right like this:

Code: Select all

define t = Character('Tay', color="#c8ffc8", image="tay", window_right_padding=160,)
and

Code: Select all

init:
    $ offScreen = Position(xpos=1, xanchor='right', ypos=0)

And for the size, it depends on your textbox. So probably about 187 x 160 px
This is up to you though, but that's what size I chose for mine.

Good luck!

Nayara NightRoo
Regular
Posts: 27
Joined: Wed Aug 28, 2013 12:13 pm
Projects: The Curse
Location: Spain
Contact:

Re: Adding a side image with different expressions

#3 Post by Nayara NightRoo »

Well, first of all, thank you very much! :D It seems your throat was giving you problems that day, but it's okay. ;) I tried everything and the side image does appear (though I don't have the sized image yet), but I just have one problem: the image appears at left and, worst of all, hide the text. I attach a picture so you can see it.
And here's the code I made with your help:

Code: Select all

define m = Character('Madeleine', color="#FF99CC", image="madeleine", window_right_padding=160,)
image side madeleine= "side_m1.png"
image side madeleine sad= "side_m3.png"
image side madeleine happy= "side_m2.png"
image side madeleine blush= "side_m4.png"
image side madeleine angry= "side_m5.png"
image side madeleine shocked= "side_m6.png"

init:
    $ offScreen = Position(xpos=1, xanchor='right', ypos=0)
Do you think you can help me?
Attachments
screenshot0003.png
If you can't do anything, why do you worry? And if you can do something... why do you worry?
The Curse | Honest Critique

User avatar
Talann
Regular
Posts: 132
Joined: Thu May 09, 2013 12:02 pm
Projects: Shooting Stars, REBORN
Contact:

Re: Adding a side image with different expressions

#4 Post by Talann »

Try this.

Code: Select all

define t = Character(u'Tay', window_right_padding=160, show_side_image=Image("tay.png", xalign=1.0, yalign=1.0))
If it doesn't work then try this:

Code: Select all

init:
    $ offScreen = Position(xalign=1.0, yalign=1.0)
I hope I'm not wrong

Nayara NightRoo
Regular
Posts: 27
Joined: Wed Aug 28, 2013 12:13 pm
Projects: The Curse
Location: Spain
Contact:

Re: Adding a side image with different expressions

#5 Post by Nayara NightRoo »

Yay, it worked!!! And with the first code! :o (Though I had to write in the image part: side_image, as you said on the video).
Thank you very much for all your help. :D
If you can't do anything, why do you worry? And if you can do something... why do you worry?
The Curse | Honest Critique

User avatar
silverpikachu99
Veteran
Posts: 439
Joined: Sat Jan 26, 2013 8:35 pm
Completed: #Yolo v.s #Swerve (part of worst vn ever)
IRC Nick: silverpikachu99
Tumblr: angelgod2.tumblr.com
Location: Canada
Contact:

Re: Adding a side image with different expressions (ANSWERED

#6 Post by silverpikachu99 »

I'm not sure what's wrong with mine but, it doesn't seem to work for me :( I'll show you.

Code: Select all

define t = Character(u'Tay', window_right_padding=160, show_side_image=Image("side_tay.png", xalign=1.0, yalign=1.0))
image side Tay = "side_tay.png"


init:
    $ offScreen = Position(xalign=1.0, yalign=1.0)
    
# The game starts here.
label start:

    t "You've created a new Ren'Py game."

    t "Once you add a story, pictures, and music, you can release it to the world!"

    return
I put this in and this happens :
:((
:((
What should I do?
Image
i'll cry if you yell at me
Image

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: Adding a side image with different expressions (ANSWERED

#7 Post by xavimat »

Perhaps window_right_padding=160 is not enough.
Try with window_right_padding=300 and see if there is a change. Then adjust it.
IMO this image is a little too big for a side image (but it can work, of course)
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)

Post Reply

Who is online

Users browsing this forum: Semrush [Bot]