This commit is contained in:
richard 2022-02-02 20:28:08 +00:00
parent 218d9a18f7
commit 82d310ea76
12 changed files with 20 additions and 134 deletions

View file

@ -3,7 +3,8 @@
raylib [core] example - 2d camera
"""
from raylib.pyray import PyRay
import pyray
from raylib.colors import (
RAYWHITE,
DARKGRAY,
@ -15,7 +16,7 @@ from raylib.colors import (
)
pyray = PyRay()
# Initialization
MAX_BUILDINGS = 100

View file

@ -5,7 +5,7 @@ raylib [core] example - 2d camera platformer
"""
from math import sqrt
from raylib.pyray import PyRay
import pyray
from raylib.colors import (
DARKGRAY,
RED,
@ -15,7 +15,6 @@ from raylib.colors import (
)
pyray = PyRay()
# Initialization
global g_evening_out, g_even_out_target

View file

@ -3,14 +3,14 @@
raylib [core] example - Basic window
"""
from raylib.pyray import PyRay
import pyray
from raylib.colors import (
RAYWHITE,
LIGHTGRAY,
)
pyray = PyRay()
# Initialization

View file

@ -3,7 +3,7 @@
raylib [core] example - Input Gestures Detection
"""
from raylib.pyray import PyRay
import pyray
from raylib.colors import (
RAYWHITE,
LIGHTGRAY,
@ -13,7 +13,6 @@ from raylib.colors import (
)
pyray = PyRay()
# Initialization
MAX_GESTURE_STRINGS = 20

View file

@ -3,7 +3,7 @@
raylib [core] example - Keyboard input
"""
from raylib.pyray import PyRay
import pyray
from raylib.colors import (
RAYWHITE,
DARKGRAY,
@ -11,7 +11,6 @@ from raylib.colors import (
)
pyray = PyRay()
# Initialization

View file

@ -3,7 +3,7 @@
raylib [core] example - Mouse input
"""
from raylib.pyray import PyRay
import pyray
from raylib.colors import (
RAYWHITE,
DARKGRAY,
@ -13,7 +13,6 @@ from raylib.colors import (
)
pyray = PyRay()
# Initialization
@ -34,11 +33,11 @@ while not pyray.window_should_close(): # Detect window close button or ESC key
# Update
ball_position = pyray.get_mouse_position()
if pyray.is_mouse_button_pressed(pyray.MOUSE_LEFT_BUTTON):
if pyray.is_mouse_button_pressed(pyray.MOUSE_BUTTON_LEFT):
ball_color = MAROON
elif pyray.is_mouse_button_pressed(pyray.MOUSE_MIDDLE_BUTTON):
elif pyray.is_mouse_button_pressed(pyray.MOUSE_BUTTON_MIDDLE):
ball_color = LIME
elif pyray.is_mouse_button_pressed(pyray.MOUSE_RIGHT_BUTTON):
elif pyray.is_mouse_button_pressed(pyray.MOUSE_BUTTON_RIGHT):
ball_color = DARKBLUE
# Draw

View file

@ -3,7 +3,7 @@
raylib [core] example - Mouse wheel input
"""
from raylib.pyray import PyRay
import pyray
from raylib.colors import (
RAYWHITE,
GRAY,
@ -12,7 +12,7 @@ from raylib.colors import (
)
pyray = PyRay()
# Initialization
@ -38,6 +38,8 @@ while not pyray.window_should_close(): # Detect window close button or ESC key
pyray.clear_background(RAYWHITE)
# TODO
# FIXME
pyray.draw_rectangle(
SCREEN_WIDTH // 2 - 40, box_position_y, 80, 80, MAROON)