What I want it to look like (a gradient when it is clipping out of the scrolling frame) ;
What it looks like ;
1 Like
Why cant you add in another frame where the gradient is?
I want the gradient to only appear when it is clipping out of the scrolling frame.
Make an image label with a gradient decal and put it on top.
I tried that but you can’t see it.
After almost half an hour, I thought of a way on how to do it, basically I check if it’s clipping and if it is, add a gradient.
Script
if ScreenUI.Buttons.Loadout.Toggle.Value then
for _, TowerIcon in ScreenUI.Menus.Loadout.Towers:GetChildren() do if TowerIcon:IsA('TextButton') then TowerIcon:Destroy() end end
Plr.PlayerGui.Gradients:ClearAllChildren()
for _, Tower in Storage.Towers:GetChildren() do
local Template = script.TowerTemplate:Clone()
Template.LabelName.Text = Tower.Name
Template.Price.Text = Tower.Price.Value .. 'S'
Template.Picture.Image = Tower.Picture.Image
Template.Name = insertZeroes(Tower.Price.Value)
Template.Parent = ScreenUI.Menus.Loadout.Towers
local p1 = Template.AbsolutePosition
local p2 = ScreenUI.Menus.Loadout.Towers.AbsolutePosition
local size = Template.AbsoluteSize
if p1.Y < p2.Y and (p1.Y + size.Y) > p2.Y then
local gradient = script.Gradient:Clone()
gradient.Size = UDim2.fromOffset(size.X,math.min(p2.Y - p1.Y,15))
gradient.Position = UDim2.fromOffset(p1.X,p2.Y)
gradient.Parent = Plr.PlayerGui.Gradients
end
Template.MouseButton1Down:Connect(function()
if selectedTower ~= Tower then
selectedTower = Tower
else
selectedTower = nil
end
end)
end
end
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.