Panning/zooming background up and down

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
Parago
Newbie
Posts: 2
Joined: Wed Aug 15, 2018 8:58 pm
Contact:

Panning/zooming background up and down

#1 Post by Parago »

I'm trying to pan over an image from bottom to top. Basically I have an image of a building and want to show the bottom first and then move to the top.

I used the following code and it seemed to work for the most part:

Code: Select all

 scene building:
        subpixel True
        yalign 1.0 
        linear 3.0  yalign 0.0
The only issue I have is that the building is too far away and I wanted to zoom in at the bottom before panning up. I tried using the zoom function but that doesn't zoom in where I want it to.

Is there a way to zoom in at a certain position and then do the panning I want?

Appreciate any help, thank you.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Panning/zooming background up and down

#2 Post by Donmai »

You can use "crop" to zoom and pan. I've attached a small project that demonstrates it. The script is commented.
Crop Demo.zip
(1.84 MiB) Downloaded 347 times
You just need to adapt it to the size of your picture and your game screen.
Sorry if that's not the effect you are after.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Parago
Newbie
Posts: 2
Joined: Wed Aug 15, 2018 8:58 pm
Contact:

Re: Panning/zooming background up and down

#3 Post by Parago »

That worked out great.

Thanks so much Donmai!

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Panning/zooming background up and down

#4 Post by Donmai »

You're welcome! I created that project in a hurry and I didn't experiment using other warpers. Now I've found out that, for better results, we should use easein (for the zoom) and easeout (for the panning) instead of linear.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

M-77
Regular
Posts: 56
Joined: Tue Sep 04, 2018 7:58 am
Contact:

Re: Panning/zooming background up and down

#5 Post by M-77 »

Hello, I want to made renpy pan above an image automatic and slow. From the bottom-left to top-right. The pic is 3840x2160 Pixel big.
Image
I have to define some "xpos" "ypos" and some with "-"? What commands, "viewpoint", "pan"? How to do this exactly? Best way to learn this is to get is shown
working. And then use it in different ways myself how i may need it.
I changed it this way, no need for the zoom in (a little scale up could be), just start in one corner left and move up to the other right, but it is not working proper:

subpixel True
size (1920, 1280) crop (0, 0, 3840, 2160) #first tuple is the size of game screen, second is size of picture in pixels
linear 9.0 crop (1.0, 0, 1920, 1280) #here we change the y coordinate over 8 seconds to pan the image up

Who can help?

M-77
Regular
Posts: 56
Joined: Tue Sep 04, 2018 7:58 am
Contact:

Re: Panning/zooming background up and down

#6 Post by M-77 »

Playing around I put it this alternative way now:
Pic is overflown from bottom left to right, takes some 12.5 sec:
[raw]scene AShipStage2A002aBig: xxx
subpixel True
yalign 1.0
linear 12 xalign 1.0
pause 12.5[/raw]
And then same from top right corner to bottom:
[raw]scene AShipStage2A002aBig:
subpixel True
xalign 1.0
linear 12 yalign 1.0
pause 12.5[/raw]
Not exactly what I wanted, but this is looking also good. I hope this helps other people. Still wait for the other way around to use it somewhere else.

Post Reply

Who is online

Users browsing this forum: decocloud, Google [Bot]