ZSX Development
  • Homepage to Innovation
  • User Interface V2
    • Installation
      • Introduce
      • Integration for Chat
      • ZSX_Multicharacter Integration
      • Auto Installer
        • About
        • Overextended Library
    • Exports
      • Interfaces
        • Default Notifications
        • Help Notification
        • Notifications
        • Progress Bar
        • TextUI
          • Updating text & key
        • Point
        • Chat
          • AddMessage
          • AddUserMessage
        • 3D DUI
      • Storage
        • Gathering Storage
          • Get Color
          • Get Type
          • Get Options
          • Is Configuration Done
        • Get Current Screen
        • Is UI Busy
        • Gathering position of the interface
      • Threads
        • Interrupting Thread
      • Other
        • DisplayRadar
        • OpenConfiguration
        • OpenMainMenu
        • OpenSettings
        • IsPauseMenuActive
        • IsUIBusy
        • GetCurrentScreen
        • Cinematic
    • Configurating
      • Handling UI
        • Show / Hide UI
        • Disabling Interfaces
        • Disabling Interfaces type
        • Disabling configuration for Interface
        • Creating new status for HUD
        • Changing links
        • Custom Pause Menu Navbar
        • Removing Pause Menu user data
        • Adjusting new voice states
        • Changing between voice indicators
        • Adding new blacklisted weapon
        • Adding blacklist for vehicle model
        • Changing currency
      • Commands
        • Adding commands
      • Translating
        • Translating the resource
        • Adding translation to custom weapons
        • Translating component's type label
      • Handling Data
        • Adding more accounts to Displayers
        • Adding addon elements to Displayers
        • Creating job2 functionality
        • Changing default keybinds
      • AIO Options
      • Camera stuff
        • Creating new preset for Cinematic Mode
        • Creating new scenes for Main Menu
    • Snippets
      • ESX
        • Notification
        • TextUI
        • ShowAdvancedNotification
        • ShowHelpNotification
      • QBCore
        • Notification
        • ProgressBar
  • Multicharacter
    • Installation
      • Setting up the Appearance
      • Setting up the logo
      • Setting up table removal
    • Exports
      • Client
        • GetConfigValue
        • GetUserStorage
        • Logout
        • SetLocationsDisabled
        • isInMulticharacter
        • Initialize
      • Server
        • isInMulticharacter
        • Logout
    • Workers
    • Baseevents
    • FAQ
    • Translating the resource
    • Open source files
    • Common Issues
      • Common
      • ESX
      • Database
      • Other
  • User Interface
    • About
    • Notifications
    • Progressbar
    • Custom Initialization
    • Functions
  • Dealership
    • About
    • Installation
    • Adding a Store
    • Using Exclusive Content
    • Listeners
    • Configuration
Powered by GitBook
On this page
  1. User Interface V2
  2. Exports
  3. Storage

Gathering position of the interface

In the latest update, we've added some crucial event to match your other resources position.

OnPositionUpdate

That event is being called every single tick the element is being dragged and changes it's position:

RegisterNetEvent('ZSX_UI:Storage:OnPositionUpdate')
AddEventHandler('ZSX_UI:Storage:OnPositionUpdate', function(component, position, width, height)
    --@param component STRING {
    --    hud
    --    progressBar
    --    carhud
    --    notifies
    --}

    --@param position OBJECT {
    --    x: x
    --    y: y
    --}

    --@param width NUMBER (PX)
    --@param height NUMBER (PX)
    
end)

So in this example we will be handling carhud element so we can add some elements inside of it.

Mentioned code below is just an example. It's not some kind of working snippet.

RegisterNetEvent('ZSX_UI:Storage:OnPositionUpdate')
AddEventHandler('ZSX_UI:Storage:OnPositionUpdate', function(component, position, width, height)
    if component ~= "carhud" then return end -- skipping other components since we won't be using them
    SendNUIMessage({
        type = "UPDATE_MILLEAGE_POSITION",
        position = position,
        carhudDimension = {width = width, height = height}    
    })
end)

Within the JS you can simply add the handle to apply your element position and surely while having width and height of the component you can manage to do everything possible.

PreviousIs UI BusyNextThreads

Last updated 19 days ago