Example #1
0
                    random.randint(0, 255),
                    255,
                )
                area = (4 * x_, 4 * y_, 4, 4)
                surf.fill(newcol, area)
        streamtex.update(surf)
        next_tex_update = curtime + tex_update_interval
    streamtex.draw(dstrect=pg.Rect(64, 128, 64, 64))

    tex.draw(dstrect=(x, y))

    # TODO: should these be?
    # - line instead of draw_line
    # - point instead of draw_point
    # - rect(rect, width=1)->draw 1 pixel, instead of draw_rect
    # - rect(rect, width=0)->filled ? , instead of fill_rect
    #
    # TODO: should these work with pg.draw.line(renderer, ...) functions?
    renderer.draw_color = (255, 255, 255, 255)
    renderer.draw_line((0, 0), (64, 64))
    renderer.draw_line((64, 64), (128, 0))
    renderer.draw_point((72, 32))
    renderer.draw_rect(pg.Rect(0, 64, 64, 64))
    renderer.fill_rect(pg.Rect(0, 128, 64, 64))
    renderer.draw_color = backgrounds[bg_index]

    renderer.present()

    clock.tick(60)
    win.title = str("FPS: {}".format(clock.get_fps()))
Example #2
0
                         random.randint(0, 255), \
                         random.randint(0, 255), \
                         255
                area = (4 * x_, 4 * y_, 4, 4)
                surf.fill(newcol, area)
        streamtex.update(surf)
        next_tex_update = curtime + tex_update_interval
    streamtex.draw(dstrect=pygame.Rect(64, 128, 64, 64))

    tex.draw(dstrect=(x, y))

    #TODO: should these be?
    # - line instead of draw_line
    # - point instead of draw_point
    # - rect(rect, width=1)->draw 1 pixel, instead of draw_rect
    # - rect(rect, width=0)->filled ? , instead of fill_rect
    #
    # TODO: should these work with pygame.draw.line(renderer, ...) functions?
    renderer.draw_color = (255, 255, 255, 255)
    renderer.draw_line((0, 0), (64, 64))
    renderer.draw_line((64, 64), (128, 0))
    renderer.draw_point((72, 32))
    renderer.draw_rect(pygame.Rect(0, 64, 64, 64))
    renderer.fill_rect(pygame.Rect(0, 128, 64, 64))
    renderer.draw_color = backgrounds[bg_index]

    renderer.present()

    clock.tick(60)
    win.title = str('FPS: {}'.format(clock.get_fps()))