Example place:
For Ultimate Boxing, I had a special button creator exclusively for creating buttons that don’t look ugly and have native controller support, and did a better job of scaling on mobile (ex: borders). After a rewrite, I now have a public version of it.
Here is what some of them look like without a controller:
And here is what they look like with a controller:
For a bit of example code, here is what the code for the orange button looks like:
[code]
local ButtonClass = require(game.ReplicatedStorage:WaitForChild(“ButtonClass”))
local Button = ButtonClass.new()
Button.BorderColor3 = Color3.new(1,0.5,0)
Button.BackgroundColor3 = Color3.new(1,0.7,0)
Button.Size = UDim2.new(0.2,0,0.05,0)
Button.AnchorPoint = Vector2.new(0.5,0.5)
Button.Position = UDim2.new(0.75,0,0.25,0)
Button.SizeConstraint = “RelativeYY”
Button.Text = “Test”
Button.Font = “SourceSansBold”
Button.TextScaled = true
Button.TextColor3 = Color3.new(1,1,1)
Button.TextStrokeColor3 = Color3.new(0,0,0)
Button.TextStrokeTransparency = 0
Button.Name = “TestButton”
Button.BorderSizeScale = 0.05
Button.TextPadding = UDim.new(0.05,0)
Button.ControllerIconType = “ButtonX”
Button.ControllerInput = Enum.KeyCode.ButtonX
Button.ControllerIconPosition = “Right”
Button.Parent = script.Parent
Button.MouseButton1Down:connect(function()
Button.BackgroundColor3 = Color3.new(math.random(),math.random(),math.random())
Button.BorderColor3 = Color3.new(math.random(),math.random(),math.random())
end)[/code]
Also, this was my first main “test” with meta tables, and I think it came out pretty well. Actually was able to get the module to support most of Roblox’s default API for TextButtons without having write code for each property and function.