Skip to content

Commit

Permalink
feat(ui): added a bouncing ring on condensed waypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
metamethods committed Nov 28, 2024
1 parent b45c89e commit f16caf2
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/ui/init.luau
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ local function ui(
return if distance() >= config.maxFadeDistance then 0 else 1
end

local ringOffset = vide.source(0)

vide.cleanup(RunService.RenderStepped:Connect(function()
distance(localPlayer:DistanceFromCharacter(waypoint.position))
ringOffset(math.abs(math.sin(tick() * 2)))
end))

if waypoint.highlights then
Expand Down Expand Up @@ -76,6 +79,26 @@ local function ui(
BackgroundColor3 = waypoint.color,
BackgroundTransparency = vide.spring(circleTransparency, 0.5),

vide.create "Frame" {
Name = "Ring",
Size = function()
return UDim2.new(1, ringOffset() * 15, 1, ringOffset() * 15)
end,
Position = UDim2.fromScale(0.5, 0.5),
AnchorPoint = Vector2.new(0.5, 0.5),
BackgroundTransparency = 1,

vide.create "UICorner" {
CornerRadius = UDim.new(1, 0),
},

vide.create "UIStroke" {
Color = waypoint.color,
Thickness = 1,
Transparency = vide.spring(circleTransparency, 0.5),
},
},

vide.create "UICorner" {
CornerRadius = UDim.new(1, 0),
},
Expand Down

0 comments on commit f16caf2

Please sign in to comment.