Skip to content

Instantly share code, notes, and snippets.

@howmanysmall
Created May 25, 2022 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save howmanysmall/ef36995e5f558bd02c4c2317b0eb48df to your computer and use it in GitHub Desktop.
Save howmanysmall/ef36995e5f558bd02c4c2317b0eb48df to your computer and use it in GitHub Desktop.
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