UI API Reference¶
Complete API reference for the UI module.
IVXUIManager¶
Central UI management and navigation.
Properties¶
| Property | Type | Description |
|---|---|---|
Instance | IVXUIManager | Singleton instance |
CurrentPanel | IVXPanel | Active panel |
IsTransitioning | bool | Panel transition in progress |
Panel Methods¶
ShowPanel¶
Shows a panel by ID.
Example:
ShowPanel¶
Shows a panel by type.
HidePanel¶
Hides a specific panel.
HideAllPanels¶
Hides all open panels.
GoBack¶
Navigates to previous panel.
Returns: true if navigation occurred
Popup Methods¶
ShowPopup¶
Shows a simple popup.
ShowConfirmPopup¶
Shows a confirmation popup.
Returns: true if confirmed
Example:
bool confirmed = await IVXUIManager.Instance.ShowConfirmPopup(
"Delete Save?",
"This cannot be undone."
);
if (confirmed)
{
DeleteSave();
}
ShowInputPopup¶
public async Task<string> ShowInputPopup(
string title,
string placeholder = "",
string defaultValue = "")
Shows an input popup.
Returns: User input or null if cancelled
Loading Methods¶
ShowLoading¶
Shows a loading overlay.
HideLoading¶
Hides the loading overlay.
ShowLoadingAsync¶
Shows loading while a task executes.
Example:
Toast Methods¶
ShowToast¶
Shows a toast notification.
Events¶
| Event | Signature | Description |
|---|---|---|
OnPanelShown | Action<string> | Panel displayed |
OnPanelHidden | Action<string> | Panel hidden |
OnPopupOpened | Action | Popup opened |
OnPopupClosed | Action | Popup closed |
IVXPanel¶
Base class for UI panels.
Properties¶
| Property | Type | Description |
|---|---|---|
PanelId | string | Unique panel identifier |
IsVisible | bool | Visibility state |
Virtual Methods¶
protected virtual void OnShow() { }
protected virtual void OnHide() { }
protected virtual void OnBackPressed() { }
Example¶
public class MainMenuPanel : IVXPanel
{
protected override void OnShow()
{
// Refresh data when panel opens
RefreshUI();
}
protected override void OnBackPressed()
{
// Show exit confirmation
ShowExitDialog();
}
}
IVXButton¶
Enhanced button with loading and cooldown states.
Properties¶
| Property | Type | Description |
|---|---|---|
IsLoading | bool | Loading state |
CooldownRemaining | float | Cooldown time left |
Methods¶
SetLoading¶
Sets loading state with spinner.
StartCooldown¶
Starts a cooldown period.
IVXProgressBar¶
Progress bar with animations.
Methods¶
SetProgress¶
Sets progress (0-1).
SetProgressImmediate¶
Sets progress without animation.
Common UI Patterns¶
Loading Pattern¶
public async void LoadData()
{
IVXUIManager.Instance.ShowLoading("Loading...");
try
{
await LoadDataAsync();
RefreshUI();
}
catch (Exception ex)
{
IVXUIManager.Instance.ShowToast("Failed to load data");
}
finally
{
IVXUIManager.Instance.HideLoading();
}
}
Confirmation Pattern¶
public async void OnDeleteClick()
{
bool confirmed = await IVXUIManager.Instance.ShowConfirmPopup(
"Confirm",
"Delete this item?"
);
if (confirmed)
{
await DeleteItemAsync();
IVXUIManager.Instance.ShowToast("Item deleted");
}
}