electronstudio / raylib-python-cffi

Python CFFI bindings for Raylib
http://electronstudio.github.io/raylib-python-cffi
Eclipse Public License 2.0
142 stars 29 forks source link

AttributeError: Vector2 #128

Closed jakobjung10 closed 1 month ago

jakobjung10 commented 1 month ago

Hi!

How are the raylib-structs in python supposed to be used? In this example: Vector2

Exception has occurred: AttributeError module 'raylib' has no attribute 'Vector2'_

import raylib

self._position = raylib.Vector2(10, 10)
electronstudio commented 1 month ago

If you really want to use raw raylib functions:

import raylib
v = raylib.ffi.new(f"struct Vector2 *", (10,10))

However, I would do it the way that is thoroughly demonstrated for you in the many example programs:

import pyray
v = pyray.Vector2(10,10)