# Interface APIs (/docs/orbit-studios-resources/orbit-dynamichud-v2/interface)



# Interface APIs [#interface-apis]

Orbit Dynamic HUD 2.0 exposes four reusable client interfaces. The APIs intentionally match the common `ox_lib` method signatures, so a small compatibility bridge can keep existing call sites unchanged.

The bridge signatures follow the official ox\_lib references for [notifications](https://coxdocs.dev/ox_lib/Modules/Interface/Client/notify), [Text UI](https://coxdocs.dev/ox_lib/Modules/Interface/Client/textui), [skill checks](https://coxdocs.dev/ox_lib/Modules/Interface/Client/skillcheck), and [progress](https://coxdocs.dev/ox_lib/Modules/Interface/Client/progress).

<Callout type="info" title="Resource name">
  These examples require the folder name `orbit-dynamichud-v2`. Renaming an escrowed resource can break exports and is not supported.
</Callout>

<Cards>
  <Card title="Notifications" description="Typed notification cards, custom icons, colors, IDs, and durations." href="/docs/orbit-studios-resources/orbit-dynamichud-v2/interface/notifications" />

  <Card title="Text UI" description="Persistent interaction prompts with key markers and optional icons." href="/docs/orbit-studios-resources/orbit-dynamichud-v2/interface/text-ui" />

  <Card title="Skill Check" description="Single-step and sequential timing checks with preset or custom difficulty." href="/docs/orbit-studios-resources/orbit-dynamichud-v2/interface/skill-check" />

  <Card title="Progress Bar" description="Blocking actions with cancellation, controls, animations, and props." href="/docs/orbit-studios-resources/orbit-dynamichud-v2/interface/progress-bar" />
</Cards>

## Direct exports [#direct-exports]

Call exports from client scripts:

```lua title="resources/[custom]/client/main.lua"
exports['orbit-dynamichud-v2']:notify({
    description = 'Vehicle stored successfully.',
    type = 'success'
})

local completed = exports['orbit-dynamichud-v2']:progressBar({
    label = 'Storing vehicle',
    duration = 2500,
    canCancel = true
})
```

| DynamicHUD 2.0 export            | Compatible ox\_lib call              |
| -------------------------------- | ------------------------------------ |
| `notify(data)`                   | `lib.notify(data)`                   |
| `showTextUI(text, options)`      | `lib.showTextUI(text, options)`      |
| `hideTextUI()`                   | `lib.hideTextUI()`                   |
| `isTextUIOpen()`                 | `lib.isTextUIOpen()`                 |
| `skillCheck(difficulty, inputs)` | `lib.skillCheck(difficulty, inputs)` |
| `skillCheckActive()`             | `lib.skillCheckActive()`             |
| `cancelSkillCheck()`             | `lib.cancelSkillCheck()`             |
| `progressBar(data)`              | `lib.progressBar(data)`              |
| `progressActive()`               | `lib.progressActive()`               |
| `cancelProgress()`               | `lib.cancelProgress()`               |

## Complete ox\_lib compatibility bridge [#complete-ox_lib-compatibility-bridge]

Create this client file in each resource whose interface calls you want DynamicHUD 2.0 to handle. Existing calls such as `lib.notify(...)`, `lib.showTextUI(...)`, `lib.skillCheck(...)`, and `lib.progressBar(...)` then continue working without edits.

```lua title="resources/[custom]/client/orbit_ui_bridge.lua"
lib = lib or {}

lib.notify = function(data)
    return exports['orbit-dynamichud-v2']:notify(data)
end

lib.showTextUI = function(text, options)
    return exports['orbit-dynamichud-v2']:showTextUI(text, options)
end

lib.hideTextUI = function()
    return exports['orbit-dynamichud-v2']:hideTextUI()
end

lib.isTextUIOpen = function()
    return exports['orbit-dynamichud-v2']:isTextUIOpen()
end

lib.skillCheck = function(difficulty, inputs)
    return exports['orbit-dynamichud-v2']:skillCheck(difficulty, inputs)
end

lib.skillCheckActive = function()
    return exports['orbit-dynamichud-v2']:skillCheckActive()
end

lib.cancelSkillCheck = function()
    return exports['orbit-dynamichud-v2']:cancelSkillCheck()
end

lib.progressBar = function(data)
    return exports['orbit-dynamichud-v2']:progressBar(data)
end

-- DynamicHUD 2.0 has one progress presentation. This keeps progressCircle call sites
-- functional while rendering the DynamicHUD 2.0 progress bar.
lib.progressCircle = lib.progressBar

lib.progressActive = function()
    return exports['orbit-dynamichud-v2']:progressActive()
end

lib.cancelProgress = function()
    return exports['orbit-dynamichud-v2']:cancelProgress()
end
```

Load the bridge after `@ox_lib/init.lua` when that resource still uses other ox\_lib modules:

```lua title="resources/[custom]/fxmanifest.lua"
shared_script '@ox_lib/init.lua'

client_scripts {
    'client/orbit_ui_bridge.lua',
    'client/**/*.lua'
}

dependencies {
    'ox_lib',
    'orbit-dynamichud-v2'
}
```

If the resource uses no other ox\_lib API, remove its `@ox_lib/init.lua` line and the `ox_lib` dependency, but keep `orbit_ui_bridge.lua` first in `client_scripts`. The bridge creates `lib` when necessary. Do not remove ox\_lib from a resource that still calls callbacks, zones, menus, points, locales, or any other `lib.*` method.

<Callout type="warn" title="Scope of the bridge">
  The bridge changes interface calls only inside the resource that loads it. It does not modify ox\_lib, DynamicHUD 2.0, or another resource's Lua environment. DynamicHUD 2.0 keeps the compatible function signatures and return values, while visual-only ox\_lib options that have no DynamicHUD 2.0 equivalent use DynamicHUD 2.0's own presentation.
</Callout>

## Cleanup [#cleanup]

When your resource owns a persistent or blocking interface, clean it up during resource stop:

```lua title="resources/[custom]/client/main.lua"
AddEventHandler('onClientResourceStop', function(resourceName)
    if resourceName ~= GetCurrentResourceName() then return end

    exports['orbit-dynamichud-v2']:hideTextUI()
    exports['orbit-dynamichud-v2']:cancelSkillCheck()
    exports['orbit-dynamichud-v2']:cancelProgress()
end)
```

Never call DynamicHUD 2.0 NUI callbacks directly. The Lua interfaces own focus, timeouts, control blocking, animations, props, cleanup, and result validation.
