Skip to content

Commit

Permalink
Finish #1845 : Move Background classes to experimental (#1890)
Browse files Browse the repository at this point in the history
* Move backgrounds to experimental module

* Update imports + __all__ for background move

* Import background functions and classes in experimental/__init__.py

* Add background functions and classes to __all__

* Update imports in background example code

* Add experimental warning to background parallax RST
  • Loading branch information
pushfoo committed Sep 11, 2023
1 parent ac7c118 commit d34f950
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 10 deletions.
2 changes: 1 addition & 1 deletion arcade/examples/background_blending.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from __future__ import annotations

import arcade
import arcade.background as background
import arcade.experimental.background as background

SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
Expand Down
2 changes: 1 addition & 1 deletion arcade/examples/background_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from __future__ import annotations

import arcade
import arcade.background as background
import arcade.experimental.background as background

SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
Expand Down
2 changes: 1 addition & 1 deletion arcade/examples/background_parallax.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from __future__ import annotations

import arcade
import arcade.background as background
import arcade.experimental.background as background


SCREEN_TITLE = "Background Group Example"
Expand Down
2 changes: 1 addition & 1 deletion arcade/examples/background_scrolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from __future__ import annotations

import arcade
import arcade.background as background
import arcade.experimental.background as background

SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
Expand Down
2 changes: 1 addition & 1 deletion arcade/examples/background_stationary.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from __future__ import annotations

import arcade
import arcade.background as background
import arcade.experimental.background as background

SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
Expand Down
16 changes: 16 additions & 0 deletions arcade/experimental/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
from .shadertoy import Shadertoy, ShadertoyBuffer, ShadertoyBase
from .crt_filter import CRTFilter
from .bloom_filter import BloomFilter
from .background import (
Background,
BackgroundGroup,
ParallaxGroup,
BackgroundTexture,
texture_from_file,
background_from_file
)


__all__ = [
"VideoPlayer",
Expand All @@ -18,8 +27,15 @@
"ShadertoyBase",
"CRTFilter",
"BloomFilter",
"Background",
"BackgroundGroup",
"ParallaxGroup",
"BackgroundTexture",
"texture_from_file",
"background_from_file"
]


# Keep cv2 an optional dependency
try:
from .video_cv2 import CV2PlayerView, VideoPlayerCV2 # noqa: F401
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
from arcade import get_window
from arcade.resources import resolve

from arcade.background.background_texture import BackgroundTexture
from arcade.background.background import Background
from arcade.background.groups import BackgroundGroup, ParallaxGroup
from arcade.experimental.background.background_texture import BackgroundTexture
from arcade.experimental.background.background import Background
from arcade.experimental.background.groups import BackgroundGroup, ParallaxGroup

__all__ = [
"Background",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from arcade.window_commands import get_window
import arcade.gl as gl

from arcade.background import BackgroundTexture
from arcade.experimental.background import BackgroundTexture


class Background:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Optional, Union, List, Tuple

import arcade.gl as gl
from arcade.background import Background
from arcade.experimental.background import Background


class BackgroundGroup:
Expand Down
5 changes: 5 additions & 0 deletions doc/example_code/how_to_examples/background_parallax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
Parallax
========

.. warning:: This example is experimental!

The features it uses may change rapidly or be replaced in
future arcade releases!

.. image:: background_parallax.png
:width: 600px
:align: center
Expand Down

0 comments on commit d34f950

Please sign in to comment.