Looping Background Animation [SOLVED]

Discuss how to employ the Ren'Py engine to create visual novels and story-based games. New releases are appear in this section.

Forum rules
This is the right place for Ren'Py help. Please ask ane question per thread, use a descriptive subject like 'NotFound error in choice.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Employ the code tag to format scripts.

User avatar

Morhighan
Miko-Class Veteran
Posts: 972
Joined: Dominicus Jun 27, 2010 12:54 pm
Completed: AIdol, When Our Journey Ends, Forgotten Not Lost
Arrangement: MysteryCorgi
Tumblr: MysteryCorgi
Deviantart: MysteryCorgi
Soundcloud: MysteryCorgi
itch: MysteryCorgi
Location: USA
Contact:

Looping Groundwork Animation [SOLVED]

#i Post by Morhighan » Thu Jul 14, 2016 9:37 am

So I have a background that is a train interior with the outside scene moving by.
I need the outside seen to loop. The artist made the image loopable, but I'm not sure how to get the animation to loop without transparency showing.
And so far I've just "cheated" by making the exterior image 5x the length of the original outside image, still I don't recall this method is the right selection.

Here is an case of what I'thou working with (with the 5x length image):
https://i.gyazo.com/1c9db9136313e05cfb2 ... a49d43.gif

Whatever suggestions would be welcome. Thank you for reading!

Final edited past Morhighan on Thu Jul 14, 2016 9:38 pm, edited 1 time in total.


User avatar

Donmai
Eileen-Form Veteran
Posts: 1917
Joined: Sun Jun 10, 2012 one:45 am
Completed: Toire No Hanako, Li'l Reddish [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Bract [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Looping Groundwork Animation

#2 Postal service by Donmai » Thu Jul 14, 2016 10:twenty am

I've used this kind of scrolling background in Li'fifty Red and in the Slumberland demo. In both cases I've used a code like this:

Lawmaking: Select all

                                      image forest run:         "bg/forest_run.jpg"         xalign 1.0         linear two.v xalign 0.0         repeat                

and an image equally shown below:

scrolling.jpg

Yous can easily edit the values to brand the epitome motility in the opposite direction, or to adjust the scrolling speed.

Image


User avatar

78909087
Veteran
Posts: 277
Joined: Sat Aug 16, 2014 two:33 pm
Completed: Dungeons and Don't Do Information technology, Wake Up
Projects: Lethe
IRC Nick: Pacermist
Contact:

Re: Looping Background Blitheness

#3 Post by 78909087 » Thu Jul fourteen, 2016 11:12 am

I'm just commenting to keep this post in my own for future projects!

I am non friends with the sun.

Image


User avatar

Morhighan
Miko-Class Veteran
Posts: 972
Joined: Sun Jun 27, 2010 12:54 pm
Completed: AIdol, When Our Journey Ends, Forgotten Not Lost
Organization: MysteryCorgi
Tumblr: MysteryCorgi
Deviantart: MysteryCorgi
Soundcloud: MysteryCorgi
crawling: MysteryCorgi
Location: U.s.a.
Contact:

Re: Looping Background Animation

#four Post past Morhighan » Thu Jul 14, 2016 2:25 pm

Donmai wrote:I've used this kind of scrolling background in Li'fifty Red and in the Slumberland demo. In both cases I've used a code similar this:

Lawmaking: Select all

                                              image wood run:         "bg/forest_run.jpg"         xalign 1.0         linear 2.5 xalign 0.0         repeat                    

and an image every bit shown below:

scrolling.jpg

You can hands edit the values to make the image move in the opposite direction, or to accommodate the scrolling speed.

And so when I practice it with the suggested

the image doesn't move at all.
I looked at my cloud blitheness and came upward with this:

Code: Select all

                  epitome interior2_exterior_loop:     contains:         "interior2_exterior"         xalign 1.0         linear 2.5 xpos 0.0         echo                

Where it'southward xpos instead of xalign. It moves, all the same there is a problem:
https://i.gyazo.com/911ace3f595be6165b6 ... f947ac.gif


User avatar

gas
Miko-Form Veteran
Posts: 838
Joined: Mon Jan 26, 2009 seven:21 pm
Contact:

Re: Looping Background Animation

#five Mail by gas » Thu Jul 14, 2016 2:54 pm

For a diagonal movement of a looping BG, I've used this

Lawmaking: Select all

                  transform scrollbg:     xanchor 0     yanchor 0     xpos 0     ypos 0     linear 2.0 xalign one.0 yalign one.0     repeat                                  

And work very nicely. You can change it at will.
The image MUST Be a double instance of the basic one, not just ane... So, if the screen is 800* 600, the image must exist 1600*600.

If you desire to debate on a reply I gave to your posts, delight QUOTE ME or i'll not exist notified most. << now cherry-red then probably you'll see it.

ten ? "RENPY"
twenty GOTO x

RUN


User avatar

Donmai
Eileen-Class Veteran
Posts: 1917
Joined: Sunday Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Scarlet [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: Looping Background Blitheness

#6 Mail past Donmai » Thu Jul 14, 2016 8:57 pm

Morhighan wrote:So when I exercise it with the suggested

the image doesn't move at all.

Delight read it again. It's written xalign in my case. :wink:

Image


User avatar

Morhighan
Miko-Grade Veteran
Posts: 972
Joined: Lord's day Jun 27, 2010 12:54 pm
Completed: AIdol, When Our Journey Ends, Forgotten Not Lost
Organization: MysteryCorgi
Tumblr: MysteryCorgi
Deviantart: MysteryCorgi
Soundcloud: MysteryCorgi
crawling: MysteryCorgi
Location: USA
Contact:

Re: Looping Groundwork Animation

#7 Post by Morhighan » Thu Jul 14, 2016 ix:25 pm

Donmai wrote:

Morhighan wrote:So when I do it with the suggested

the image doesn't motion at all.

Please read information technology again. It's written xalign in my example. :wink:

When I do that the prototype doesn't move at all. ^^;


User avatar

Morhighan
Miko-Class Veteran
Posts: 972
Joined: Sun Jun 27, 2010 12:54 pm
Completed: AIdol, When Our Journey Ends, Forgotten Not Lost
Organization: MysteryCorgi
Tumblr: MysteryCorgi
Deviantart: MysteryCorgi
Soundcloud: MysteryCorgi
itch: MysteryCorgi
Location: USA
Contact:

Re: Looping Background Animation

#8 Mail service by Morhighan » Thu Jul fourteen, 2016 nine:28 pm

gas wrote:For a diagonal motion of a looping BG, I've used this

Code: Select all

                      transform scrollbg:     xanchor 0     yanchor 0     xpos 0     ypos 0     linear 2.0 xalign 1.0 yalign 1.0     echo                                          

And work very nicely. You can alter it at will.
The prototype MUST BE a double instance of the basic 1, not merely one... So, if the screen is 800* 600, the paradigm must be 1600*600.

Hmm, the image isn't moving at all?


User avatar

Morhighan
Miko-Form Veteran
Posts: 972
Joined: Lord's day Jun 27, 2010 12:54 pm
Completed: AIdol, When Our Journey Ends, Forgotten Non Lost
Organization: MysteryCorgi
Tumblr: MysteryCorgi
Deviantart: MysteryCorgi
Soundcloud: MysteryCorgi
itch: MysteryCorgi
Location: USA
Contact:

Re: Looping Groundwork Animation

#nine Mail past Morhighan » Thu Jul 14, 2016 9:31 pm

Okay then it looks similar it works for some reason now, despite not working earlier. ^^;
This is what I used:

Code: Select all

                  epitome interior2_exterior_move:     contains:         "interior2_exterior_loop"         xalign 1.0         linear 25.0 xalign 0.0         repeat                                  

Terminate event:
https://youtu.be/7FyNfB7ecxA


User avatar

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

Re: Looping Background Animation

#10 Mail by Donmai » Fri Jul 15, 2016 7:39 am

Morhighan wrote:Okay so it looks similar it works for some reason now, despite not working before. ^^;

There wasn't whatsoever interpolation happening before, considering the offset value was xalign, and the second value in your code was marshal. What the lawmaking practise is very elementary: it simply slides the image from one side to the other, and so starts it all again. If the start and the finish of the image are identical, then we have an illusion of continuous scrolling.

Image