Skip to content

Commit fb309c9

Browse files
authored
Fix GUI cam on_resize examples (#2572)
* Remove unused GUI camera in sprite_move_scrolling_shake.py * Fix camera GUI on_resize in sprite_move_scrolling.py
1 parent ea6e01f commit fb309c9

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

arcade/examples/sprite_move_scrolling.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,12 @@ def on_resize(self, width: int, height: int):
182182
"""
183183
super().on_resize(width, height)
184184
self.camera_sprites.match_window()
185-
self.camera_gui.match_window()
186185

187186

188187
def main():
189188
""" Main function """
190189
# Create a window class. This is what actually shows up on screen
191-
window = arcade.Window(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_TITLE)
190+
window = arcade.Window(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_TITLE, resizable=True)
192191

193192
# Create and setup the GameView
194193
game = GameView()

arcade/examples/sprite_move_scrolling_shake.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ def __init__(self):
5252
# Physics engine so we don't run into walls.
5353
self.physics_engine = None
5454

55-
# Create the cameras. One for the GUI, one for the sprites.
56-
# We scroll the 'sprite world' but not the GUI.
55+
# Create camera that will follow the player sprite.
5756
self.camera_sprites = arcade.camera.Camera2D()
58-
self.camera_gui = arcade.camera.Camera2D()
5957

6058
self.camera_shake = arcade.camera.grips.ScreenShake2D(
6159
self.camera_sprites.view_data,
@@ -197,13 +195,12 @@ def on_resize(self, width: int, height: int):
197195
"""
198196
super().on_resize(width, height)
199197
self.camera_sprites.match_window()
200-
self.camera_gui.match_window(position=True)
201198

202199

203200
def main():
204201
""" Main function """
205202
# Create a window class. This is what actually shows up on screen
206-
window = arcade.Window(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_TITLE)
203+
window = arcade.Window(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_TITLE, resizable=True)
207204

208205
# Create and setup the GameView
209206
game = GameView()

0 commit comments

Comments
 (0)