Dill pixel provides a robust popup system through its PopupManagerPlugin. Popups can be used to display modal content, alerts, or any other overlaid UI elements.
Basic Usage
1. Create a Popup Class
First, create a class that extends the base Popup class:
2. Register the Popup
Register your popup with the popup manager in your scene’s initialize method:
Register the action in your dill-pixel.config.ts file:
Connect the action to the popup manager in your application file (or elsewhere):
Send the action from anywhere:
Popup Configuration
When showing a popup, you can pass configuration options:
Handling Popup Events
The popup manager provides several signals you can listen to:
Focus Management
Popups automatically manage keyboard focus when shown. The popup’s content will be focused, and focus will be trapped within the popup until it’s closed.
To specify the first focusable element in your popup:
Multiple Popups
The popup manager supports multiple active popups. They will be stacked in the order they were shown, with the most recent popup on top.
Cleaning Up
Popups are automatically cleaned up when scenes change. You can also manually remove all popups: