I want to make a moving part that scrolls partially in the moving scroll. I am currently using Dirtylarry and I am struggling alone. But I do not get what I want.
Move the entire scroll vertically before telling what you want. Partial scrolling moves horizontally. To move the partial scroll instead of the full scroll, drag the horizontal scroll. Conversely, dragging vertically will attempt to move the entire scroll.
Everything on my PC went the way I wanted, but it’s odd that it works on the phone.
The odd thing is that the scroll position changes when you touch it.
Below is the script I created.
local Lb_scroll = {
active = false,
column = true,
fav = true,
genre = true
}
function on_input(self, action_id, action)
if Lb_scroll.column then
self.scroll = larry:scrollarea("all_scroll", action_id, action, self.scroll, function(self, action_id, action) end)
self.scroll.drag = true
elseif Lb_scroll.fav then
self.scroll_fav = larry:scrollarea("fav_scroll", action_id, action, self.scroll_fav, function(self, action_id, action) end)
self.scroll_fav.drag = true
elseif Lb_scroll.genre then
self.scroll_genre = larry:scrollarea("genre_scroll", action_id, action, self.scroll_genre, function(self, action_id, action) end)
self.scroll_genre.drag = true
end
if action_id == hash("touch") then
if action.released then
Lb_scroll.column = true
Lb_scroll.fav = false
Lb_scroll.genre = false
Lb_scroll.active = false
end
if gui.pick_node(gui.get_node("fav_scroll"), action.x, action.y) and action.pressed then
print("fav pressed")
Lb_scroll.fav = true
Lb_scroll.active = true
elseif Lb_scroll.active and gui.pick_node(gui.get_node("fav_scroll"), action.x, action.y) and action.dx == 0 and action.dy ~= 0 then
print("dy")
Lb_scroll.fav = false
Lb_scroll.active = false
elseif Lb_scroll.active and gui.pick_node(gui.get_node("fav_scroll"), action.x, action.y) and action.dy == 0 and action.dx ~= 0 then
print("dx")
Lb_scroll.fav = true
Lb_scroll.genre = false
Lb_scroll.active = false
Lb_scroll.column = false
end
if gui.pick_node(gui.get_node("genre_scroll"), action.x, action.y) and action.pressed then
print("genre pressed")
Lb_scroll.genre = true
Lb_scroll.active = true
elseif Lb_scroll.active and gui.pick_node(gui.get_node("genre_scroll"), action.x, action.y) and action.dx == 0 and (action.dy >= 2 or action.dy <= -2) then
Lb_scroll.genre = false
Lb_scroll.active = false
elseif Lb_scroll.active and gui.pick_node(gui.get_node("genre_scroll"), action.x, action.y) and (action.dx >= 2 or action.dx <= -2) and action.dy == 0 then
Lb_scroll.fav = false
Lb_scroll.genre = true
Lb_scroll.active = false
Lb_scroll.column = false
end
end
end