Skip to content

Commit 82d310e

Browse files
fix more examples #47
1 parent 218d9a1 commit 82d310e

12 files changed

+20
-134
lines changed

examples/core/core_2d_camera.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
raylib [core] example - 2d camera
44
55
"""
6-
from raylib.pyray import PyRay
6+
import pyray
7+
78
from raylib.colors import (
89
RAYWHITE,
910
DARKGRAY,
@@ -15,7 +16,7 @@
1516
)
1617

1718

18-
pyray = PyRay()
19+
1920

2021
# Initialization
2122
MAX_BUILDINGS = 100

examples/core/core_2d_camera_platformer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"""
66
from math import sqrt
77

8-
from raylib.pyray import PyRay
8+
import pyray
99
from raylib.colors import (
1010
DARKGRAY,
1111
RED,
@@ -15,7 +15,6 @@
1515
)
1616

1717

18-
pyray = PyRay()
1918

2019
# Initialization
2120
global g_evening_out, g_even_out_target

examples/core/core_basic_window.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
raylib [core] example - Basic window
44
55
"""
6-
from raylib.pyray import PyRay
6+
import pyray
77
from raylib.colors import (
88
RAYWHITE,
99
LIGHTGRAY,
1010
)
1111

1212

13-
pyray = PyRay()
13+
1414

1515

1616
# Initialization

examples/core/core_input_gestures.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
raylib [core] example - Input Gestures Detection
44
55
"""
6-
from raylib.pyray import PyRay
6+
import pyray
77
from raylib.colors import (
88
RAYWHITE,
99
LIGHTGRAY,
@@ -13,7 +13,6 @@
1313
)
1414

1515

16-
pyray = PyRay()
1716

1817
# Initialization
1918
MAX_GESTURE_STRINGS = 20

examples/core/core_input_keys.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
raylib [core] example - Keyboard input
44
55
"""
6-
from raylib.pyray import PyRay
6+
import pyray
77
from raylib.colors import (
88
RAYWHITE,
99
DARKGRAY,
1010
MAROON,
1111
)
1212

1313

14-
pyray = PyRay()
1514

1615

1716
# Initialization

examples/core/core_input_mouse.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
raylib [core] example - Mouse input
44
55
"""
6-
from raylib.pyray import PyRay
6+
import pyray
77
from raylib.colors import (
88
RAYWHITE,
99
DARKGRAY,
@@ -13,7 +13,6 @@
1313
)
1414

1515

16-
pyray = PyRay()
1716

1817

1918
# Initialization
@@ -34,11 +33,11 @@
3433
# Update
3534
ball_position = pyray.get_mouse_position()
3635

37-
if pyray.is_mouse_button_pressed(pyray.MOUSE_LEFT_BUTTON):
36+
if pyray.is_mouse_button_pressed(pyray.MOUSE_BUTTON_LEFT):
3837
ball_color = MAROON
39-
elif pyray.is_mouse_button_pressed(pyray.MOUSE_MIDDLE_BUTTON):
38+
elif pyray.is_mouse_button_pressed(pyray.MOUSE_BUTTON_MIDDLE):
4039
ball_color = LIME
41-
elif pyray.is_mouse_button_pressed(pyray.MOUSE_RIGHT_BUTTON):
40+
elif pyray.is_mouse_button_pressed(pyray.MOUSE_BUTTON_RIGHT):
4241
ball_color = DARKBLUE
4342

4443
# Draw

examples/core/core_input_mouse_wheel.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
raylib [core] example - Mouse wheel input
44
55
"""
6-
from raylib.pyray import PyRay
6+
import pyray
77
from raylib.colors import (
88
RAYWHITE,
99
GRAY,
@@ -12,7 +12,7 @@
1212
)
1313

1414

15-
pyray = PyRay()
15+
1616

1717

1818
# Initialization
@@ -38,6 +38,8 @@
3838

3939
pyray.clear_background(RAYWHITE)
4040

41+
# TODO
42+
# FIXME
4143
pyray.draw_rectangle(
4244
SCREEN_WIDTH // 2 - 40, box_position_y, 80, 80, MAROON)
4345

examples/extra/camera.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from math import sin, cos
22
import glm
3-
from raylib.dynamic import raylib as rl, ffi
3+
from raylib import rl, ffi
44

55

66
class CameraFly:

examples/extra/flow-field.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import sys, math, time, random
1111
import glm
12-
from raylib.dynamic import raylib as rl, ffi
12+
from raylib import rl, ffi
1313
from raylib.colors import *
1414

1515
CTM = lambda: round(time.time() * 1000)

examples/textures/textures_bunnymark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(self):
4747
while not WindowShouldClose(): #// Detect window close button or ESC key
4848
#// Update
4949
#//----------------------------------------------------------------------------------
50-
if IsMouseButtonDown(MOUSE_LEFT_BUTTON):
50+
if IsMouseButtonDown(MOUSE_BUTTON_LEFT):
5151
#// Create more bunnies
5252
for i in range(0, 100):
5353
if bunniesCount < MAX_BUNNIES:

0 commit comments

Comments
 (0)