Sleepless Interact
A 3D DUI interaction library for interacting with various entities and points in the world.
Installation
Download a release (opens in a new tab) or build the source code.
git clone https://github.com/Sleepless-Development/sleepless_interact.git
cd sleepless_interact/web
pnpm i
pnpm build
Configure
To changed the config settings, look inside imports/config.lua
-- vec4 RGBA (R: 0-255, G: 0-255, B: 0-255, A: 0-255)
config.color = vec4(28, 126, 214, 200)
-- {dict: string, txt: string} non-active sprite dictionary/texture
config.indicatorSprite = { dict = 'shared', txt = 'emptydot_32' }
-- boolean true/false use a keybind to show and hide the interactions
config.useShowKeyBind = false
-- string default key mapping for the show interactions keybind
config.defaultShowKeyBind = 'LMENU'
-- "hold" | "toggle" sets the behavior of the show interactions key bind
config.showKeyBindBehavior = 'hold'
Usage
To enable the library inside of your resource just add @sleepless_interact/init.lua
as a client_script in your fxmanifest.lua
file.
client_scripts {
'@sleepless_interact/init.lua',
}
When sleepless_interact has been imported into your script, it will make a new global:
interact
for calling sleepless_interact functions into your script.
all of the functions can also be called via exports. example: exports.sleepless_interact:addEntity(data)
You can now use the interact functions inside of your resource.