Can I Create a Non-Parallaxing, Non-Camera Based Repeating/Tiling Background Image?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By davidpgil
:warning: Old Version Published before Godot 3 was released.

I am wondering how I can do non-parallaxing, non-camera based repeating/tiling scrolling of a Sprite and/or TextureFrame. I have a 256x256 background that is part of a cutscene that I need to use AnimationPlayer to scroll and repeat. Is this something Godot can do?

I see numerous tutorials on how to do a parallaxing background, but non on how to animate a repeating background. Any help is appreciated. Thanks!

Not sure if understand the desired effect, like animating the texture rect of a sprite with texture with repeat enabled?

eons | 2017-10-26 00:55

Yes! Your question gave me the answer. Here is the attribute I needed to animate:

davidpgil | 2017-10-26 04:04

Ok, I’ll post as an answer

eons | 2017-10-26 23:22

:bust_in_silhouette: Reply From: eons

Is possible to scroll a (repeated) texture on a sprite by moving the region rect property.
Than be done by code or even with AnimationPlayer, in the case of a Polygon2D it need to move the UV (and have one first).

Something to take into account are the ending values on the motion if a loop is used, these will need to be proportional to the size so the loop gets unnoticeable .


There are other ways too, like using shaders, here is an example using the shader graph:
http://codetuto.com/2016/07/godot-engine-shadergraph-introduction-scrolling-texture/

Thanks for adding to this post!

davidpgil | 2017-10-26 23:46