📚
Stitch's UI Library
  • full doc
Powered by GitBook
On this page
  • Load the base
  • Main
  • Label
  • Button
  • Toggle
  • Dropdown
  • Full Example
  • Ending

Was this helpful?

full doc

This shows you all you need to know about Stitch's UI Library

Load the base

local Library = loadstring(game:HttpGet("https://raw.githubusercontent.com/stitchTheElite/StitchUILibrary/main/ui.lua", true))()

This loads the UI so make sure to put that above anything else

Main

local main = Library:CreateWindow(text, draggable<true/false>)

This creates the frame. Make sure to put this second (after the loadstring) to change the name of your gui, change text to whatever you would like! draggable means you can move the gui across the screen. Example:

local Library = loadstring(game:HttpGet("https://raw.githubusercontent.com/stitchTheElite/StitchUILibrary/main/ui.lua", true))()

local main = Library:CreateWindow('Stitch's UI Library', true)

Label

main:CreateLabel(text, textScaled<true/false>)

this creates a label, text is the text of the label, make sure to put ' infront and after your text. textScaled means if you want the text to be on multiple lines and scale to fit (true/false) Example:

main:CreateLabel('Example', true)

Button

main:CreateButton(text, textScaled<true/false>, function()
    -- script
end)

once again, text is the text shown on the button and textScaled makes the text fit. Example:

main:CreateButton("Button", true, function()
    print("It's working!")
end)

Toggle

main:CreateToggle(text, textScaled<true/false>, function()
    -- script
end)

For the toggle, you can use the script above. toggled is true or false. so if you would do print(toggled) it will say true or false, which you can use to make things toggleable Example:

main:CreateToggle("Toggle", true, function()
    print(toggled)
end)

Dropdown

main:CreateDropdown(text, textScaled<true/false>, {table}, function(arg)
    -- script
end)

The dropdown can be a useful feature if you want to have multiple user selections but dont want to use multiple buttons. arg is used to get the current selected option. You can add more options by just adding 'option name' in the table Example:

main:CreateDropdown("Dropdown", true, {'option1','option2','option3'}, function(arg)
    print(arg)
end)

Full Example

Here's all you've learned in 1 script.

local Library = loadstring(game:HttpGet("https://raw.githubusercontent.com/stitchTheElite/StitchUILibrary/main/ui.lua", true))()

local main = Library:CreateWindow('Stitch's UI Library', true)


-- LABEL
main:CreateLabel('Example', true)

-- BUTTON
main:CreateButton("Button", true, function()
    print("It's working!")
end)

-- TOGGLE
main:CreateToggle("Toggle", true, function()
    print(toggled)
end)

-- DROPDOWN
main:CreateDropdown("Dropdown", true, {'option1','option2','option3'}, function(arg)
    print(arg)
end)

Ending

Thats all! if you need questions, join the discord below and ask away. ill respond asap (ask in #script-help tho!)

if the discord link doesnt work, please add stitch the elite#9709 on discord, thanks in advance

Last updated 4 years ago

Was this helpful?

Join the stitch.rocks Discord Server!Discord
Logo