Draw No Draw
draw the curtain
Mapbox Draw accepts functionality changes after the functionality has been proven out via a custom mode. This lets users experiment and validate their mode before entering a review process, hopefully promoting innovation. Definition of draw the curtain in the Idioms Dictionary. Draw the curtain phrase. What does draw the curtain expression mean? Definitions by the largest Idiom Dictionary.
draw the curtain
Want to thank TFD for its existence? Tell a friend about us, add a link to this page, or visit the webmaster's page for free fun content.
Link to this page:
pygame.draw.rect | — | draw a rectangle |
pygame.draw.polygon | — | draw a polygon |
pygame.draw.circle | — | draw a circle |
pygame.draw.ellipse | — | draw an ellipse |
pygame.draw.arc | — | draw an elliptical arc |
pygame.draw.line | — | draw a straight line |
pygame.draw.lines | — | draw multiple contiguous straight line segments |
pygame.draw.aaline | — | draw a straight antialiased line |
pygame.draw.aalines | — | draw multiple contiguous straight antialiased line segments |
Draw several simple shapes to a surface. These functions will work forrendering to any format of surface. Rendering to hardware surfaces will beslower than regular software surfaces.
Most of the functions take a width argument to represent the size of stroke(thickness) around the edge of the shape. If a width of 0 is passed the shapewill be filled (solid).
All the drawing functions respect the clip area for the surface and will beconstrained to that area. The functions return a rectangle representing thebounding area of changed pixels. This bounding rectangle is the 'minimum'bounding box that encloses the affected area.
All the drawing functions accept a color argument that can be one of thefollowing formats:
- a object
- an
(RGB)
triplet (tuple/list) - an
(RGBA)
quadruplet (tuple/list) - an integer value that has been mapped to the surface's pixel format(see and )
A color's alpha value will be written directly into the surface (if thesurface contains pixel alphas), but the draw function will not drawtransparently.
These functions temporarily lock the surface they are operating on. Manysequential drawing calls can be sped up by locking and unlocking the surfaceobject around the draw calls (see and).
pygame.draw.
rect
()¶Draws a rectangle on the given surface.
Parameters: |
|
---|---|
Returns: | a rect bounding the changed pixels, if nothing is drawn thebounding rect's position will be the position of the given |
Return type: |
Note
The method works just as well for drawingfilled rectangles and can be hardware accelerated on some platforms withboth software and hardware display modes.
Changed in pygame 2.0.0: Added support for keyword arguments.
Changed in pygame 2.0.0.dev8: Added support for border radius.
pygame.draw.
polygon
()¶Draws a polygon on the given surface.
Parameters: |
|
---|---|
Returns: | a rect bounding the changed pixels, if nothing is drawn thebounding rect's position will be the position of the first point in the |
Return type: | |
Raises: |
|
Note
For an aapolygon, use aalines()
with closed=True
.
Changed in pygame 2.0.0: Added support for keyword arguments.
pygame.draw.
circle
()¶Draws a circle on the given surface.
Parameters: |
|
---|---|
Returns: | a rect bounding the changed pixels, if nothing is drawn thebounding rect's position will be the |
Return type: | |
Raises: |
|
Changed in pygame 2.0.0: Added support for keyword arguments.Nothing is drawn when the radius is 0 (a pixel at the center
coordinatesused to be drawn when the radius equaled 0).Floats, and Vector2 are accepted for the center
param.The drawing algorithm was improved to look more like a circle.
Changed in pygame 2.0.0.dev8: Added support for drawing circle quadrants.
pygame.draw.
ellipse
()¶Draws an ellipse on the given surface.
Parameters: |
|
---|---|
Returns: | a rect bounding the changed pixels, if nothing is drawn thebounding rect's position will be the position of the given |
Return type: |
Changed in pygame 2.0.0: Added support for keyword arguments.
pygame.draw.
arc
()¶Draws an elliptical arc on the given surface.
The two angle arguments are given in radians and indicate the start and stoppositions of the arc. The arc is drawn in a counterclockwise direction fromthe start_angle
to the stop_angle
.
Parameters: |
|
---|---|
Returns: | a rect bounding the changed pixels, if nothing is drawn thebounding rect's position will be the position of the given |
Return type: |
Changed in pygame 2.0.0: Added support for keyword arguments.
pygame.draw.
line
()¶Draws a straight line on the given surface. There are no endcaps. For thicklines the ends are squared off.
Parameters: |
|
---|---|
Returns: | a rect bounding the changed pixels, if nothing is drawn thebounding rect's position will be the |
Return type: | |
Raises: | TypeError -- if |
Changed in pygame 2.0.0: Added support for keyword arguments.
pygame.draw.
lines
()¶Draw No Draw 3d
Draws a sequence of contiguous straight lines on the given surface. There areno endcaps or miter joints. For thick lines the ends are squared off.Drawing thick lines with sharp corners can have undesired looking results.
Parameters: |
|
---|---|
Returns: | a rect bounding the changed pixels, if nothing is drawn thebounding rect's position will be the position of the first point in the |
Return type: | |
Raises: |
|
Changed in pygame 2.0.0: Added support for keyword arguments.
pygame.draw.
aaline
()¶Draws a straight antialiased line on the given surface.
The line has a thickness of one pixel and the endpoints have a height andwidth of one pixel each.
If both endpoints are equal, only a single pixel is drawn (afterrounding floats to nearest integer).
Otherwise if the line is not steep (i.e. if the length along the x-axisis greater than the height along the y-axis):
For each endpoint:
If x
, the endpoint's x-coordinate, is a whole number findwhich pixels would be covered by it and draw them.
Otherwise:
Calculate the position of the nearest point with a whole numberfor it's x-coordinate, when extending the line past theendpoint.
Find which pixels would be covered and how much by that point.
If the endpoint is the left one, multiply the coverage by (1 -the decimal part of x
).
Otherwise multiply the coverage by the decimal part of x
.
Then draw those pixels.
((1,1.3),(5,3))
wouldcover 70% of the pixel (1,1)
and 30% of the pixel(1,2)
while the right one would cover 100% of thepixel (5,3)
.((1.2,1.4),(4.6,3.1))
would cover 56% (i.e. 0.8 * 70%) of the pixel (1,1)
and 24% (i.e. 0.8 * 30%) of the pixel (1,2)
whilethe right one would cover 42% (i.e. 0.6 * 70%) of thepixel (5,3)
and 18% (i.e. 0.6 * 30%) of the pixel(5,4)
while the rightThen for each point between the endpoints, along the line, whosex-coordinate is a whole number:
Find which pixels would be covered and how much by that point anddraw them.
((1,1),(4,2.5))
would be(2,1.5)
and (3,2)
and would cover 50% of the pixel(2,1)
, 50% of the pixel (2,2)
and 100% of the pixel(3,2)
.((1.2,1.4),(4.6,3.1))
wouldbe (2,1.8)
(covering 20% of the pixel (2,1)
and 80%of the pixel (2,2)
), (3,2.3)
(covering 70% of thepixel (3,2)
and 30% of the pixel (3,3)
) and (4,2.8)
(covering 20% of the pixel (2,1)
and 80% of thepixel (2,2)
)Otherwise do the same for steep lines as for non-steep lines exceptalong the y-axis instead of the x-axis (using y
instead of x
,top instead of left and bottom instead of right).
Note
Regarding float values for coordinates, a point with coordinateconsisting of two whole numbers is considered being right in the centerof said pixel (and having a height and width of 1 pixel would thereforecompletely cover it), while a point with coordinate where one (or both)of the numbers have non-zero decimal parts would be partially coveringtwo (or four if both numbers have decimal parts) adjacent pixels, e.g.the point (1.4,2)
covers 60% of the pixel (1,2)
and 40% of thepixel (2,2)
.
Parameters: |
|
---|---|
Returns: | a rect bounding the changed pixels, if nothing is drawn thebounding rect's position will be the |
Return type: | |
Raises: | TypeError -- if |
Draw No Drawings
Changed in pygame 2.0.0: Added support for keyword arguments.
pygame.draw.
aalines
()¶Draws a sequence of contiguous straight antialiased lines on the givensurface.
Parameters: |
|
---|---|
Returns: | a rect bounding the changed pixels, if nothing is drawn thebounding rect's position will be the position of the first point in the |
Return type: | |
Raises: |
|
Draw No Draw Online
Changed in pygame 2.0.0: Added support for keyword arguments.