Skip to content

API: Interface

ov - Aviril edited this page Mar 9, 2025 · 12 revisions

» Overview

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.

» Importing

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"))()

» APIs

  • assetify.interface.getCursorPosition - client

    Retrieves cursor's absolute position.

    local float: x, float: y, float: world_x, float: world_y, float: world_z = assetify.interface.getCursorPosition()
  • assetify.interface.isCursorAtPosition - client

    Verifies cursor's position.

    local bool: state = assetify.interface.isCursorAtPosition(
      float: x,
      float: y,
      float: width,
      float: height
    )
  • assetify.interface.createFont - client

    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
    )
  • assetify.interface.isKeyOnHold- client

    Verifies whether a key is pressed.

    local bool: state = assetify.interface.isKeyOnHold(
       string: key
    )
  • assetify.interface.isKeyClicked- client

    Verifies whether a key is clicked.

    local bool: state = assetify.interface.isKeyClicked(
       string: key
    )
  • assetify.interface.isMouseScrolled - client

    Verifies whether mouse is scrolled.

    local string: state = assetify.interface.isMouseScrolled()
  • assetify.interface.registerKeyClick - client

    Registers key's click state.

    local bool: state = assetify.interface.registerKeyClick(
       string: key
    )
  • assetify.interface.registerMouseScroll - client

    Registers mouse's scroll state.

    local bool: state = assetify.interface.registerMouseScroll()