| Home | Trees | Index | Help |
|---|
| Package ocempgui :: Package draw :: Module Draw |
|
| Function Summary | |
|---|---|
draw_line (...) -> Rect | |
draw_rect (...) -> Surface | |
draw_triangle (...) -> Rect | |
| Function Details |
|---|
draw_line(surface, color, a, b, width=1)draw_line (...) -> Rect Draws a line on a surface. The 'color' argument needs to match the pygame color style. 'a' and 'b' are sequences of the x- and y-coordinate on the surface and 'width' denotes the width of the line in pixels. The return value is the bounding box of the affected area. The following example would draw a horizontal black line on the specified surface (the surface must be big enough): draw_line (surface, (0, 0, 0), (5, 5), (5, 10)) Note: This function is just a wrapper around pygame.draw.line() and thus all documentation about it can be applied to this function, too. |
draw_rect(width, height, color=None)draw_rect (...) -> Surface Creates a rectangle surface. Creates a pygame.Surface with the size of 'width' and 'height' and fills it with the given background color 'color', which needs to match the pygame color style. If no color is provided, the surface will be left unfilled. The following example creates a red square surface: draw_rect (10, 10, (255, 0, 0)) Note: This method calls pygame.Surface() to create the surface, but does not provide any values for the flags, depth or masks, which can be applied in the pygame.Surface() call. It uses the default values given by pygame. If this is not wanted, it is recommended to override this function, where necessary. |
draw_triangle(surface, color, a, b, c, width=0)draw_triangle (...) -> Rect Draws a triangle with the vertices a, b, c on a surface. The 'color' argument needs to match the pygame color style. 'a', 'b', 'c' are sequences of the x- and y-coordinates of the three vertices on th surface. 'width' denotes the width of lines in pixels or, if set to 0, fills the triangle with the passed color. The return value is the bounding box of the affected area. The following example would draw a white, filled triangle on the specified surface: draw_triangle (surface, (255, 255, 255), (5, 1), (1, 5), (10, 5)) Note: This function is a wrapper around pygame.draw.polygon() with a fixed three point list and thus all documentation about it can be applied to this function, too. |
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Thu Jan 10 10:18:45 2008 | http://epydoc.sf.net |