mirror of
https://github.com/Ukendio/jecs.git
synced 2026-03-18 00:44:32 +00:00
31 lines
545 B
Text
31 lines
545 B
Text
|
|
local vide = require(script.Parent.Parent.Parent.Parent.vide)
|
||
|
|
local container = require(script.Parent.container)
|
||
|
|
|
||
|
|
local read = vide.read
|
||
|
|
|
||
|
|
type can<T> = T | () -> T
|
||
|
|
type props = {
|
||
|
|
|
||
|
|
gap: can<number>,
|
||
|
|
direction: can<"x" | "y">?,
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
return function(props: props)
|
||
|
|
|
||
|
|
local function direction()
|
||
|
|
return read(props.direction) or "x"
|
||
|
|
end
|
||
|
|
|
||
|
|
return container {
|
||
|
|
|
||
|
|
Size = function()
|
||
|
|
return if direction() == "x" then
|
||
|
|
UDim2.new(0, read(props.gap), 1, 0)
|
||
|
|
else
|
||
|
|
UDim2.new(1, 0, 0, read(props.gap))
|
||
|
|
end
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
end
|