Created
May 25, 2022 17:41
-
-
Save howmanysmall/ef36995e5f558bd02c4c2317b0eb48df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local ReplicatedStorage = game:GetService("ReplicatedStorage") | |
local Llama = require(ReplicatedStorage.Shared.Vendor.Llama) | |
local Roact = require(ReplicatedStorage.Shared.Vendor.Roact) | |
local Types = require(ReplicatedStorage.Shared.Types) | |
export type IEdgeRoundedProps = { | |
-- EdgeRounded Properties | |
RoundedEdge: "Bottom" | "Left" | "Right" | "Top", | |
} & Types.IImageLabelProps | |
local Llama_Dictionary_merge = Llama.Dictionary.merge | |
local ROUNDED_EDGE_PROPS = { | |
Bottom = { | |
Image = "rbxassetid://9709027706", | |
RoundedEdge = Llama.None, | |
ScaleType = Enum.ScaleType.Slice, | |
SliceCenter = Rect.new(4, 4, 252, 252), | |
}, | |
Left = { | |
Image = "rbxassetid://9709027859", | |
RoundedEdge = Llama.None, | |
ScaleType = Enum.ScaleType.Slice, | |
SliceCenter = Rect.new(4, 4, 252, 252), | |
}, | |
Right = { | |
Image = "rbxassetid://9709027943", | |
RoundedEdge = Llama.None, | |
ScaleType = Enum.ScaleType.Slice, | |
SliceCenter = Rect.new(4, 4, 252, 252), | |
}, | |
Top = { | |
Image = "rbxassetid://9709028011", | |
RoundedEdge = Llama.None, | |
ScaleType = Enum.ScaleType.Slice, | |
SliceCenter = Rect.new(4, 4, 252, 252), | |
}, | |
} | |
local DEFAULT_PROPS = { | |
BackgroundTransparency = 1, | |
} | |
local function EdgeRounded(props: IEdgeRoundedProps) | |
return Roact.createElement( | |
"ImageLabel", | |
Llama_Dictionary_merge(DEFAULT_PROPS, props, ROUNDED_EDGE_PROPS[props.RoundedEdge]) | |
) | |
end | |
return EdgeRounded |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment