Images?

  1. X-13
    X-13
    I'm messing about with enemy AI and got to thinking about graphics.

    In python you can either import an image file or draw it. At the moment I'm using bmp files, but for what they are, it may be easier to use pygame.draw.rect [with surface.fill(black)] for the paddles and ball.


    [surface.fill can also be hardware accelerated, apparently.]

    Has anyone used pygame.draw to make graphics? If you have, could you lend a hand with syntax, I keep getting "invalid argument".
  2. tmcd35
    tmcd35
    I used this...

    Code:
    pygame.draw.line(screen,black,[50,400],[200,400],10)
    To draw the platform in my code. Should be usable for a pong game. The arguements inside the braces are...

    (<varible for display graphics outputting to>, <colour of line in format (R, G, B)>, <start coordinates in format [x,y]>, <end cordinates in format [x,y], <pixel width>)
  3. X-13
    X-13
    I can't remember the exact syntax I used, but it was similar to that.

    I used rect instead of line, as I was trying to merge 2 things. [get_rect and the image]

    Also, I set the pixel width to 0. If pixel width is 0 it's supposed to fill it with the colour.
Results 1 to 3 of 3