[SOLVED] Displaying vertical image with movement

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
Team1Player2
Newbie
Posts: 9
Joined: Tue Mar 29, 2022 4:01 am
Contact:

[SOLVED] Displaying vertical image with movement

#1 Post by Team1Player2 » Wed Oct 05, 2022 2:14 pm

Hello,

my project is using 16:9 ratio. For bg images and many cgs that is alright. But I would like to show an image with a 9:16 ratio. This means a) stretching/zooming in so only a fraction, the bottom part of the picture. And then b) I would like to tell the "camera" to slowly move upwards, still showing everything in y axis and stopping at the top of the screen.

Reading this text confuses me even though I am the one who wrote it so I will clarify like this: When first meeting a new character, I want to display an image with aspect ratio flipped. So zoomed in on the legs and then slowly travel upwards.

This is probably one of those cases where this is not a problem to do. I just simply don't know how. Any help would be appreciated.
Last edited by Team1Player2 on Wed Oct 05, 2022 3:50 pm, edited 1 time in total.

User avatar
laure44
Regular
Posts: 60
Joined: Mon Mar 08, 2021 10:55 pm
Projects: Arkan'sTower, Gemshine Lorelei!
Location: France
Contact:

Re: Displaying vertical image with movement

#2 Post by laure44 » Wed Oct 05, 2022 2:51 pm

You can easily do that with the camera statement.

Code: Select all

label start:

    camera:
        xalign 0.5 zoom 0.5    # adapt this zoom value to make sure the width of the image fully shows
        yalign 1.0    # 1.0 means that the camera will be aligned at the bottom of the screen
        linear 2 yalign 0.0    # it will take 2 seconds to go to the top.

    # ... rest of your script

    camera # using camera alone will reset the camera to its default state.
You could also replace linear with ease for a smoother movement.

Team1Player2
Newbie
Posts: 9
Joined: Tue Mar 29, 2022 4:01 am
Contact:

Re: Displaying vertical image with movement

#3 Post by Team1Player2 » Wed Oct 05, 2022 3:50 pm

Implemented, tried, tested. Works pefectly. Even found a bug I managed to introduce at some point. Thank you so much!

Post Reply

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot]