首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在python-turtle中设置水平和垂直边框

如何在python-turtle中设置水平和垂直边框
EN

Stack Overflow用户
提问于 2020-11-13 20:58:53
回答 1查看 35关注 0票数 0

边框应该是图片上的样子。我试着在它上面设置一个新的图片,但它不是这样的。

EN

回答 1

Stack Overflow用户

发布于 2020-11-13 21:28:47

你是在说这个吗?

代码语言:javascript
复制
import pygame

BLACK = (0,0,0)

pygame.init()

# Set up the drawing window
screen = pygame.display.set_mode([500, 500])
width,height = pygame.display.get_surface().get_size()

# Run until the user asks to quit
running = True
while running:
    pygame.draw
    # Did the user click the window close button?
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False

    # Fill the background with white
    screen.fill((255, 255, 255))
    pygame.draw.lines(screen, BLACK, False, [(0,0), (width-1,0), (width-1,height-1), (0, height-1), (0,0)], 3)
    # Flip the display
    pygame.display.flip()

pygame.quit()
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64821350

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档