-
dudraw
index.html
Package
Package
PUBLIC
No package docstring; 2/2 modules documented
-
dudraw.color
dudraw.color.html
Module
Module
PUBLIC
color.py
-
dudraw.dudraw
dudraw.dudraw.html
Module
Module
PUBLIC
dudraw.py
-
dudraw.dudraw._BORDER
dudraw.dudraw.html#_BORDER
Attribute
Constant
PRIVATE
Undocumented
-
dudraw.dudraw._DEFAULT_XMIN
dudraw.dudraw.html#_DEFAULT_XMIN
Attribute
Constant
PRIVATE
Undocumented
-
dudraw.dudraw._DEFAULT_XMAX
dudraw.dudraw.html#_DEFAULT_XMAX
Attribute
Constant
PRIVATE
Undocumented
-
dudraw.dudraw._DEFAULT_YMIN
dudraw.dudraw.html#_DEFAULT_YMIN
Attribute
Constant
PRIVATE
Undocumented
-
dudraw.dudraw._DEFAULT_YMAX
dudraw.dudraw.html#_DEFAULT_YMAX
Attribute
Constant
PRIVATE
Undocumented
-
dudraw.dudraw._DEFAULT_CANVAS_SIZE
dudraw.dudraw.html#_DEFAULT_CANVAS_SIZE
Attribute
Constant
PRIVATE
Undocumented
-
dudraw.dudraw._DEFAULT_PEN_WIDTH
dudraw.dudraw.html#_DEFAULT_PEN_WIDTH
Attribute
Constant
PRIVATE
Undocumented
-
dudraw.dudraw._DEFAULT_FONT_FAMILY
dudraw.dudraw.html#_DEFAULT_FONT_FAMILY
Attribute
Constant
PRIVATE
Undocumented
-
dudraw.dudraw._DEFAULT_FONT_SIZE
dudraw.dudraw.html#_DEFAULT_FONT_SIZE
Attribute
Constant
PRIVATE
Undocumented
-
dudraw.dudraw._xmin
dudraw.dudraw.html#_xmin
Attribute
Variable
PRIVATE
Undocumented
-
dudraw.dudraw._ymin
dudraw.dudraw.html#_ymin
Attribute
Variable
PRIVATE
Undocumented
-
dudraw.dudraw._xmax
dudraw.dudraw.html#_xmax
Attribute
Variable
PRIVATE
Undocumented
-
dudraw.dudraw._ymax
dudraw.dudraw.html#_ymax
Attribute
Variable
PRIVATE
Undocumented
-
dudraw.dudraw._canvas_width
dudraw.dudraw.html#_canvas_width
Attribute
Variable
PRIVATE
Undocumented
-
dudraw.dudraw._canvas_height
dudraw.dudraw.html#_canvas_height
Attribute
Variable
PRIVATE
Undocumented
-
dudraw.dudraw._pen_width
dudraw.dudraw.html#_pen_width
Attribute
Variable
PRIVATE
Undocumented
-
dudraw.dudraw._keys_typed
dudraw.dudraw.html#_keys_typed
Attribute
Variable
PRIVATE
Undocumented
-
dudraw.dudraw._keys_released
dudraw.dudraw.html#_keys_released
Attribute
Variable
PRIVATE
Undocumented
-
dudraw.dudraw._keys_pressed
dudraw.dudraw.html#_keys_pressed
Attribute
Variable
PRIVATE
Undocumented
-
dudraw.dudraw._window_created
dudraw.dudraw.html#_window_created
Attribute
Variable
PRIVATE
Undocumented
-
dudraw.dudraw._mouse_clicked
dudraw.dudraw.html#_mouse_clicked
Attribute
Variable
PRIVATE
Undocumented
-
dudraw.dudraw._mouse_released
dudraw.dudraw.html#_mouse_released
Attribute
Variable
PRIVATE
Undocumented
-
dudraw.dudraw._mouse_is_pressed
dudraw.dudraw.html#_mouse_is_pressed
Attribute
Variable
PRIVATE
Undocumented
-
dudraw.dudraw._mouse_dragged
dudraw.dudraw.html#_mouse_dragged
Attribute
Variable
PRIVATE
Undocumented
-
dudraw.dudraw._mouse_pos
dudraw.dudraw.html#_mouse_pos
Attribute
Variable
PRIVATE
Undocumented
-
dudraw.dudraw._pygame_color
dudraw.dudraw.html#_pygame_color
Function
Function
PRIVATE
Convert c, an object of type Color, to an equivalent object of type pygame.Color. Return the result.
-
dudraw.dudraw._ccw
dudraw.dudraw.html#_ccw
Function
Function
PRIVATE
Undocumented
-
dudraw.dudraw._intersect
dudraw.dudraw.html#_intersect
Function
Function
PRIVATE
Undocumented
-
dudraw.dudraw._scale_x
dudraw.dudraw.html#_scale_x
Function
Function
PRIVATE
Undocumented
-
dudraw.dudraw._scale_y
dudraw.dudraw.html#_scale_y
Function
Function
PRIVATE
Undocumented
-
dudraw.dudraw._scale_point
dudraw.dudraw.html#_scale_point
Function
Function
PRIVATE
Undocumented
-
dudraw.dudraw._factor_x
dudraw.dudraw.html#_factor_x
Function
Function
PRIVATE
Undocumented
-
dudraw.dudraw._factor_y
dudraw.dudraw.html#_factor_y
Function
Function
PRIVATE
Undocumented
-
dudraw.dudraw._user_x
dudraw.dudraw.html#_user_x
Function
Function
PRIVATE
Undocumented
-
dudraw.dudraw._user_y
dudraw.dudraw.html#_user_y
Function
Function
PRIVATE
Undocumented
-
dudraw.dudraw._pen_width_pixels
dudraw.dudraw.html#_pen_width_pixels
Function
Function
PRIVATE
Undocumented
-
dudraw.dudraw._line_width_pixels
dudraw.dudraw.html#_line_width_pixels
Function
Function
PRIVATE
Undocumented
-
dudraw.dudraw.set_canvas_size
dudraw.dudraw.html#set_canvas_size
Function
Function
PUBLIC
Set the size of the canvas to w pixels wide and h pixels high.
-
dudraw.dudraw.get_canvas_width
dudraw.dudraw.html#get_canvas_width
Function
Function
PUBLIC
Return the width of the current canvas.
-
dudraw.dudraw.get_canvas_height
dudraw.dudraw.html#get_canvas_height
Function
Function
PUBLIC
Return the height of the current canvas.
-
dudraw.dudraw.get_pixel_color
dudraw.dudraw.html#get_pixel_color
Function
Function
PUBLIC
Return the color of the pixel at the given user coordinates.
-
dudraw.dudraw.set_x_scale
dudraw.dudraw.html#set_x_scale
Function
Function
PUBLIC
Set the x-scale of the canvas such that the minimum y value is min and the maximum y value is max.
-
dudraw.dudraw.set_y_scale
dudraw.dudraw.html#set_y_scale
Function
Function
PUBLIC
Set the y-scale of the canvas such that the minimum y value is min and the maximum y value is max.
-
dudraw.dudraw.set_scale
dudraw.dudraw.html#set_scale
Function
Function
PUBLIC
Set the x-scale and y-scale of the canvas to the same range for both directions.
-
dudraw.dudraw.set_pen_width
dudraw.dudraw.html#set_pen_width
Function
Function
PUBLIC
Set the pen width/radius to w
-
dudraw.dudraw.set_pen_color
dudraw.dudraw.html#set_pen_color
Function
Function
PUBLIC
Set the pen color to c, where c is an object of class Color. c defaults to dudraw.BLACK.
-
dudraw.dudraw.set_pen_color_rgb
dudraw.dudraw.html#set_pen_color_rgb
Function
Function
PUBLIC
Set the pen color using red, green, blue, and alpha transparency values. Defaults to black with no transparency (solid color).
-
dudraw.dudraw.get_pen_color
dudraw.dudraw.html#get_pen_color
Function
Function
PUBLIC
Return the pen color as an object of class Color.
-
dudraw.dudraw.set_font_family
dudraw.dudraw.html#set_font_family
Function
Function
PUBLIC
Set the font family to f (e.g. 'Helvetica' or 'Courier').
-
dudraw.dudraw.set_font_size
dudraw.dudraw.html#set_font_size
Function
Function
PUBLIC
Set the font size to s (e.g. 12, 14, 16..etc).
-
dudraw.dudraw._make_sure_window_created
dudraw.dudraw.html#_make_sure_window_created
Function
Function
PRIVATE
Undocumented
-
dudraw.dudraw._pixel
dudraw.dudraw.html#_pixel
Function
Function
PRIVATE
Draw on the canvas a pixel at (x, y).
-
dudraw.dudraw.point
dudraw.dudraw.html#point
Function
Function
PUBLIC
Draw on the canvas a point at coordinates (x, y).
-
dudraw.dudraw.line
dudraw.dudraw.html#line
Function
Function
PUBLIC
Draw on the canvas a line from (x0, y0) to (x1, y1).
-
dudraw.dudraw.circle
dudraw.dudraw.html#circle
Function
Function
PUBLIC
Draw on the canvas a circle of radius r centered on (x, y).
-
dudraw.dudraw.filled_circle
dudraw.dudraw.html#filled_circle
Function
Function
PUBLIC
Draw on the canvas a filled circle of radius r centered on (x, y).
-
dudraw.dudraw.ellipse
dudraw.dudraw.html#ellipse
Function
Function
PUBLIC
Draw on the canvas an ellipse centered at (x, y) with a width of 2.0 * half_width, and a height of 2.0 * half_height.
-
dudraw.dudraw.filled_ellipse
dudraw.dudraw.html#filled_ellipse
Function
Function
PUBLIC
Draw on the canvas a filled ellipse centered at (x, y) with a width of 2.0 * half_width, and a height of 2.0 * half_height.
-
dudraw.dudraw.rectangle
dudraw.dudraw.html#rectangle
Function
Function
PUBLIC
Draw on the canvas a rectangle of width (2 * halfWidth and height (2 * halfHeight) centered at point (x, y).
-
dudraw.dudraw.filled_rectangle
dudraw.dudraw.html#filled_rectangle
Function
Function
PUBLIC
Draw on the canvas a rectangle of width (2 * halfWidth and height (2 * halfHeight) centered at point (x, y).
-
dudraw.dudraw.square
dudraw.dudraw.html#square
Function
Function
PUBLIC
Draw on the canvas a square whose sides are of length 2r, centered on (x, y).
-
dudraw.dudraw.filled_square
dudraw.dudraw.html#filled_square
Function
Function
PUBLIC
Draw on the canvas a filled square whose sides are of length 2r, centered on (x, y).
-
dudraw.dudraw.polyline
dudraw.dudraw.html#polyline
Function
Function
PUBLIC
Draw on the canvas a polyline with coordinates (x[i], y[i]).
-
dudraw.dudraw.polygon
dudraw.dudraw.html#polygon
Function
Function
PUBLIC
Draw on the canvas a polygon with coordinates (x[i], y[i]).
-
dudraw.dudraw.filled_polygon
dudraw.dudraw.html#filled_polygon
Function
Function
PUBLIC
Draw on the canvas a filled polygon with coordinates (x[i], y[i]).
-
dudraw.dudraw.triangle
dudraw.dudraw.html#triangle
Function
Function
PUBLIC
Draw a triangle on the canvas with corners at (x0, y0), (x1, y1), and (x2, y2).
-
dudraw.dudraw.filled_triangle
dudraw.dudraw.html#filled_triangle
Function
Function
PUBLIC
Draw a filled triangle on the canvas with corners at (x0, y0), (x1, y1), and (x2, y2).
-
dudraw.dudraw.quadrilateral
dudraw.dudraw.html#quadrilateral
Function
Function
PUBLIC
Draw a quadrilateral on the canvas with corners at (x0, y0), (x1, y1), (x2, y2), and (x3, y3).
-
dudraw.dudraw.filled_quadrilateral
dudraw.dudraw.html#filled_quadrilateral
Function
Function
PUBLIC
Draw a filled quadrilateral on the canvas with corners at (x0, y0), (x1, y1), (x2, y2), and (x3, y3).
-
dudraw.dudraw.arc
dudraw.dudraw.html#arc
Function
Function
PUBLIC
Draw an arc portion between angle1 and angle2, of the circumference of a circle centered at (x, y) with a radius r.
-
dudraw.dudraw.elliptical_arc
dudraw.dudraw.html#elliptical_arc
Function
Function
PUBLIC
Draw an arc portion between angle1 and angle2, of the circumference of an ellipse centered at (x, y) with a width of half_width, and a height of 2.0 * half_height.
-
dudraw.dudraw.sector
dudraw.dudraw.html#sector
Function
Function
PUBLIC
Draw a sector portion between angle1 and angle2, of the interior of a circle centered at (x, y) with a radius r.
-
dudraw.dudraw.filled_sector
dudraw.dudraw.html#filled_sector
Function
Function
PUBLIC
Draw a filled sector portion between angle1 and angle2, of the interior of a circle centered at (x, y) with a radius r.
-
dudraw.dudraw.elliptical_sector
dudraw.dudraw.html#elliptical_sector
Function
Function
PUBLIC
Draw a sector portion between angle1 and angle2, of the interior of an ellipse centered at (x, y) with a width of half_width, and a height of 2.0 * half_height.
-
dudraw.dudraw.filled_elliptical_sector
dudraw.dudraw.html#filled_elliptical_sector
Function
Function
PUBLIC
Draw a filled sector portion between angle1 and angle2, of the interior of an ellipse centered at (x, y) with a width of half_width, and a height of 2.0 * half_height.
-
dudraw.dudraw.annulus
dudraw.dudraw.html#annulus
Function
Function
PUBLIC
Draw an annulus centered at (x, y) with outer radius r1, and inner radius r2.
-
dudraw.dudraw.filled_annulus
dudraw.dudraw.html#filled_annulus
Function
Function
PUBLIC
Draw a filled annulus centered at (x, y) with outer radius r1, and inner radius r2.
-
dudraw.dudraw.text
dudraw.dudraw.html#text
Function
Function
PUBLIC
Draw a line of string on the canvas centered at (x, y).
-
dudraw.dudraw.picture
dudraw.dudraw.html#picture
Function
Function
PUBLIC
Draw pic on the canvas centered at (x, y).
-
dudraw.dudraw.clear
dudraw.dudraw.html#clear
Function
Function
PUBLIC
Clear the canvas to color c, where c is an object of class Color. c defaults to dudraw.WHITE.
-
dudraw.dudraw.clear_rgb
dudraw.dudraw.html#clear_rgb
Function
Function
PUBLIC
Clear the canvas to color defined by r, g, b, and a (alpha transparency). Defaults to white (255, 255, 255) with no transparency.
-
dudraw.dudraw.save
dudraw.dudraw.html#save
Function
Function
PUBLIC
Save the window canvas as a .jpg to filepath specified.
-
dudraw.dudraw._show
dudraw.dudraw.html#_show
Function
Function
PRIVATE
Copy the canvas to the window canvas.
-
dudraw.dudraw._show_and_wait_forever
dudraw.dudraw.html#_show_and_wait_forever
Function
Function
PRIVATE
Copy the canvas to the window canvas. Then wait forever, that is, until the user closes the dudraw window.
-
dudraw.dudraw.show
dudraw.dudraw.html#show
Function
Function
PUBLIC
Copy the canvas to the window canvas, and then wait for msec milliseconds. msec defaults to 0.0.
-
dudraw.dudraw._check_for_events
dudraw.dudraw.html#_check_for_events
Function
Function
PRIVATE
Check if any new event has occured (such as a key typed or button pressed). If a key has been typed, then put that key in a queue.
-
dudraw.dudraw.next_key
dudraw.dudraw.html#next_key
Function
Function
PUBLIC
Return a string representing a key that was typed since the last time this function, or the keys_typed() function was called.
-
dudraw.dudraw.keys_typed
dudraw.dudraw.html#keys_typed
Function
Function
PUBLIC
Return the set of keys that the user has typed since the last time this function was called.
-
dudraw.dudraw.keys_released
dudraw.dudraw.html#keys_released
Function
Function
PUBLIC
Return the set of keys that the user has released since the last time this function was called.
-
dudraw.dudraw.keys_pressed
dudraw.dudraw.html#keys_pressed
Function
Function
PUBLIC
Return the set of keys that are currently being held down by the user.
-
dudraw.dudraw.has_next_key_typed
dudraw.dudraw.html#has_next_key_typed
Function
Function
PUBLIC
Return True if the user has pressed a key since the last call, otherwise False.
-
dudraw.dudraw.next_key_typed
dudraw.dudraw.html#next_key_typed
Function
Function
PUBLIC
Return a string representing a key that was typed since the last time this function, or the keys_typed() function was called.
-
dudraw.dudraw.mouse_clicked
dudraw.dudraw.html#mouse_clicked
Function
Function
PUBLIC
Return True if the left mouse button has been pressed since the last check, and False otherwise.
-
dudraw.dudraw.mouse_released
dudraw.dudraw.html#mouse_released
Function
Function
PUBLIC
Return True if the left mouse button has been released since the last check, and False otherwise.
-
dudraw.dudraw.mouse_is_pressed
dudraw.dudraw.html#mouse_is_pressed
Function
Function
PUBLIC
Return True if the left mouse button is currently being held down, and False otherwise.
-
dudraw.dudraw.mouse_dragged
dudraw.dudraw.html#mouse_dragged
Function
Function
PUBLIC
Return True if the mouse is being click-and-dragged on the canvas, and False otherwise.
-
dudraw.dudraw.mouse_x
dudraw.dudraw.html#mouse_x
Function
Function
PUBLIC
Return the x coordinate in user space of the mouse cursor.
-
dudraw.dudraw.mouse_y
dudraw.dudraw.html#mouse_y
Function
Function
PUBLIC
Return the y coordinate in user space of the mouse cursor.
-
dudraw.dudraw._regression_test
dudraw.dudraw.html#_regression_test
Function
Function
PRIVATE
Perform regression testing.
-
dudraw.dudraw._main
dudraw.dudraw.html#_main
Function
Function
PRIVATE
Dispatch to a function that does regression testing, or to a dialog-box-handling function.
-
dudraw.color.Color
dudraw.color.Color.html
Class
Class
PUBLIC
A Color object models an RGB with Alpha Transparency color.
-
dudraw.color.Color.__init__
dudraw.color.Color.html#__init__
Function
Method
PUBLIC
Construct self such that it has the given red (r), green (g), blue (b), and alpha (a) components. alpha (a) defaults to 255 which is non-transparent solid color.
-
dudraw.color.Color._r
dudraw.color.Color.html#_r
Attribute
Instance Variable
PRIVATE
Undocumented
-
dudraw.color.Color._g
dudraw.color.Color.html#_g
Attribute
Instance Variable
PRIVATE
Undocumented
-
dudraw.color.Color._b
dudraw.color.Color.html#_b
Attribute
Instance Variable
PRIVATE
Undocumented
-
dudraw.color.Color._a
dudraw.color.Color.html#_a
Attribute
Instance Variable
PRIVATE
Undocumented
-
dudraw.color.Color.get_red
dudraw.color.Color.html#get_red
Function
Method
PUBLIC
Return the red component of self.
-
dudraw.color.Color.get_green
dudraw.color.Color.html#get_green
Function
Method
PUBLIC
Return the green component of self.
-
dudraw.color.Color.get_blue
dudraw.color.Color.html#get_blue
Function
Method
PUBLIC
Return the blue component of self.
-
dudraw.color.Color.get_alpha
dudraw.color.Color.html#get_alpha
Function
Method
PUBLIC
Return the alpha transparency component of self.
-
dudraw.color.Color.__str__
dudraw.color.Color.html#__str__
Function
Method
PUBLIC
Return the string equivalent of self, that is, a string of the form '(r, g, b)'.
-
dudraw.color.WHITE
dudraw.color.html#WHITE
Attribute
Constant
PUBLIC
Undocumented
-
dudraw.color.BLACK
dudraw.color.html#BLACK
Attribute
Constant
PUBLIC
Undocumented
-
dudraw.color.RED
dudraw.color.html#RED
Attribute
Constant
PUBLIC
Undocumented
-
dudraw.color.GREEN
dudraw.color.html#GREEN
Attribute
Constant
PUBLIC
Undocumented
-
dudraw.color.BLUE
dudraw.color.html#BLUE
Attribute
Constant
PUBLIC
Undocumented
-
dudraw.color.CYAN
dudraw.color.html#CYAN
Attribute
Constant
PUBLIC
Undocumented
-
dudraw.color.MAGENTA
dudraw.color.html#MAGENTA
Attribute
Constant
PUBLIC
Undocumented
-
dudraw.color.YELLOW
dudraw.color.html#YELLOW
Attribute
Constant
PUBLIC
Undocumented
-
dudraw.color.DARK_RED
dudraw.color.html#DARK_RED
Attribute
Constant
PUBLIC
Undocumented
-
dudraw.color.DARK_GREEN
dudraw.color.html#DARK_GREEN
Attribute
Constant
PUBLIC
Undocumented
-
dudraw.color.DARK_BLUE
dudraw.color.html#DARK_BLUE
Attribute
Constant
PUBLIC
Undocumented
-
dudraw.color.GRAY
dudraw.color.html#GRAY
Attribute
Constant
PUBLIC
Undocumented
-
dudraw.color.DARK_GRAY
dudraw.color.html#DARK_GRAY
Attribute
Constant
PUBLIC
Undocumented
-
dudraw.color.LIGHT_GRAY
dudraw.color.html#LIGHT_GRAY
Attribute
Constant
PUBLIC
Undocumented
-
dudraw.color.ORANGE
dudraw.color.html#ORANGE
Attribute
Constant
PUBLIC
Undocumented
-
dudraw.color.VIOLET
dudraw.color.html#VIOLET
Attribute
Constant
PUBLIC
Undocumented
-
dudraw.color.PINK
dudraw.color.html#PINK
Attribute
Constant
PUBLIC
Undocumented
-
dudraw.color.BOOK_BLUE
dudraw.color.html#BOOK_BLUE
Attribute
Constant
PUBLIC
Undocumented
-
dudraw.color.BOOK_LIGHT_BLUE
dudraw.color.html#BOOK_LIGHT_BLUE
Attribute
Constant
PUBLIC
Undocumented
-
dudraw.color.BOOK_RED
dudraw.color.html#BOOK_RED
Attribute
Constant
PUBLIC
Undocumented
-
dudraw.color._main
dudraw.color.html#_main
Function
Function
PRIVATE
For testing: