Types of notifications with different visual styles.
SUCCESS: Any = auto()
INFO: Any = auto()
WARNING: Any = auto()
ERROR: Any = auto()
CUSTOM: Any = auto()
No methods defined.
Pre-defined notification positions.
TOP_LEFT: Any = 'top_left'
TOP_CENTER: Any = 'top_center'
TOP_RIGHT: Any = 'top_right'
CENTER_LEFT: Any = 'center_left'
CENTER: Any = 'center'
CENTER_RIGHT: Any = 'center_right'
BOTTOM_LEFT: Any = 'bottom_left'
BOTTOM_CENTER: Any = 'bottom_center'
BOTTOM_RIGHT: Any = 'bottom_right'
CUSTOM: Any = 'custom'
No methods defined.
Style configuration for different notification types.
def __init__(self: Any, bg_color: Tuple[int, int, int], border_color: Tuple[int, int, int], text_color: Tuple[int, int, int], icon_type: Optional[Icons] = None, duration: float = 5.0, show_icon: bool = True) -> Any
No documentation
def __init__(self: Any, text: str, notification_type: NotificationType = NotificationType.INFO, duration: Optional[float] = None, position: Union[NotificationPosition, Tuple[int, int]] = NotificationPosition.TOP_RIGHT, width: int = 300, height: int = 60, show_close_button: bool = True, auto_close: bool = True, animation_speed: float = 0.3, show_progress_bar: bool = False, on_close: Optional[Callable] = None, on_click: Optional[Callable] = None, metadata: Any = None, custom_icon: Optional[Icons] = None) -> Any
Single notification element with advanced positioning and animations.
STYLES: Any = {NotificationType.SUCCESS: NotificationStyle(bg_color=(46, 204, 113), border_color=(39, 174, 96), text_color=(255, 255, 255), icon_type=Icons.SUCCESS, duration=3.0, show_icon=True), NotificationType.INFO: NotificationStyle(bg_color=(52, 152, 219), border_color=(41, 128, 185), text_color=(255, 255, 255), icon_type=Icons.INFO, duration=5.0, show_icon=True), NotificationType.WARNING: NotificationStyle(bg_color=(241, 196, 15), border_color=(243, 156, 18), text_color=(0, 0, 0), icon_type=Icons.WARN, duration=7.0, show_icon=True), NotificationType.ERROR: NotificationStyle(bg_color=(231, 76, 60), border_color=(192, 57, 43), text_color=(255, 255, 255), icon_type=Icons.ERROR, duration=10.0, show_icon=True), NotificationType.CUSTOM: NotificationStyle(bg_color=(149, 165, 166), border_color=(127, 140, 141), text_color=(255, 255, 255), icon_type=Icons.INFO, duration=5.0, show_icon=True)}
def __init__(self: Any, config: NotificationConfig, engine: 'LunaEngine', theme: ThemeType = None, element_id: Optional[str] = None) -> Any
def _get_theme_based_style(self: Any) -> NotificationStyle
def _calculate_target_position(self: Any) -> Tuple[int, int]
def _calculate_start_position(self: Any) -> Tuple[int, int]
def _create_ui(self: Any) -> Any
def _apply_custom_style(self: Any) -> Any
def show(self: Any) -> Any
def close(self: Any) -> Any
def force_close(self: Any) -> Any
def update(self: Any, dt: float, inputState: InputState) -> Any
def _ease_out(self: Any, t: float) -> float
def _ease_in(self: Any, t: float) -> float
def should_remove(self: Any) -> bool
def get_opacity(self: Any) -> float
def render(self: Any, renderer: Any) -> Any
Manages all notifications globally with queue support.
Handles positioning, stacking, and lifecycle of notifications.
_instance: Any = None
def __new__(cls: Any) -> Any
def _initialize(self: Any) -> Any
def set_engine(self: Any, engine: 'LunaEngine') -> Any
def show_notification(self: Any, config: NotificationConfig) -> Notification
def _show_notification_immediate(self: Any, notification: Notification) -> Any
def _update_notification_positions(self: Any, position: NotificationPosition) -> Any
def show_simple_notification(self: Any, text: str, notification_type: NotificationType = NotificationType.INFO, duration: Optional[float] = None, position: Union[NotificationPosition, Tuple[int, int]] = NotificationPosition.TOP_RIGHT) -> Notification
def remove_notification(self: Any, notification: Notification) -> Any
def clear_all(self: Any) -> Any
def clear_by_type(self: Any, notification_type: NotificationType) -> Any
def _process_queue(self: Any) -> Any
def update(self: Any, dt: float, inputState: InputState) -> Any
def render(self: Any, renderer: Any) -> Any
def get_notification_count(self: Any) -> int
def get_queue_length(self: Any) -> int
def has_notifications(self: Any) -> bool
def has_queued_notifications(self: Any) -> bool
def set_max_concurrent(self: Any, max_count: int) -> Any
def set_default_margin(self: Any, margin: int) -> Any
def set_spacing(self: Any, spacing: int) -> Any
def show_notification(text: str, notification_type: NotificationType = NotificationType.INFO, duration: Optional[float] = None, position: Union[NotificationPosition, Tuple[int, int]] = NotificationPosition.TOP_RIGHT) -> Notification
Convenience function to show a simple notification.
Args:
text: Notification text
notification_type: Type of notification
duration: Optional custom duration
position: Position for notification
Returns:
The created Notification object
def show_error(text: str, duration: Optional[float] = None, position: Union[NotificationPosition, Tuple[int, int]] = NotificationPosition.TOP_RIGHT) -> Notification
Show an error notification.
def show_warning(text: str, duration: Optional[float] = None, position: Union[NotificationPosition, Tuple[int, int]] = NotificationPosition.TOP_RIGHT) -> Notification
Show a warning notification.
def show_success(text: str, duration: Optional[float] = None, position: Union[NotificationPosition, Tuple[int, int]] = NotificationPosition.TOP_RIGHT) -> Notification
Show a success notification.
def show_info(text: str, duration: Optional[float] = None, position: Union[NotificationPosition, Tuple[int, int]] = NotificationPosition.TOP_RIGHT) -> Notification
Show an info notification.
def clear_all_notifications() -> Any
Clear all notifications.
def get_notification_count() -> int
Get the current number of active notifications.
def get_queue_length() -> int
Get the current queue length.