Focus
Overview
Section titled “Overview”Sets input focus to the specified PrismaView and shows the cursor. This method activates the UI for user interaction and optionally pauses the game to provide an uninterrupted interface experience.
Syntax
Section titled “Syntax”bool Focus(PrismaView view, bool pauseGame = false, bool disableFocusMenu = false);Parameters
Section titled “Parameters”view (required)
Section titled “view (required)”- Type:
PrismaView - Description: The
PrismaViewto receive focus
pauseGame (optional)
Section titled “pauseGame (optional)”- Type:
bool - Default:
false - Description: Optional parameter to pause the game when focus is active
disableFocusMenu (optional)
Section titled “disableFocusMenu (optional)”- Type:
bool - Default:
false - Description: If
true, sets focus without activating the FocusMenu overlay. Available since 1.2.0.
Return Value
Section titled “Return Value”- Type:
bool - Returns:
trueif focus was successfully set; otherwise,false
Usage Examples
Section titled “Usage Examples”// Simple focus without pausing the gamebool success = PrismaUI->Focus(view);if (success) { SKSE::log::info("View focused successfully");} else { SKSE::log::error("Failed to focus view");}// Focus the view and pause the gamebool success = PrismaUI->Focus(view, true);if (success) { SKSE::log::info("View focused and game paused"); // UI is now active and game is paused} else { SKSE::log::error("Failed to focus view");}// Focus without showing FocusMenu overlaybool success = PrismaUI->Focus(view, false, true);if (success) { SKSE::log::info("View focused without FocusMenu");} else { SKSE::log::error("Failed to focus view");}Best Practices
Section titled “Best Practices”- Game Pause Management: Use
pauseGame = truefor menus that require full user attention - FocusMenu Control: Use
disableFocusMenu = truewhen you want focus without the overlay menu - Focus Pairing: Always pair
Focuscalls with correspondingUnfocuscalls