Advertisement
StefanBashkir

GUI Arc

Feb 8th, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. local FillCount = 100 -- how many frames
  2. local Size = 50 -- pixels^2
  3. local SG = Instance.new("ScreenGui", Game.StarterGui);
  4. local ArcTop = 300 -- Height of arc in pixels
  5. local ArcLength = 1050 -- Length of arc in pixels
  6.  
  7. for i = 0, FillCount do
  8.     local F = Instance.new("Frame");
  9.     F.Size = UDim2.new(0,Size,0,Size);
  10.     local PercentY = (i/FillCount)
  11.     local PosX = (i/FillCount) * ArcLength
  12.     local Y = math.sin(PercentY * math.pi);
  13.     F.Position = UDim2.new(0,PosX,.5,-(Y*ArcTop) );
  14.     F.Rotation = ((180/FillCount)*i) + 90;
  15.     F.Parent = SG
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement