Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kivy uses built-in Vector class, resulting in truncate method not found #2

Open
vesauimonen opened this issue Mar 19, 2013 · 0 comments
Labels

Comments

@vesauimonen
Copy link
Owner

Because Kivy uses its built-in Vector class, vectors such as

from .vector import Vector
vector = Vector(0, 0)
vector = vehicle.pos + another_vehicle.pos
vector = vector.truncate(10)
>>> AttributeError: 'Vector' object has no attribute 'truncate'

fail. This can be fixed by constructing the extended Vector class again:

from .vector import Vector
vector = Vector(0, 0) 
vector = vehicle.pos + another_vehicle.pos
vector = Vector(*vector).truncate(10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant