Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 26 additions & 12 deletions src/Components/ProgressBar.luau
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,7 @@ return function(Scope: Fusion.Scope<any>, Props: Props)
Scope:Frame {
Name = "ProgressFill",
Selectable = false,
Size = Scope:Spring(
Scope:Computed(function(Use)
if Use(Direction) == Enum.FillDirection.Horizontal then
return UDim2.fromScale(Use(Progress), 1)
else
return UDim2.fromScale(1, Use(Progress))
end
end),
Theme.SpringSpeed["0.5"],
Theme.SpringDampening["1"]
),
Size = UDim2.fromScale(1, 1),
AnchorPoint = Scope:Computed(function(Use)
if Use(Inverted) then
if Use(Direction) == Enum.FillDirection.Horizontal then
Expand All @@ -112,8 +102,32 @@ return function(Scope: Fusion.Scope<any>, Props: Props)
return UDim2.fromScale(0, 0)
end
end),
AutomaticSize = Enum.AutomaticSize.None,
Gradient = {
Transparency = Scope:Computed(function(Use)
if Use(Inverted) then
return NumberSequence.new{
NumberSequenceKeypoint.new(0, 1),
NumberSequenceKeypoint.new(.001, 0),
NumberSequenceKeypoint.new(1, 0),
}
else
return NumberSequence.new{
NumberSequenceKeypoint.new(0, 0),
NumberSequenceKeypoint.new(.001, 1),
NumberSequenceKeypoint.new(1, 1),
}
end
end),
Offset = Scope:Computed(function(Use)
local progress = Use(Progress)
if Use(Inverted) then
progress = 1 - progress
end
return Vector2.new(progress, 0)
end),
},
BackgroundTransparency = 0,
AutomaticSize = Enum.AutomaticSize.None,
BackgroundColor3 = Color,
Stroke = {
Color = Color3.fromRGB(255, 255, 255),
Expand Down