Page 1 of 1

Scrolling Background - How to Add Time [SOLVED]

Posted: Fri Jul 20, 2018 12:50 am
by zerixanne
Hey there! I'm fairly new to Ren'Py (and gamemaking in general), so if this has an obviously simple fix or it's some problem on my end, I apologise! I write and draw, not (usually) program.

I have a scene in which the lens will (hopefully) pan to the left or right side of the background image, depending on the menu choice chosen. (No characters are present in this scene.) My game's dimensions are set as 1280x720, so I doubled the width of the background to be 2560x720. The scene starts by showing the middle half of the BG, and I've managed to trigger it to show the leftmost half of the background after "choice_left". However, the transition is jumpy. it cuts immediately from the centre (x = 0.5) to far left (x = 0.0). Is there any way I can add time to slow down this transition, even to just 2 seconds?

My current code is as follows:

Code: Select all

    show bg city:
      xalign 0.0
I've tried adding commands like "time" and "linear" like what is done with images, though it always generates error messages or still executes an immediate cut.

Re: Scrolling Background - How to Add Time

Posted: Fri Jul 20, 2018 12:58 am
by philat
Anything more than a second is really long for a transition. If there's an error, check your indentation (four spaces for each level exactly). In your example, show is indented four spaces and xalign is indented another two (or six total), which would result in an error. It should be another four (or eight total).

Code: Select all

show bg city:
    linear 0.5 xalign 0.0

Re: Scrolling Background - How to Add Time

Posted: Fri Jul 20, 2018 1:03 am
by zerixanne
That was a pretty simple fix, how did I know// but-
Thank you so so much, it works perfectly now! I'll keep this in mind for future reference.