#💬 _retroidʹs Feedback
1 messages · Page 1 of 1 (latest)
local function fillShape(path2D: Path2D, center_offset_x, center_offset_y)
local fill_folder = Instance.new("Frame", path2D.Parent.Parent)
fill_folder.Position = path2D.Parent.Position
fill_folder.Size = path2D.Parent.Size
fill_folder.Transparency = 1
fill_folder.BorderSizePixel = 0
fill_folder.Name = path2D.Name.."_Fill"
fill_folder.AnchorPoint = path2D.Parent.AnchorPoint
for scaleFactor=1, .01, -.01 do
local newpath = Instance.new("Path2D", path2D.Parent)
local newPoints = {}
for i, v: Path2DControlPoint in path2D:GetControlPoints() do
local newPos = UDim2.fromScale(v.Position.X.Scale*scaleFactor+center_offset_x*(1-scaleFactor), v.Position.Y.Scale*scaleFactor+center_offset_y*(1-scaleFactor))
table.insert(newPoints,Path2DControlPoint.new(newPos))
end
newpath.Closed = true
newpath.ZIndex = path2D.ZIndex + 1
newpath:SetControlPoints(newPoints)
newpath.Thickness = path2D.Thickness
newpath.Color3 = path2D.Color3
newpath.Parent = fill_folder
task.wait()
end
-- Get center
local cover_mid = Instance.new("Frame", path2D.Parent)
cover_mid.Size = UDim2.fromScale(.02,.02)
cover_mid.BackgroundColor3 = path2D.Color3
cover_mid.BorderSizePixel = 0
cover_mid.Position = UDim2.fromScale(center_offset_x,center_offset_y)
cover_mid.Parent = fill_folder
cover_mid.Name = path2D.Name.."_Fill"
cover_mid.AnchorPoint = Vector2.new(center_offset_x,center_offset_y)
cover_mid.ZIndex = path2D.ZIndex + 1
end
fillShape(game.StarterGui.GraphScreenUI.GraphContainer.Outer,.5,.5)