Skip to content

Commit 1cc3d0b

Browse files
committed
Pyglet 3 updates
1 parent 42843ad commit 1cc3d0b

30 files changed

Lines changed: 49 additions & 57 deletions

arcade/application.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ def on_mouse_scroll(
769769
"""
770770
return EVENT_UNHANDLED
771771

772-
def set_mouse_visible(self, visible: bool = True) -> None:
772+
def set_mouse_cursor_visible(self, visible: bool = True) -> None:
773773
"""
774774
Set whether to show the system's cursor while over the window
775775
@@ -800,7 +800,7 @@ def set_mouse_visible(self, visible: bool = True) -> None:
800800
Args:
801801
visible: Whether to hide the system mouse cursor
802802
"""
803-
super().set_mouse_visible(visible)
803+
super().set_mouse_cursor_visible(visible)
804804

805805
def on_action(self, action_name: str, state) -> None:
806806
"""
@@ -1145,17 +1145,17 @@ def set_vsync(self, vsync: bool) -> None:
11451145
"""Set if we sync our draws to the monitors vertical sync rate."""
11461146
super().set_vsync(vsync)
11471147

1148-
def set_mouse_platform_visible(self, platform_visible=None) -> None:
1148+
def set_mouse_cursor_platform_visible(self, platform_visible=None) -> None:
11491149
"""
11501150
.. warning:: You are probably looking for
1151-
:meth:`~.Window.set_mouse_visible`!
1151+
:meth:`~.Window.set_mouse_cursor_visible`!
11521152
11531153
This is a lower level function inherited from the pyglet window.
11541154
11551155
For more information on what this means, see the documentation
1156-
for :py:meth:`pyglet.window.Window.set_mouse_platform_visible`.
1156+
for :py:meth:`pyglet.window.Window.set_mouse_cursor_platform_visible`.
11571157
"""
1158-
super().set_mouse_platform_visible(platform_visible)
1158+
super().set_mouse_cursor_platform_visible(platform_visible)
11591159

11601160
def set_exclusive_mouse(self, exclusive=True) -> None:
11611161
"""Capture the mouse."""

arcade/context.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import pyglet
1212
from PIL import Image
13-
from pyglet.graphics.shader import UniformBufferObjectBase
1413
from pyglet.math import Mat4
1514

1615
import arcade
@@ -56,7 +55,7 @@ def __init__(
5655
gl_api: str = "gl",
5756
) -> None:
5857
# Set up a default orthogonal projection for sprites and shapes
59-
self._window_block: UniformBufferObjectBase = window._matrices.ubo
58+
self._window_block = window._matrices.ubo
6059
self.bind_window_block()
6160

6261
self.blend_func = self.BLEND_DEFAULT

arcade/examples/follow_path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def __init__(self):
9393
self.score = 0
9494

9595
# Don't show the mouse cursor
96-
self.window.set_mouse_visible(False)
96+
self.window.set_mouse_cursor_visible(False)
9797

9898
self.background_color = arcade.color.AMAZON
9999

arcade/examples/gl/tessellation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import arcade
1212
from arcade.gl import BufferDescription
13-
import pyglet.graphics.api.gl
13+
from pyglet.graphics.api.gl import GL_PATCHES
1414

1515
WINDOW_WIDTH = 1280
1616
WINDOW_HEIGHT = 720
@@ -107,7 +107,7 @@ def __init__(self, width, height, title):
107107
def on_draw(self):
108108
self.clear()
109109
self.program["time"] = self.time
110-
self.geometry.render(self.program, mode=pyglet.gl.GL_PATCHES)
110+
self.geometry.render(self.program, mode=GL_PATCHES)
111111

112112

113113
if __name__ == "__main__":

arcade/examples/slime_invaders.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __init__(self):
7474
self.enemy_change_x = -ENEMY_SPEED
7575

7676
# Don't show the mouse cursor
77-
self.window.set_mouse_visible(False)
77+
self.window.set_mouse_cursor_visible(False)
7878

7979
# Load sounds. Sounds from kenney.nl
8080
self.gun_sound = arcade.load_sound(":resources:sounds/hurt5.wav")
@@ -196,7 +196,7 @@ def on_draw(self):
196196
# Draw game over if the game state is such
197197
if self.game_state == GAME_OVER:
198198
self.game_over_text.draw()
199-
self.window.set_mouse_visible(True)
199+
self.window.set_mouse_cursor_visible(True)
200200

201201
def on_key_press(self, key, modifiers):
202202
if key == arcade.key.ESCAPE:

arcade/examples/snow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def __init__(self):
6060
self.snowflake_list = arcade.SpriteList()
6161

6262
# Don't show the mouse pointer
63-
self.window.set_mouse_visible(False)
63+
self.window.set_mouse_cursor_visible(False)
6464

6565
# Set the background color
6666
self.background_color = arcade.color.BLACK

arcade/examples/sprite_bullets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def __init__(self):
4141
self.score = 0
4242

4343
# Don't show the mouse cursor
44-
self.window.set_mouse_visible(False)
44+
self.window.set_mouse_cursor_visible(False)
4545

4646
# Load sounds. Sounds from kenney.nl
4747
self.gun_sound = arcade.load_sound(":resources:sounds/hurt5.wav")

arcade/examples/sprite_change_coins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def setup(self):
7777
self.coin_list.append(coin)
7878

7979
# Don't show the mouse cursor
80-
self.window.set_mouse_visible(False)
80+
self.window.set_mouse_cursor_visible(False)
8181

8282
# Set the background color
8383
self.background_color = arcade.color.AMAZON

arcade/examples/sprite_collect_coins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(self):
4242
self.score_display = None
4343

4444
# Hide the mouse cursor while it's over the window
45-
self.window.set_mouse_visible(False)
45+
self.window.set_mouse_cursor_visible(False)
4646

4747
self.background_color = arcade.color.AMAZON
4848

arcade/examples/sprite_collect_coins_background.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(self):
4747
self.score_text = arcade.Text("Score: 0", 10, 20, arcade.color.WHITE, 14)
4848

4949
# Don't show the mouse cursor
50-
self.window.set_mouse_visible(False)
50+
self.window.set_mouse_cursor_visible(False)
5151

5252
# Set the background color
5353
self.background_color = arcade.color.AMAZON

0 commit comments

Comments
 (0)