#Wondering how or if i can improve this?

1 messages · Page 1 of 1 (latest)

amber gorge
#
for _, selectionFrame in editFrame.editOptions.displayType:GetChildren() do
    if selectionFrame:IsA("Frame") == false then continue end
    selectionFrame.TextButton.MouseButton1Click:Connect(function()
        editFrame(selectionFrame)
    end)
    selectionFrame.TextButton.TouchTap:Connect(function()
        editFrame(selectionFrame)
    end)
end

Is this the best way to make mobile support with surface guis? is there a better way?

fickle sandalBOT
#

studio** You are now Level 23! **studio

hushed pecan
#

you could format it a lil bit better

#
for _, sFrame in editFrame.editOptions.displayType:GetChildren() do
   if not sFrame:Is("Frame") then continue end
   
   sFrame.TextButton.MouseButton1Click:Connect(function()
       editFrame(sFrame)
   end)
   sFrame.TextButton.TouchTap:Connect(function()
       editFrame(sFrame)
   end)
end
#

and you could check if it's from mobile then add touchtap only, if it's from pc add mousebutton1click

#

but the performance loss is basically zero