Page 1 of 1

Panning/zooming background up and down

Posted: Wed Aug 15, 2018 9:11 pm
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.

Re: Panning/zooming background up and down

Posted: Thu Aug 16, 2018 10:01 am
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.

Re: Panning/zooming background up and down

Posted: Fri Aug 17, 2018 9:11 pm
by Parago
That worked out great.

Thanks so much Donmai!

Re: Panning/zooming background up and down

Posted: Sun Aug 19, 2018 8:50 pm
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.

Re: Panning/zooming background up and down

Posted: Mon Oct 08, 2018 7:02 pm
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?

Re: Panning/zooming background up and down

Posted: Tue Oct 09, 2018 2:36 pm
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.