non-permanently changing side image alignment?

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
PMscenarios
Regular
Posts: 93
Joined: Sat Jul 01, 2017 11:22 pm
Completed: Whale's Waldo
Projects: In Blood, Xenopathy
Tumblr: pmscenarios
itch: pmscenarios
Contact:

non-permanently changing side image alignment?

#1 Post by PMscenarios »

I have been trying for hours now to get the side image for one of my two characters to align to the right instead of the left, and no matter what I do it seems to prefer the side image guideline already defined in screens.rpy

Neither defining the image with side image = Image("side_image.png", xalign=1.0), setting the alignment in the character itself, or writing it out works. (I also tried using the standard image and placing it on the dialogue bar, but besides that requiring me to change the text box and/or layers, it also seems to mean I need to hide the image manually every time it switches to the other character?)
I feel like I've tried every variation suggested in the different threads on side images I found when searching.

I don't want to change the "screens.rpy" statement, because I want the other side image to have the default left alignment.

Can I write an if/else statement for the screens.rpy say screen to toggle the alignment?
ImageImageImage

User avatar
wyverngem
Miko-Class Veteran
Posts: 615
Joined: Mon Oct 03, 2011 7:27 pm
Completed: Simple as Snow, Lady Luck's Due,
Projects: Aether Skies, Of the Waterfall
Tumblr: casting-dreams
itch: castingdreams
Location: USA
Contact:

Re: non-permanently changing side image alignment?

#2 Post by wyverngem »

I remember having the same issues. What cleared it up was having a transform that changed the place of the image.

So my coding is this

Code: Select all

image side Sophia_side = Image("images/sophia.png", yalign=1.0, xalign=1.0)
define s = Character("Sophia", image="Sophia_side")

define config.side_image_change_transform = change_transform

transform change_transform(old, new):
    contains:
        old
        alpha 1.0
        linear 0.3 alpha 0.0
    contains:
        new
        alpha 0.0
        linear 0.3 alpha 1.0

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]