From ef91af804b6b1581866485ecefe2aff5263bfc8d Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 4 Feb 2022 10:42:07 +0000 Subject: [PATCH] fixes to examples --- examples/core/core_input_mouse_wheel.py | 7 ++----- examples/extra/camera.py | 2 +- examples/extra/flow-field.py | 4 ++-- examples/extra/transparent_undecorated_window.py | 5 ++++- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/core/core_input_mouse_wheel.py b/examples/core/core_input_mouse_wheel.py index 8a4951e..da020c7 100644 --- a/examples/core/core_input_mouse_wheel.py +++ b/examples/core/core_input_mouse_wheel.py @@ -31,17 +31,14 @@ pyray.set_target_fps(60) # Set our game to run at 60 frames-per-second # Main game loop while not pyray.window_should_close(): # Detect window close button or ESC key # Update - box_position_y -= (pyray.get_mouse_wheel_move() * scroll_speed) + box_position_y -= int(pyray.get_mouse_wheel_move() * scroll_speed) # Draw pyray.begin_drawing() pyray.clear_background(RAYWHITE) - # TODO - # FIXME - pyray.draw_rectangle( - SCREEN_WIDTH // 2 - 40, box_position_y, 80, 80, MAROON) + pyray.draw_rectangle(SCREEN_WIDTH // 2 - 40, box_position_y, 80, 80, MAROON) pyray.draw_text('User mouse wheel to move the cube up and down!', 10, 10, 20, GRAY) diff --git a/examples/extra/camera.py b/examples/extra/camera.py index be4fb2b..9371dd4 100644 --- a/examples/extra/camera.py +++ b/examples/extra/camera.py @@ -123,7 +123,7 @@ def camera_test(): rl.BeginMode3D(cam[0]) # NOTE(pebaz): For whatever reason, this can solve a percentage of artifacts - rl.DrawGizmo([100000000, 100000000, 100000000]) + #rl.DrawGizmo([100000000, 100000000, 100000000]) rl.DrawGrid(32, 1) diff --git a/examples/extra/flow-field.py b/examples/extra/flow-field.py index c22a29f..ae54e29 100644 --- a/examples/extra/flow-field.py +++ b/examples/extra/flow-field.py @@ -8,7 +8,7 @@ python3 flow-field """ import sys, math, time, random -import glm +import glm # Note package is PyGLM, not glm. from raylib import rl, ffi from raylib.colors import * @@ -28,7 +28,7 @@ rl.SetTargetFPS(60) #rl.DisableCursor() canvas = rl.LoadRenderTexture(rl.GetScreenWidth(), rl.GetScreenHeight()) -rl.SetTextureWrap(canvas.texture, rl.WRAP_MIRROR_REPEAT) +rl.SetTextureWrap(canvas.texture, rl.TEXTURE_WRAP_MIRROR_REPEAT) def random_point_in_circle(center, radius): a = random.random() * 2 * math.pi diff --git a/examples/extra/transparent_undecorated_window.py b/examples/extra/transparent_undecorated_window.py index 8b7c55b..c0cef5f 100644 --- a/examples/extra/transparent_undecorated_window.py +++ b/examples/extra/transparent_undecorated_window.py @@ -1,8 +1,11 @@ """ +FIXME this example is broken with Raylib 4.0 + Requirements: - raylib - pytweening - pyglm +- screeninfo Windows-Only Requirements: - win32gui @@ -18,7 +21,7 @@ import sys, time import glm import pytweening as tween import screeninfo -from raylib.dynamic import raylib as rl, ffi +from raylib import rl, ffi from raylib.colors import *