generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Gradient help?

Previous Thread :: Next Thread 
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
20 Sep 2016 07:29 PM
So yea I created top-to-bottom gradients before, then I created side-to-side, and now I can't get it to go from the top left to bottom right.. help :(

local GradientGui = Instance.new("ScreenGui", game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui"))
GradientGui.Name = "GradientGui"

local StartColor = BrickColor.new("Deep blue").Color
local EndColor = BrickColor.new("Magenta").Color

local CurrentColorAlpha = 0
local CurrentIterationCount = 0

for X = 0, 100 do
local CurrentColor = StartColor:lerp(EndColor, (CurrentColorAlpha / 100))
for Y = 0, 100 do
local GradientFrame = Instance.new("Frame", GradientGui)
GradientFrame.Name = ("GradientFrame_(X-"..X..":Y-"..Y..")")
GradientFrame.BackgroundColor3 = CurrentColor
GradientFrame.BorderColor3 = CurrentColor
GradientFrame.BorderSizePixel = 0
GradientFrame.Size = UDim2.new(0, 1, 0, 1)
GradientFrame.Position = UDim2.new(0, X, 0, Y)
if (CurrentIterationCount == 3) then
CurrentIterationCount = 0
game:GetService("RunService").RenderStepped:wait()
end
end
if (X == 50) then
game:GetService("RunService").RenderStepped:wait()
end
CurrentColorAlpha = (CurrentColorAlpha + 1)
CurrentIterationCount = (CurrentIterationCount + 1)
end
Report Abuse
iIikeyou is not online. iIikeyou
Joined: 07 Mar 2012
Total Posts: 1659
20 Sep 2016 07:31 PM
please explain the results you are seeing vs the results you want to see
Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
20 Sep 2016 07:32 PM
"then I created side-to-side, and now I can't get it to go from the top left to bottom right.. help :("

Basically I succeeded in creating a side-to-side gradient, but I want it to go from the top left to the bottom right
Report Abuse
iIikeyou is not online. iIikeyou
Joined: 07 Mar 2012
Total Posts: 1659
20 Sep 2016 07:34 PM
oh sorry
overlap
GradientFrame.Position = UDim2.new(0, X, 0, Y+X)
Report Abuse
iIikeyou is not online. iIikeyou
Joined: 07 Mar 2012
Total Posts: 1659
20 Sep 2016 07:37 PM
UDim2.new(0,X+Y,0,X+Y)
im having trouble today
Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
20 Sep 2016 07:38 PM
No I mean I should have a box that's 100 pixels by 100 pixels
But it should have a gradient of those colors from top left > bottom right
Idk why it doesn't work
Would I use your formula, but just do it 100x?
Report Abuse
iIikeyou is not online. iIikeyou
Joined: 07 Mar 2012
Total Posts: 1659
20 Sep 2016 08:01 PM
sorry i misunderstood what you meant

local GradientGui = Instance.new("ScreenGui", game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui"))
GradientGui.Name = "GradientGui"

local StartColor = BrickColor.new("Deep blue").Color
local EndColor = BrickColor.new("Magenta").Color

local CurrentIterationCount = 0

for X = 0, 100 do
for Y = 0, 100 do
local CurrentColor = StartColor:lerp(EndColor, (math.sqrt(X^2+Y^2) / 100))
local GradientFrame = Instance.new("Frame", GradientGui)
GradientFrame.Name = ("GradientFrame_(X-"..X..":Y-"..Y..")")
GradientFrame.BackgroundColor3 = CurrentColor
GradientFrame.BorderColor3 = CurrentColor
GradientFrame.BorderSizePixel = 0
GradientFrame.Size = UDim2.new(0, 1, 0, 1)
GradientFrame.Position = UDim2.new(0, X, 0, Y)
if (CurrentIterationCount == 10) then
CurrentIterationCount = 0
game:GetService("RunService").RenderStepped:wait()
end
CurrentIterationCount = (CurrentIterationCount + 1)
end
CurrentColorAlpha = (CurrentColorAlpha + 1)
end
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image