diff --git a/arcade/camera/camera_2d.py b/arcade/camera/camera_2d.py index 79b6bf235..a1a03ae4b 100644 --- a/arcade/camera/camera_2d.py +++ b/arcade/camera/camera_2d.py @@ -569,7 +569,6 @@ def projection(self) -> Rect: @projection.setter def projection(self, value: Rect) -> None: - # Unpack and validate if not value: raise ZeroProjectionDimension((f"Projection area is 0, {value.lrbt}")) diff --git a/arcade/future/splash.py b/arcade/future/splash.py index 5f3318fc6..104279c7e 100644 --- a/arcade/future/splash.py +++ b/arcade/future/splash.py @@ -21,7 +21,7 @@ class ArcadeSplash(View): dark_mode: If True, the splash screen will be shown in dark mode. (Default False) """ - def __init__(self, view: View, duration: int = 3, dark_mode: bool = False): + def __init__(self, view: View, duration: float = 1.5, dark_mode: bool = False): super().__init__() self._next_view = view self._duration = duration diff --git a/arcade/gui/ui_manager.py b/arcade/gui/ui_manager.py index b3731940d..22264bacb 100644 --- a/arcade/gui/ui_manager.py +++ b/arcade/gui/ui_manager.py @@ -88,6 +88,7 @@ def on_draw(): _enabled = False + DEFAULT_LAYER = 0 OVERLAY_LAYER = 10 def __init__(self, window: Optional[arcade.Window] = None): @@ -103,7 +104,7 @@ def __init__(self, window: Optional[arcade.Window] = None): self.register_event_type("on_event") - def add(self, widget: W, *, index=None, layer=0) -> W: + def add(self, widget: W, *, index=None, layer=DEFAULT_LAYER) -> W: """Add a widget to the :class:`UIManager`. Added widgets will receive ui events and be rendered. @@ -141,7 +142,9 @@ def remove(self, child: UIWidget): child.parent = None self.trigger_render() - def walk_widgets(self, *, root: Optional[UIWidget] = None, layer=0) -> Iterable[UIWidget]: + def walk_widgets( + self, *, root: Optional[UIWidget] = None, layer=DEFAULT_LAYER + ) -> Iterable[UIWidget]: """Walks through widget tree, in reverse draw order (most top drawn widget first) Args: @@ -165,7 +168,9 @@ def clear(self): for widget in layer[:]: self.remove(widget) - def get_widgets_at(self, pos: Point2, cls: type[W] = UIWidget, layer=0) -> Iterable[W]: + def get_widgets_at( + self, pos: Point2, cls: type[W] = UIWidget, layer=DEFAULT_LAYER + ) -> Iterable[W]: """Yields all widgets containing a position, returns first top laying widgets which is instance of cls.