Step_07.差异#
Step_06.py到Step_07.py的差异#
--- /pb1/repo/arcade/doc/tutorials/raycasting/step_06.py
+++ /pb1/repo/arcade/doc/tutorials/raycasting/step_07.py
@@ -22,7 +22,7 @@
class MyGame(arcade.Window):
def __init__(self, width, height, title):
- super().__init__(width, height, title)
+ super().__init__(width, height, title, resizable=True)
# The shader toy and 'channels' we'll be using
self.shadertoy = None
@@ -146,6 +146,10 @@
# example though.)
self.physics_engine.update()
+ def on_resize(self, width: int, height: int):
+ super().on_resize(width, height)
+ self.shadertoy.resize((width, height))
+
if __name__ == "__main__":
MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)