Skip to content

2.0 - The Input Update

Compare
Choose a tag to compare
@noahcoetsee noahcoetsee released this 18 Oct 12:34
· 35 commits to master since this release
811a218

Hey everyone!

Just writing up this quick release for some somewhat breaking input changes that have been made. There are of course some bugs that have been fixed, and the documentation is in the process of being updated to reflect new changes.

Changelog:

  • Fixed border bugs with rounded corners
  • Fixed fill bug for Polygons
  • Fixed text bugs
  • Added .bounds() method (retrieves a rectangular hitbox that fits the shape respective to position and angle)
  • Added RoundedRectangle class (instead of borders, has a radius)
  • Modified input argument order ⭐

That last one is pretty important. Let me show you.
Previously mouse input has always been handled with these arguments:

def mouesdown(button, location)

But now it has been switched around to:

def mousedown(location, button)

Don't worry, the old way of doing things still works, but it is deprecated and pyDraw will yell at you if you don't make the proper changes! If you're wondering why this change was made, it was made for one to match some of the other design decisions in pyDraw and javaDraw and put the most crucial argument first. But it was also made to support a new shorthand input format which looks like this:

def mousedown(location)

So now you don't need to take in the button if you don't want to!

(Please note that the old way of input is supported via name detection, so if your arguments are not named in the recommended way your variables will be passed in the new order.

Hope everyone is having a happy schoolyear, and I look forward to further updates!

Cheers,
Noah