Scrolling Background - How to Add Time [SOLVED]

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
zerixanne
Newbie
Posts: 2
Joined: Fri Jul 20, 2018 12:28 am
Contact:

Scrolling Background - How to Add Time [SOLVED]

#1 Post 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.
Last edited by zerixanne on Fri Jul 20, 2018 1:04 am, edited 1 time in total.

philat
Eileen-Class Veteran
Posts: 1900
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Scrolling Background - How to Add Time

#2 Post 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

User avatar
zerixanne
Newbie
Posts: 2
Joined: Fri Jul 20, 2018 12:28 am
Contact:

Re: Scrolling Background - How to Add Time

#3 Post 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.

Post Reply

Who is online

Users browsing this forum: No registered users