hello everyone!
I need some help with something i’m making…
I need to automatically define button .NextSelectionDown using math.
Let me explain.
Let’s suppose we have a list!
Example;
What I need to do is this;
If I press key DOWN
This happens;
So, I already got system done, but I have to define the NextSelectionDown
So, what I need to do is this;
I have defined a number which will return the current number from 1,4 on the X list
Like this
(In every view button created)
So what I need to know is
What do I use to automatically detect what’s under me automatically
So if i’m at 1, 5 is down me.
I mean weird it should work tho im a dummy
Here’s code if you want to check;
local Count = 0
for ignore,TEMPLATE in pairs(TextureShop.ScrollingFrame:GetChildren()) do
if (TEMPLATE:isA("ImageLabel")) then
Count += 1
if (AllTemplates[Count + 1]) then
TEMPLATE.view.NextSelectionRight = AllTemplates[Count + 1].view
end
if (AllTemplates[Count - 1]) then
TEMPLATE.view.NextSelectionLeft = Count ~= 1 and AllTemplates[Count - 1].view or TextureShop.Buttons['4next']
end
if (AllTemplates[Count + 4]) then
TEMPLATE.view.NextSelectionDown = AllTemplates[Count + 4].view
end;
end
end
I’m using Count exchange of ignore because there’s a few UI tools (grid layout,list layout)
I think you should name each layer and in that way the number would be assigned according to how you decide it for sure very good work is being excellent
Could you name all of the frames a number 1-16 or put an int value numbered 1-16 inside each frame. Then use UserInputService and if the input is Enum.KeyCode.Up then look for and select a frame that is 4 higher than the current frame, if the input is Enum.KeyCode.Right then look for and select a frame that is 1 higher etc.