Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions arcade/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import pyglet.gl as gl
import pyglet.window.mouse
from pyglet.canvas.base import ScreenMode
from pyglet.display.base import ScreenMode

import arcade
from arcade import get_display_size
Expand Down Expand Up @@ -54,7 +54,7 @@ def get_screens() -> List:

:returns: List of screens, one for each monitor.
"""
display = pyglet.canvas.get_display()
display = pyglet.display.get_display()
return display.get_screens()


Expand Down Expand Up @@ -83,7 +83,7 @@ class Window(pyglet.window.Window):
:param antialiasing: Should OpenGL's anti-aliasing be enabled?
:param gl_version: What OpenGL version to request. This is ``(3, 3)`` by default \
and can be overridden when using more advanced OpenGL features.
:param screen: Pass a pyglet :py:class:`~pyglet.canvas.Screen` to
:param screen: Pass a pyglet :py:class:`~pyglet.display.Screen` to
request the window be placed on it. See `pyglet's window size &
position guide <pyglet_pg_window_size_position_>`_ to learn more.
:param style: Request a non-default window style, such as borderless.
Expand All @@ -110,7 +110,7 @@ def __init__(
update_rate: float = 1 / 60,
antialiasing: bool = True,
gl_version: Tuple[int, int] = (3, 3),
screen: Optional[pyglet.canvas.Screen] = None,
screen: Optional[pyglet.display.Screen] = None,
style: Optional[str] = pyglet.window.Window.WINDOW_STYLE_DEFAULT,
visible: bool = True,
vsync: bool = False,
Expand Down Expand Up @@ -152,7 +152,7 @@ def __init__(
blue_size=8,
alpha_size=8,
)
display = pyglet.canvas.get_display()
display = pyglet.display.get_display()
screen = display.get_default_screen()
if screen:
config = screen.get_best_config(config)
Expand Down
8 changes: 4 additions & 4 deletions arcade/experimental/clock/clock_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import pyglet.gl as gl
import pyglet.window.mouse
from pyglet.canvas.base import ScreenMode
from pyglet.display.base import ScreenMode

import arcade
from arcade import get_display_size
Expand Down Expand Up @@ -70,7 +70,7 @@ class for more info.
:param antialiasing: Should OpenGL's anti-aliasing be enabled?
:param gl_version: What OpenGL version to request. This is ``(3, 3)`` by default \
and can be overridden when using more advanced OpenGL features.
:param screen: Pass a pyglet :py:class:`~pyglet.canvas.Screen` to
:param screen: Pass a pyglet :py:class:`~pyglet.display.Screen` to
request the window be placed on it. See `pyglet's window size &
position guide <pyglet_pg_window_size_position_>`_ to learn more.
:param style: Request a non-default window style, such as borderless.
Expand All @@ -97,7 +97,7 @@ def __init__(
update_rate: float = 1 / 60,
antialiasing: bool = True,
gl_version: Tuple[int, int] = (3, 3),
screen: Optional[pyglet.canvas.Screen] = None,
screen: Optional[pyglet.display.Screen] = None,
style: Optional[str] = pyglet.window.Window.WINDOW_STYLE_DEFAULT,
visible: bool = True,
vsync: bool = False,
Expand Down Expand Up @@ -141,7 +141,7 @@ def __init__(
blue_size=8,
alpha_size=8,
)
display = pyglet.canvas.get_display()
display = pyglet.display.get_display()
screen = display.get_default_screen()
if screen:
config = screen.get_best_config(config)
Expand Down
6 changes: 4 additions & 2 deletions arcade/gui/widgets/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,11 @@ def __init__(
)

self.layout = pyglet.text.layout.IncrementalTextLayout(
self.doc, int(width - self.LAYOUT_OFFSET), int(height), multiline=multiline
self.doc,
x=x + self.LAYOUT_OFFSET, y=y, z=0.0, # Position
width=int(width - self.LAYOUT_OFFSET), height=int(height), # Size
multiline=multiline
)
self.layout.x += self.LAYOUT_OFFSET
self.caret = Caret(self.layout, color=Color.from_iterable(caret_color))
self.caret.visible = False

Expand Down
5 changes: 3 additions & 2 deletions arcade/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,9 @@ def __init__(
z=z,
font_name=adjusted_font,
font_size=font_size,
anchor_x=anchor_x,
anchor_y=anchor_y,
# use type: ignore since cast is slow & pyglet used Literal
anchor_x=anchor_x, # type: ignore
anchor_y=anchor_y, # type: ignore
color=Color.from_iterable(color),
width=width,
align=align,
Expand Down
2 changes: 1 addition & 1 deletion arcade/window_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def get_display_size(screen_id: int = 0) -> Tuple[int, int]:
:param screen_id: The screen number
:return: Tuple containing the width and height of the screen
"""
display = pyglet.canvas.Display()
display = pyglet.display.Display()
screen = display.get_screens()[screen_id]
return screen.width, screen.height

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules"
]
dependencies = [
"pyglet>=2.0.14,<2.1",
"pyglet == 2.1dev2",
"pillow~=10.2.0",
"pymunk~=6.6.0",
"pytiled-parser~=2.2.3"
Expand Down