-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
Add more Line
attributes
#3268
base: main
Are you sure you want to change the base?
Add more Line
attributes
#3268
Conversation
- center - centerx/y - angle - slope Co-authored-by: Emc2356 <[email protected]> Co-authored-by: NovialRiptide <[email protected]> Co-authored-by: ScriptLineStudios <[email protected]> Co-authored-by: Avaxar <[email protected]> Co-authored-by: maqa41 <[email protected]>
docs/reST/ref/geometry.rst
Outdated
| :sl:`the coordinate of the middle point of the line` | ||
| :sg:`center -> (float, float)` | ||
|
||
The center of the line. Calculated using the `((xa + xb) / 2, (ya + yb) / 2)` formula. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for consistency, new docs should use ax
and ay
docs/reST/ref/geometry.rst
Outdated
|
||
The angle of the line representing its orientation. Calculated using | ||
the `atan2(yb - ya, xb - xa)` formula. This attribute is read-only, it cannot | ||
be reassigned. To change the line's angle use the `rotate` method or change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I'm blind, the rotate method doesn't exist yet, does it have to be ported or was it descarted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep it's yet to be ported, changed that.
Adds the following
Line
attributes:Credits
Geometry Project:
For code, docs and tests:
@novialriptide @Emc2356 @itzpr3d4t0r @ScriptLineStudios @avaxar @Matiiss @newpaxonian @maqa41 @blankRiot96
Also thanks to @Starbuck5 for kickstarting the idea and the occasional help!
Functionality added in this PR
geometry.pyi
https://github.com/pygame-community/pygame-geometry/blame/main/geometry.pyi
Credits to @Emc2356 @itzpr3d4t0r @novialriptide @ScriptLineStudios @avaxar
geometry.rst
https://github.com/pygame-community/pygame-geometry/blame/main/docs/line.rst
Credits to @Emc2356 @itzpr3d4t0r @ScriptLineStudios @avaxar
line.c
https://github.com/pygame-community/pygame-geometry/blame/main/src_c/line.c
Credits to @Emc2356 @itzpr3d4t0r @novialriptide @ScriptLineStudios @avaxar
geometry.h
https://github.com/pygame-community/pygame-geometry/blame/main/src_c/include/geometry.h
Credits to @Emc2356 @itzpr3d4t0r @maqa41
geometry_test.py
https://github.com/pygame-community/pygame-geometry/blame/main/test/test_line.py
Credits to @Emc2356 @itzpr3d4t0r @novialriptide @ScriptLineStudios @avaxar