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);
Parameters
Section titled “Parameters”view
(required)
Section titled “view (required)”- Type:
PrismaView
- Description: The
PrismaView
to receive focus
pauseGame
(optional)
Section titled “pauseGame (optional)”- Type:
bool
- Default:
false
- Description: Optional parameter to pause the game when focus is active
Return Value
Section titled “Return Value”- Type:
bool
- Returns:
true
if focus was successfully set; otherwise,false
Usage Examples
Section titled “Usage Examples”// Simple focus without pausing the gamebool success = PrismaUI->Focus(view);if (success) { logger::info("View focused successfully");} else { logger::error("Failed to focus view");}
// Focus the view and pause the gamebool success = PrismaUI->Focus(view, true);if (success) { logger::info("View focused and game paused"); // UI is now active and game is paused} else { logger::error("Failed to focus view");}
Best Practices
Section titled “Best Practices”- Game Pause Management: Use
pauseGame = true
for menus that require full user attention - Focus Pairing: Always pair
Focus
calls with correspondingUnfocus
calls