How to Programmatically Scroll Horizontal List of TextureRects

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By bribat123


I am having trouble finding a way to structure and programmatically scroll a horizontal list of texturerect objects. Can you please tell me how it is done?

:bust_in_silhouette: Reply From: exuin

This will work for both vertical and horizontal scrolling:

Place all of the TextureRects into a BoxContainer (HBoxContainer for horizontal scrolling). Put the BoxContainer into a ScrollContainer. In a _process function change the scroll_horizontal (or scroll_vertical) value by a constant multiplied by delta. This will scroll the ScrollContainer through code.