介绍

头文件

import pygame

文档

>>> import pygame
>>> help(pygame.display)
Help on module pygame.display in pygame:

NAME
    pygame.display - pygame module to control the display window and screen

FUNCTIONS
    Info(...)
        Info() -> VideoInfo
        Create a video display information object

    __PYGAMEinit__(...)
        auto initialize function for display.

    flip(...)
        flip() -> None
        Update the full display Surface to the screen

    get_active(...)
        get_active() -> bool
        Returns True when the display is active on the display

    get_caption(...)
        get_caption() -> (title, icontitle)
        Get the current window caption

    get_driver(...)
        get_driver() -> name
        Get the name of the pygame display backend

    get_init(...)
        get_init() -> bool
        Returns True if the display module has been initialized

    get_surface(...)
        get_surface() -> Surface
        Get a reference to the currently set display surface

    get_wm_info(...)
        get_wm_info() -> dict
        Get information about the current windowing system

    gl_get_attribute(...)
        gl_get_attribute(flag) -> value
        Get the value for an OpenGL flag for the current display

    gl_set_attribute(...)
        gl_set_attribute(flag, value) -> None
        Request an OpenGL display attribute for the display mode

    iconify(...)
        iconify() -> bool
        Iconify the display surface

    init(...)
        init() -> None
        Initialize the display module

    list_modes(...)
        list_modes(depth=0, flags=pygame.FULLSCREEN) -> list
        Get list of available fullscreen modes

    mode_ok(...)
        mode_ok(size, flags=0, depth=0) -> depth
        Pick the best color depth for a display mode

    quit(...)
        quit() -> None
        Uninitialize the display module

    set_caption(...)
        set_caption(title, icontitle=None) -> None
        Set the current window caption

    set_gamma(...)
        set_gamma(red, green=None, blue=None) -> bool
        Change the hardware gamma ramps

    set_gamma_ramp(...)
        set_gamma_ramp(red, green, blue) -> bool
        Change the hardware gamma ramps with a custom lookup

    set_icon(...)
        set_icon(Surface) -> None
        Change the system image for the display window

    set_mode(...)
        set_mode(resolution=(0,0), flags=0, depth=0) -> Surface
        Initialize a window or screen for display

    set_palette(...)
        set_palette(palette=None) -> None
        Set the display color palette for indexed displays

    toggle_fullscreen(...)
        toggle_fullscreen() -> bool
        Switch between fullscreen and windowed displays

    update(...)
        update(rectangle=None) -> None
        update(rectangle_list) -> None
        Update portions of the screen for software displays

FILE
    e:\python36\lib\site-packages\pygame\display.cp36-win_amd64.pyd

接口

load()

save()

显示窗口

pygame.display.flip()

处理事件

while 1:
  # 使用event.wait来等待事件
  if pygame.event.wait().type in (QUIT, ):
    break

如果有任何问题请发邮件到 isteps@126.com


广告内容, 如果不忙, 跪求点击