-
-
Notifications
You must be signed in to change notification settings - Fork 216
Description
I'm pleased to inform you that the pygame-geometry library has started being ported to the pygame-ce repository.
The primary goal is to enhance the functionality of the library by introducing several new types of shapes, while retaining the familiar features found in pygame's Rect or Frect classes.
The main portion of the functionality consists of the following shape classes:
CircleLinePolygon
Each shape includes the following:
- Transformation functions such as scale, rotate, move, and update.
- Collision functions, allowing each shape to collide with other shapes, as well as points, Rects, and Frects.
- A variety of utility and situational methods.
Please note that the current pygame-geometry codebase may contain functionality that will not be included in the port or may undergo significant modifications.
If you are interested in exploring the complete codebase for the project or help with the port, you can find it here:
Integration Progress
The integration is happening in phases, starting with Circle and later Line and Polygon. Each shape will then be slowly built upon piece by piece.
At the moment the Line object is being actively ported
- geometry module base:
geometrymodule,Circlebase #2268 -
pg_DoubleFromObj/pg_TwoDoublesFromObjC api:geometrymodule,Circlebase #2268
Circle
-
Circleobject:geometrymodule,Circlebase #2268
Attributes
-
x:geometrymodule,Circlebase #2268 -
y:geometrymodule,Circlebase #2268 -
r:geometrymodule,Circlebase #2268 -
r_sqr: Added missing Circle attrs #2519 -
diameter/d: Added missing Circle attrs #2519 -
center: Added missing Circle attrs #2519 -
area: Added missing Circle attrs #2519 -
circumference: Added missing Circle attrs #2519 -
top/bottom/left/right: Added additional circle attributes #3127
Methods
-
copy():geometrymodule,Circlebase #2268 -
repr/str/print:geometrymodule,Circlebase #2268 -
move/move_ip: Add Circlemove()/move_ip()#2561 -
update: Add Circleupdate()#2562 -
as_rect/as_frect: Add Circleas_rect()/as_frect()#2634 -
rotate / rotate_ip: Add Circlerotate()/rotate_ip()#2662 -
collidepoint: Add Circlecollidepoint()#2536 -
collidecircle: Add Circlecollidecircle()#2540 -
colliderect: Add Circlecolliderect()#2560 -
collideswith: Add Circlecollideswith()#2661 -
contains: Add Circlecontains()#2791 -
collidelist / collidelistall: AddCircle.collidelist/collidelistall()#2880 -
intersect: AddCircle.intersect()#3071 -
collideline -
collidepolygon
Line
-
Lineobject: Addedgeometry.Linebase #3131
Attributes
-
ax,ay,bx,byAddedgeometry.Linebase #3131 -
a,bAddedgeometry.Linebase #3131 -
center: Add moreLineattributes #3268 -
centerx,centery: Add moreLineattributes #3268 -
length: AddedLinemethods andlengthattribute #3179 -
angle: Add moreLineattributes #3268 -
slope: Add moreLineattributes #3268
Methods
-
move/move_ip: AddedLinemethods andlengthattribute #3179 -
rotate/rotate_ip -
scale/scale_ip: AddedLinemethods andlengthattribute #3179 -
flip_ab/flip_ab_ip: AddedLinemethods andlengthattribute #3179 -
update: AddedLinemethods andlengthattribute #3179 -
copy: Addedgeometry.Linebase #3131 -
collidepoint -
collidecircle -
collideline -
colliderect -
collidepolygon -
collideswith -
as_circle -
as_rect -
is_parallel -
is_perpendicular -
at -
as_segments -
as_points -
collidelist / collidelistall -
intersect
Polygon
-
Polygonobject
Attributes
-
vertices -
verts_num -
center -
centerx,centery -
perimeter -
area
Methods
-
move/move_ip -
copy -
collidepoint -
collideline -
collidecircle -
insert_vertex -
remove_vertex -
pop_vertex -
is_convex -
scale/ scale_ip -
as_segments -
as_rect -
rotate/rotate_ip -
collidelist / collidelistall -
intersect
Rect & Frect
Methods
-
collidecircle: Add(F)Rect.collidecircle()#2886 -
collideline -
collidepolygon -
collideswith -
as_polygon
Other
-
regular_polygon -
raycast -
multiraycast - Integrate
Circleinto draw.circle - Integrate
Lineinto draw.line - Integrate
Polygoninto draw.polygon