-
-
Notifications
You must be signed in to change notification settings - Fork 2
API: Interface
Assetify provides a suite of API functionalities designed to include customizable input and scroll events, allowing users to seamlessly integrate these features into their external resources without the need for manual scripting. Additionally, the Interface module incorporates intelligent memory management such as automatically collect unused fonts/textures etc to free them after a designated idle period, thereby enhancing memory efficiency and ensuring a streamlined performance.
Add the below code globally once in either of the shared .lua
script of the resource you want to use within:
loadstring(exports.assetify_library:import("interface"))()
-
✨ Retrieves cursor's absolute position.
local float: x, float: y, float: world_x, float: world_y, float: world_z = assetify.interface.getCursorPosition()
-
✨ Verifies cursor's position.
local bool: state = assetify.interface.isCursorAtPosition( float: x, float: y, float: width, float: height )
-
✨ Creates font instance.
🚨 This entity is automatically collected and deleted post 3 seconds of inactivity to optimize memory management. Therefore, if you wish to retain it, you will need to call it each time you intend to use it rather than relying on caching.local font: cFont = assetify.interface.createFont( string: path, float: size )
-
✨ Verifies whether a key is pressed.
local bool: state = assetify.interface.isKeyOnHold( string: key )
-
✨ Verifies whether a key is clicked.
local bool: state = assetify.interface.isKeyClicked( string: key )
-
✨ Verifies whether mouse is scrolled.
local string: state = assetify.interface.isMouseScrolled()
-
✨ Registers key's click state.
local bool: state = assetify.interface.registerKeyClick( string: key )
-
✨ Registers mouse's scroll state.
local bool: state = assetify.interface.registerMouseScroll()