본문 바로가기

pygame display3

파이썬 - [pygame, 도형그리기, draw] ▣ 먼저 도형을 그리기 위해 pygame.draw. 을 접근하여 내가 그리고 싶은 도형을 접근합니다. . 접근연산자를 누르면 이렇게 어떤걸 그리고 그 매개변수 값이무엇인지 나오게 됩니다. https://www.pygame.org/docs/ref/draw.html pygame.draw — pygame v2.0.1.dev1 documentation a rect bounding the changed pixels, if nothing is drawn the bounding rect's position will be the position of the first point in the points parameter (float values will be truncated) and its width and heig.. 2021. 5. 14.
파이썬 - [pygame, 화면출력, 프레임조정, 화면 색 채우기] ▣ 먼저 pygame import 를 지정합니다. 그리고 size를 튜플형식으로 화면에 해상도를 지정해줍니다. screen 이름으로 pygame.display.set_mode() 를 지정해주는데 mode() 매개변수 안에 화면에 사이즈 크기를 튜플 형식으로 지정해줍니다. ▣ set_caption() 함수는 창 타이틀에 이름을 설정해주는 겁니다. ▣ pygame.time.Clock() 함수는 1초에 몇 프레임으로 제한할지에 대한 시간 함수입니다. clock.tick(30) 으로 넣게 되면 1초에 30프레임으로 제한을 한 것 입니다. 다른 방법들도 많으니 밑에 pygame메뉴얼을 참고해주세요. while True: 기본적으로 계속 프로그램을 진행해야하기 때문에 무한반복으로 진행했고, screen.fill().. 2021. 5. 7.
파이썬 26장(pygame_01, import, display, set_caption, time, update) ▣ 안녕하세요 ^^ 저번장에 이어서 이번에도 파이썬으로 게임을 만들어보도록 하겠습니다. 아무래도 좀 더 심화적으로 게임을 만들려면 pygame을 사용하는 게 좋을 거 같아 tkinter이 아닌 pygame으로 만들어보도록 하겠습니다. www.pygame.org/docs/ref/display.html pygame.display — pygame v2.0.1.dev1 documentation Change whether screensavers should be allowed whilst the app is running. The default is False. By default pygame does not allow the screensaver during game play. It is possible to .. 2021. 3. 25.