Preface
There is a function recently, and the requirement is: there is a list of characters in the middle, which can be slid left and right. When the character list slides, the background behind it moves relatively at a certain speed. And there are two directional arrows on the left and right sides of the sliding list. When there is a hidden part on the left (or right), the corresponding arrow needs to be displayed.
Character sliding list
ui creation
Create a hero_scroll circular list, adjust the anchor point to (0.5, 0.5), and align it in the center
Modify the Content parameters as follows:
Create a PaintItem. The child nodes include the character's name (name) and the vertical painting (paint).
Character list sliding effect
Code
local hero_Render = {}
local heroItem = {}
ui.hero_scroll = base:findco