Utility
Utility methods and extra library features.
Custom Cursor

Enable the custom cursor to render the Obsidian-styled pointer at your mouse position -- handy for experiences that hide or replace Roblox's default cursor.
Library.ShowCustomCursor = trueThese functions allow you to set your own image instead of the default custom cursor.
Library:ChangeCursorIcon(ImageId: string)
-- If you need to change the cursor icon size:
Library:ChangeCursorIconSize(Size: UDim2)
-- To reset it back, use this function:
Library:ResetCursorIcon()Icons
Icons originate from the lucide icon pack. You can change the icon library so long as you call it before creating any UI elements and it follows the expected return data.
local Library = require(game:GetService("ReplicatedStorage"):WaitForChild("Obsidian"))
local Icons = require(game:GetService("ReplicatedStorage"):WaitForChild("Lucide"))
-- Set Library Icon Module
Library:SetIconModule(Icons)The direct lucide module can be found here. (Our automation updates the icon spritesheet each month)
Custom Icon Registry
If you'd like to make your own custom Icon Module, make sure it follows these types:
type Icon = {
Url: string,
Id: number,
IconName: string,
ImageRectOffset: Vector2,
ImageRectSize: Vector2,
}
type IconModule = {
Icons: { string },
GetAsset: (Name: string) -> Icon?,
}
local Icons: IconModule = {
Icons: {}
}
function Icons.GetAsset(Name: string)
return nil
end
return IconsObsidian is dependent on a few icons to be able to be displayed properly. Please make sure you have icons named:
check(Toggles)chevron-up(Dropdowns)move-diagonal-2(Window Resizing Icon bottom right of the window)key(Key System Tab Icon)search(Searchbar)move(Window movement Icon top right of the window)
Custom Asset Icons
If you'd like to use custom hosted images (like those on Github) with a Roblox Asset ID as a fallback, you can use the built-in ImageManager:
local ImageManager = Library.ImageManagerImageManager requires the FileSystem and getcustomasset functions to properly download the images. If neither is available, it falls back to the provided Roblox Asset ID. If the saved image won't load properly, it will not fallback to the provided Roblox Asset ID.
AddAsset
Adds a custom asset to the ImageManager
ImageManager.AddAsset("mspaint_logo", 95816097006870, "https://www.mspaint.cc/icon.png")| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Asset Name | string | nil |
| 2 | Roblox Asset ID | number | nil |
| 3 | Asset URL | string | nil |
| 4 | Force Redownload | boolean? | nil |
GetAsset
Retrieves the asset ID for the provided asset
local AssetID = ImageManager.GetAsset("mspaint_logo")| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Asset Name | string | nil |
DownloadAsset
Downloads the asset image to the workspace folder
This runs automatically in AddAsset, so you don't need to call it separately (unless you want to redownload the asset image)
ImageManager.DownloadAsset("mspaint_logo")| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Asset Name | string | nil |
| 2 | Force Redownload | boolean? | nil |
Menu Keybind
In Obsidian, there is a helper field that you can set that allows you to easily bind a Keybind to toggle the main window.
MenuGroup:AddLabel("Menu bind"):AddKeyPicker("MenuKeybind", {
Default = "RightShift",
NoUI = true,
Text = "Menu keybind"
})
Library.ToggleKeybind = Options.MenuKeybind Lifecycle
OnUnload
Registers a callback that fires when the library is unloaded via Library:Unload().
Library:OnUnload(function()
print("Library was unloaded!")
end)| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Callback to fire on unload | function | nil |
Unload
Disconnects all signals registered with GiveSignal, fires all OnUnload callbacks, destroys tooltips and the ScreenGui, and sets Library.Unloaded = true.
Library:Unload()GiveSignal
Registers an RBXScriptConnection so it is automatically disconnected when Library:Unload() is called.
Library:GiveSignal(RunService.RenderStepped:Connect(function()
-- your code
end))| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Connection to track | RBXScriptConnection | nil |
Toggle
Toggles the main window visibility. This is a convenience wrapper around Window:Toggle().
Library:Toggle()| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Force a specific state | boolean? | nil |
Theme & Registry
SetFont
Changes the font used across the entire library.
Library:SetFont(Enum.Font.GothamMedium)
-- or
Library:SetFont(Font.fromEnum(Enum.Font.GothamMedium))| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | The font to apply | Font | Enum.Font | nil |
SetNotifySide
Changes which side of the screen notifications appear on.
Library:SetNotifySide("Left")| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Side to show notifications | "Left" | "Right" | "Right" |
SetDPIScale
Sets the DPI scale for the entire library. The value is treated as a percentage (100 = normal).
Library:SetDPIScale(125) -- 125% scale| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | DPI scale percentage | number | 100 |
AddToRegistry
Registers a GuiObject so its properties are automatically updated when the theme changes.
Library:AddToRegistry(MyFrame, {
BackgroundColor3 = "MainColor",
})| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | The GUI instance to track | GuiObject | nil |
| 2 | Property-to-scheme-key mapping | table | nil |
RemoveFromRegistry
Removes a GuiObject from the theme registry.
Library:RemoveFromRegistry(MyFrame)| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | The GUI instance to untrack | GuiObject | nil |
UpdateColorsUsingRegistry
Re-applies the current scheme to every registered instance. Called automatically when the theme changes.
Library:UpdateColorsUsingRegistry()Color Helpers
GetBetterColor
Adjusts a color's value (brightness) by the given amount.
local adjusted = Library:GetBetterColor(Color3.new(1, 0, 0), 0.1)| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Base color | Color3 | nil |
| 2 | Value adjustment amount | number | nil |
GetLighterColor
Returns a slightly lighter version of the given color.
local lighter = Library:GetLighterColor(Library.Scheme.MainColor)| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Base color | Color3 | nil |
GetDarkerColor
Returns a slightly darker version of the given color.
local darker = Library:GetDarkerColor(Library.Scheme.MainColor)| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Base color | Color3 | nil |
Misc Helpers
SafeCallback
Wraps a function call in error handling. If the call errors and Library.NotifyOnError is true, a notification is shown.
Library:SafeCallback(myFunction, arg1, arg2)| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Function to call | function | nil |
| ... | Arguments to pass | any | nil |
GetTextBounds
Calculates the pixel dimensions of a text string with the given font and size.
local width, height = Library:GetTextBounds("Hello", Library.Scheme.Font, 14, 200)| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Text to measure | string | nil |
| 2 | Font to use | Font | nil |
| 3 | Text size | number | nil |
| 4 | Max width constraint | number? | nil |
Properties
These are notable properties on the Library object that you can read or set:
Prop
Type