Skip to content

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

Description

@vesauimonen

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions