Skip to main content

DeclareComponent

A simple constructor/callback to tell Seam that you made a component

TypeSinceScoped
Declaration0.0.1No

Constructor

DeclareComponent(ComponentName : string, Constructor : (HydratedInstance : Instance, ...any) -> Instance)

Usage

DeclareComponent is used to declare components that you can later use. Components declared with this function can be called back to by using From.

Let’s assume we want to declare a component that turns a frame into a blue one. We can declare this component by typing:

DeclareComponent("BlueFrame", function(Frame : Instance)
Frame.BackgroundColor3 = Color3.fromRGB(0, 0, 255)
return Frame
end)

To use this, we can later use From, like so:

local MyFrame = New("Frame", {
--... Properties here
}, From "BlueFrame")