Professional Documents
Culture Documents
UILIB. Roblox Drawing Lib
UILIB. Roblox Drawing Lib
local frameworkHook
local framework = {
connections = {},
imgCache = {},
notifications = {},
labels = {},
theme = {
accent = nHSV(28,100,99),
font = Drawing.Fonts.Plex,
fontSize = 13
},
menu = {
open = true,
fading = false,
cursor = nil,
colorClipboard = nil,
currentTab = nil,
dragStart = nVector2(),
accents = {},
hiddenDrawings = {},
sliderDragging = false,
bindingKey = false,
currentKeybind = nil,
currentSlider = nil,
currentDropdown = nil,
keybinds = {},
reservedKeybinds = {
menuKey = Enum.KeyCode.Home,
panicKey = Enum.KeyCode.End
},
flags = {},
tabs = {},
drawings = {},
initialized = false
}
}
setmetatable(framework, {
__call = function(self, key, args)
if key == "draw" then
local i = nDrawing(args.class)
for prop, val in next, args.properties do
if prop == "Color" then
if val == self.theme.accent then
insert(self.menu.accents, i)
end
end
i[prop] = val
end
if not args.hidden then
insert(self.menu.drawings, {i, args.offset})
else
insert(self.menu.hiddenDrawings, i)
end
return i
elseif key == "setImage" then
wrap(function()
if framework.imgCache[args.url] then
args.drawing["Data"] = framework.imgCache[args.url]
else
local Data = HttpGet(game, args.url) or args.url
framework.imgCache[args.url] = Data;
args.drawing["Data"] = framework.imgCache[args.url]
end
end)()
elseif key == "isInDrawing" then -- (drawing)
local MouseLocation = getMouseLocation(UserInputService)
local X1, Y1 = args.drawing.Position.X, args.drawing.Position.Y
local X2, Y2 = (args.drawing.Position.X + args.drawing.Size.X),
(args.drawing.Position.Y + args.drawing.Size.Y)
if v == args.drawing then
found = true
break
end
return found
elseif key == "udim" then -- (type, xScale, xOffset, yScale, yOffset,
relativeFrom)
if args.type == "size" then
local x
local y
if args.relativeFrom then
x = args.xScale*args.relativeFrom.Size.X+args.xOffset
y = args.yScale*args.relativeFrom.Size.Y+args.yOffset
else
x = args.xScale*screenSize.X+args.xOffset
y = args.yScale*screenSize.Y+args.yOffset
end
return nVector2(x,y)
elseif args.type == "position" then
local x
local y
if args.relativeFrom then
if find(args.relativeFrom, "Font") then
x = args.relativeFrom.Position.X + args.xScale *
args.relativeFrom.Size.X + args.xOffset
y = args.relativeFrom.Position.y + args.yScale *
args.relativeFrom.Size.y + args.yOffset
else
x = args.relativeFrom.Position.x + args.xOffset
y = args.relativeFrom.Position.y + args.yOffset
end
else
x = args.xScale * screenSize.X + args.xOffset
y = args.yScale * screenSize.Y + args.yOffset
end
return nVector2(x,y)
else
return "Non Valid Argument [1]"
end
elseif key == "lerp" then -- (item, to, time)
local elapsedTime = 0
local startIndex = {}
local connection
connection = RunService.RenderStepped:Connect(function(delta)
if elapsedTime < args.time then
elapsedTime = elapsedTime + delta
lerp()
else
connection:Disconnect()
end
end)
return args.item
elseif key == "createConnection" then -- (name, connection, callback)
if not self.connections[args.name] then
self.connections[args.name] =
args.connection:Connect(args.callback)
return self.connections[args.name]
end
elseif key == "destroyConnection" then -- (name)
if self.connections[args.name] then
self.connections[args.name]:Disconnect()
self.connections[args.name] = nil
end
elseif key == "changeAccent" then
self.theme.accent = args.accent
for i,v in next, self.menu.accents do
v.Color = args.accent
end
elseif key == "offset" then -- (int, offset)
local start = 0
if args.int == 0 then
return start
else
for i = 1, args.int, 1 do
start += args.offset
end
return start
end
elseif key == "drag" then
local mousePosition = getMouseLocation(UserInputService)
local position = nVector2(mousePosition.X-self.menu.dragStart.X,
mousePosition.Y-self.menu.dragStart.Y)
for _,v in next, self.menu.drawings do
if v ~= self.menu.cursor then
if v[2] then
if v[2][2] then
v[1].Position = nVector2(v[2][2].Position.X + v[2]
[1].X, v[2][2].Position.Y+ v[2][1].Y)
else
v[1].Position = nVector2(position.X + v[2][1].X,
position.Y + v[2][1].Y)
end
end
end
end
elseif key == "initialize" then
framework.menu.initialized = true
framework.menu.cursor = self("draw", {class = "Triangle", properties =
{
ZIndex = 999,
Filled = true,
Visible = self.menu.open,
Transparency = 1,
Color = nRGB(255,255,255)
}})
self("createConnection", {name = "cursorChanged", connection =
RunService.RenderStepped, callback = function(Input)
local mousePosition = getMouseLocation(UserInputService)
self.menu.cursor.PointA = nVector2(mousePosition.X,
mousePosition.Y)
self.menu.cursor.PointB = nVector2(mousePosition.X + 12,
mousePosition.Y + 23)
self.menu.cursor.PointC = nVector2(mousePosition.X + 23,
mousePosition.Y + 12)
end})
elseif key == "unload" then
for i,v in next, framework.connections do
v:Disconnect()
framework.connections[i] = nil
end
function framework:createWindow(args)
local window = {size = type(args.size) == "Vector2" and args.size or
nVector2(630,500), footer = args.footer or ""}
function window:showTab(tab)
if tab == framework.menu.currentTab then
return
end
if framework.menu.currentTab then
local indexCurrent = find(framework.menu.accents,
framework.menu.currentTab.title)
remove(framework.menu.accents, indexCurrent)
framework.menu.currentTab.title.Color = nRGB(153,153,153)
framework.menu.currentTab.open = false
framework.menu.currentTab = tab
framework.menu.currentTab.open = true
framework.menu.currentTab.title.Color = framework.theme.accent
insert(framework.menu.accents, framework.menu.currentTab.title)
function window:createTab(args)
local tab = {name = type(args.name) == "string" and args.name or
"placeholder", interactables = {}, content = {}, open = false, axis = {left = 20,
right = 20}}
function tab:createLabel(args)
local label = {side = args.side or "left", text = args.text or "", type
= "label", drawings = {}}
local offset = framework("udim", {type = "position", xScale = 0,
xOffset = label.side == "left" and 40 or 40 + window.tabContainerBase.Size.X/2,
yScale = 0, yOffset = tab.axis[label.side], relativeFrom =
window.tabContainerBase})
tab.axis[label.side] += 20
function label:set(text)
label.text.Text = text
label.textShadow.Text = text
end
insert(tab.content, label)
return label
end
function tab:createButton(args)
local button = {side = args.side or "left", text = args.text or "",
drawings = {}, type = "button", callback = args.callback or function() end}
local offset = framework("udim", {type = "position", xScale = 0,
xOffset = button.side == "left" and 40 or 40 + window.tabContainerBase.Size.X/2,
yScale = 0, yOffset = tab.axis[button.side], relativeFrom =
window.tabContainerBase})
function button:setText(text)
button.text.Text = text
button.textShadow.Text = text
end
tab.axis[button.side] += 25
insert(tab.interactables, button)
insert(tab.content, button)
return button
end
function tab:createToggle(args)
local toggle = {side = args.side or "left", text = args.text or "",
state = args.default or false, drawings = {}, type = "toggle", flag = args.flag or
"", callback = args.callback or function() end}
local offset = framework("udim", {type = "position", xScale = 0,
xOffset = toggle.side == "left" and 20 or 20 + window.tabContainerBase.Size.X/2,
yScale = 0, yOffset = tab.axis[toggle.side], relativeFrom =
window.tabContainerBase})
function toggle:setText(text)
toggle.drawings.textLabel.Text = text
toggle.drawings.textLabelShadow.Text = text
end
function toggle:set(val)
toggle.state = val
if toggle.state then
toggle.drawings.button.Color = framework.theme.accent
insert(framework.menu.accents, toggle.drawings.button)
else
local IDX = find(framework.menu.accents,
toggle.drawings.button)
if IDX then
remove(framework.menu.accents, IDX)
end
toggle.drawings.button.Color = nRGB(36,36,36)
end
toggle.callback(toggle.state)
end
toggle:set(toggle.state)
function toggle:toggle()
toggle.state = not toggle.state
if toggle.state then
toggle.drawings.button.Color = framework.theme.accent
insert(framework.menu.accents, toggle.drawings.button)
else
local IDX = find(framework.menu.accents,
toggle.drawings.button)
if IDX then
remove(framework.menu.accents, IDX)
end
toggle.drawings.button.Color = nRGB(36,36,36)
end
toggle.callback(toggle.state)
end
function toggle:get()
return toggle.state
end
tab.axis[toggle.side] += 20
insert(tab.interactables, toggle)
insert(tab.content, toggle)
return toggle
end
function tab:createSlider(args)
local slider = {side = args.side or "left", text = args.text or "",
type = "slider", min = args.min or -1, value = args.default or 0, unit = args.unit
or "", max = args.max or 1, precision = args.precision or 1, drawings = {}, flag =
args.flag or "", callback = args.callback or function() end}
local offset = framework("udim", {type = "position", xScale = 0,
xOffset = slider.side == "left" and 40 or 40 + window.tabContainerBase.Size.X/2,
yScale = 0, yOffset = tab.axis[slider.side], relativeFrom =
window.tabContainerBase})
function slider:setText(text)
toggle.drawings.textLabel.Text = text
toggle.drawings.textLabelShadow.Text = text
end
function slider:set(value)
if slider.precision < 2 then
value = math.floor(value)
end
value = tonumber(string.format("%."..slider.precision.."f", value))
local spercent = 1 - ((slider.max - value) / (slider.max -
slider.min))
slider.drawings.color.Size = framework("udim", {type = "size",
xScale = spercent, xOffset = 0, yScale = 1, yOffset = -2, relativeFrom =
slider.drawings.ring0})
slider.drawings.textValue.Position = framework("udim", {type =
"position", xScale = 0, xOffset = slider.drawings.backfill.Size.X - 5, yScale = 0,
yOffset = 3, relativeFrom = slider.drawings.backfill})
slider.drawings.textValue.Text = tostring(value)..slider.unit
slider.value = value
framework.menu.flags[slider.flag] = slider.value
slider.callback(slider.value)
end
slider:set(slider.value)
function slider:refresh()
local mousePosition = getMouseLocation(UserInputService)
local rpercent = math.clamp((mousePosition.X -
slider.drawings.ring0.Position.X) / (slider.drawings.ring0.Size.X), 0, 1)
local rvalue = slider.min + (slider.max - slider.min) * rpercent
slider:set(rvalue)
end
function slider:get()
return slider.value
end
tab.axis[slider.side] += 30
insert(tab.interactables, slider)
insert(tab.content, slider)
return slider
end
function tab:createKeybind(args)
local keybind = {side = args.side or "left", text = args.text or "",
key = args.defaultKey or "", track = args.trackType or "Toggle", state = false,
drawings = {}, type = "keybind", flag = args.flag or "", callback = args.callback
or function() end}
local offset = framework("udim", {type = "position", xScale = 0,
xOffset = keybind.side == "left" and 40 or 40 + window.tabContainerBase.Size.X/2,
yScale = 0, yOffset = tab.axis[keybind.side], relativeFrom =
window.tabContainerBase})
function keybind:setKey(Input)
if Input and Input ~= "" then
local idx = find(framework.menu.accents,
keybind.drawings.buttonText)
if idx then
remove(framework.menu.accents, idx)
end
keybind.key = Input.KeyCode.Name ~= "Unknown" and
Input.KeyCode.Name or Input.UserInputType.Name
keybind.drawings.buttonText.Text = keybind.key
keybind.drawings.buttonText.Color = nRGB(206,206,206)
framework.menu.flags[keybind.flag][1] = keybind.key
else
local idx = find(framework.menu.accents,
keybind.drawings.buttonText)
if idx then
remove(framework.menu.accents, idx)
end
keybind.key = "unbound"
keybind.state = false
keybind.drawings.buttonText.Text = ""
keybind.drawings.buttonText.Color = nRGB(206,206,206)
framework.menu.flags[keybind.flag][1] = keybind.key
end
end
keybind:setKey(keybind.key)
function keybind:get()
return keybind.key, keybind.state
end
tab.axis[keybind.side] += 40
insert(framework.menu.keybinds, keybind)
insert(tab.interactables, keybind)
insert(tab.content, keybind)
return keybind
end
function tab:createDropdown(args)
local dropdown = {side = args.side or "left", text = args.text or "",
value = args.default or "", options = args.options or {}, content = {}, drawings =
{}, flag = args.flag or "", type = "dropdown", callback = args.callback or
function() end}
local offset = framework("udim", {type = "position", xScale = 0,
xOffset = dropdown.side == "left" and 40 or 40 + window.tabContainerBase.Size.X/2,
yScale = 0, yOffset = tab.axis[dropdown.side], relativeFrom =
window.tabContainerBase})
function dropdown:select(val)
dropdown.value = val
dropdown.drawings.buttonText.Text = val
dropdown.callback(val)
end
dropdown:select(dropdown.value)
function dropdown:open()
framework("setImage", {drawing = dropdown.drawings.triangle, url =
"https://raw.githubusercontent.com/yukihooked/DATA/main/triangle2down.png"})
for i,v in next, dropdown.options do
dropdown.content[i.."Ring"] = framework("draw", {class =
"Square", offset = {nVector2(0,0), dropdown.drawings.ring0}, properties = {
Size = framework("udim", {type = "size", xScale = 0,
xOffset = 155, yScale = 0, yOffset = 20, relativeFrom = dropdown.drawings.ring0}),
Position = framework("udim", {type = "position", xScale =
0, xOffset = 0, yScale = 0, yOffset = 20*i, relativeFrom =
dropdown.drawings.ring0}),
Filled = true,
Visible = tab.open,
Transparency = 1,
Color = nRGB(0,0,0)
}})
function dropdown:close()
for i,v in next, dropdown.content do
v:Remove()
dropdown.content[i] = nil
end
framework("setImage", {drawing = dropdown.drawings.triangle, url =
"https://raw.githubusercontent.com/yukihooked/DATA/main/triangle2.png"})
end
tab.axis[dropdown.side] += 40
insert(tab.interactables, dropdown)
insert(tab.content, dropdown)
return dropdown
end
function tab:createColorpicker(args)
local colorpicker = {side = args.side or "left", text = args.text or
"", value = args.default or nRGB(255,255,255), state = args.default or false,
drawings = {}, flag = args.flag or "", type = "colorpicker", callback =
args.callback or function() end}
local offset = framework("udim", {type = "position", xScale = 0,
xOffset = colorpicker.side == "left" and 40 or 40 +
window.tabContainerBase.Size.X/2, yScale = 0, yOffset = tab.axis[colorpicker.side],
relativeFrom = window.tabContainerBase})
function colorpicker:show()
end
function colorpicker:hide()
end
function colorpicker:think()
end
tab.axis[colorpicker.side] += 20
insert(tab.interactables, colorpicker)
insert(tab.content, colorpicker)
return colorpicker
end
if #framework.menu.tabs == 0 then
insert(framework.menu.tabs, tab)
window:showTab(tab)
else
insert(framework.menu.tabs, tab)
end
return tab
end
self.menu.currentDropdown:select(self.menu.currentDropdown.content[string.char(idxB
yte).."Text"].Text)
hit = true
break
end
end
if not hit then
self.menu.currentDropdown:close()
self.menu.currentDropdown = nil
end
end
if framework("isInArea", {x1 = window.base.Position.X, x2 =
window.ring0.Position.X + window.ring0.Size.X, y1 = window.ring0.Position.Y, y2 =
window.ring0.Position.Y + 24}) and self.menu.open then
local mousePosition = getMouseLocation(UserInputService)
self.menu.dragging = true
self.menu.dragStart = nVector2(mousePosition.X -
window.ring0.Position.X, mousePosition.Y - window.ring0.Position.Y)
end
for i,v in next, framework.menu.tabs do
if framework("isInDrawing", {drawing = v.button}) then
window:showTab(v)
end
end
for _,v in next, framework.menu.currentTab.interactables do
if v.type == "button" then
if framework("isInDrawing", {drawing =
v.drawings.interact}) then
v.callback()
end
elseif v.type == "toggle" then
if framework("isInArea", {x1 =
v.drawings.ring0.Position.X, x2 = v.drawings.ring0.Position.X + 175, y1 =
v.drawings.ring0.Position.Y, y2 = v.drawings.ring0.Position.Y + 10}) then
v:toggle()
end
elseif v.type == "slider" then
if framework("isInArea", {x1 =
v.drawings.ring0.Position.X, x2 = v.drawings.ring0.Position.X + 175, y1 =
v.drawings.ring0.Position.Y, y2 = v.drawings.ring0.Position.Y + 10}) then
framework.menu.sliderDragging = true
framework.menu.currentSlider = v
framework.menu.currentSlider = v
framework.menu.currentSlider:refresh()
end
elseif v.type == "keybind" then
if framework("isInDrawing", {drawing =
v.drawings.base}) then
framework.menu.bindingKey = true
framework.menu.currentKeybind = v
framework.menu.currentKeybind.drawings.buttonText.Color = framework.theme.accent
insert(framework.menu.accents,
framework.menu.currentKeybind.drawings.buttonText)
end
elseif v.type == "dropdown" then
if framework("isInDrawing", {drawing =
v.drawings.base}) then
if framework.menu.currentDropdown == v then
v:close()
framework.menu.currentDropdown = nil
else
framework.menu.currentDropdown = v
v:open()
end
end
elseif v.type == "colorpicker" then
end
end
end
end
end
end})
return window
end
function framework:createScreenLabel(args)
local screenLabel = {text = args.text or "Screen Label", position =
args.position or nVector2(95,15), drawings = {}}
function screenLabel:changeText(text)
screenLabel.text = text
screenLabel.drawings.labelShadow.Text = text
screenLabel.drawings.label.Text = text
end
insert(self.labels, screenLabel)
return screenLabel
end
local watermark = framework:createScreenLabel{text = "YUKIHOOK | " .. os.date("%X")
.. " | YUKINO"}
local watermarkConnection = framework("createConnection", {name = "watermark",
connection = RunService.Heartbeat, callback = function()
watermark:changeText("YUKIHOOK | " .. os.date("%X") .. " | YUKINO")
end})
local window = framework:createWindow{}
local tab = window:createTab{name = "aimbot"}
local label = tab:createLabel{text = "Soon"}
framework("initialize")
return framework