0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【2】【python/pygame】線や円を描写しよう

Posted at

下記のコード

import pygame as pg, sys
pg.init()
screen = pg.display.set_mode((800, 600))

while True:
    screen.fill(pg.Color("WHITE"))

    # 四角形/線/円を描写する
    pg.draw.rect(screen, pg.Color("RED"), (100, 100, 100, 150))
    pg.draw.line(screen, pg.Color("BLUE"), (250, 100), (350, 250), 5)
    pg.draw.ellipse(screen, pg.Color("GREEN"), (400, 100, 150, 150), 5)

    pg.display.update()
    for event in pg.event.get():
        if event.type == pg.QUIT:
            pg.quit()
            sys.exit()

結果は下記です。
test21_2.jpg

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?