http://eyehere.net/2011/python-pygame-novice-professional-3/

http://www.pygame.org/docs/ref/event.html#pygame.event.get_blocked

event

pygame.event.pump     —     internally process pygame event handlers
pygame.event.get — get events from the queue
pygame.event.poll — get a single event from the queue
pygame.event.wait — wait for a single event from the queue
pygame.event.peek — test if event types are waiting on the queue
pygame.event.clear — remove all events from the queue
pygame.event.event_name — get the string name from and event id
pygame.event.set_blocked — control which events are allowed on the queue
pygame.event.set_allowed — control which events are allowed on the queue
pygame.event.get_blocked — test if a type of event is blocked from the queue
pygame.event.set_grab — control the sharing of input devices with other applications
pygame.event.get_grab — test if the program is sharing input devices
pygame.event.post — place a new event on the queue
pygame.event.Event — create a new event object
pygame.event.EventType — pygame object for representing SDL events

event interface

QUIT             none
ACTIVEEVENT gain, state
KEYDOWN unicode, key, mod
KEYUP key, mod
MOUSEMOTION pos, rel, buttons
MOUSEBUTTONUP pos, button
MOUSEBUTTONDOWN pos, button
JOYAXISMOTION joy, axis, value
JOYBALLMOTION joy, ball, rel
JOYHATMOTION joy, hat, value
JOYBUTTONUP joy, button
JOYBUTTONDOWN joy, button
VIDEORESIZE size, w, h
VIDEOEXPOSE none
USEREVENT code

event_type

image :

pygame.image.load     —     load new image from a file
pygame.image.save — save an image to disk
pygame.image.get_extended — test if extended image formats can be loaded
pygame.image.tostring — transfer image to string buffer
pygame.image.fromstring — create new Surface from a string buffer
pygame.image.frombuffer — create a new Surface that shares data inside a string buffer

image interface

key:

pygame.key.get_focused     —     true if the display is receiving keyboard input from the system
pygame.key.get_pressed — get the state of all keyboard buttons
pygame.key.get_mods — determine which modifier keys are being held
pygame.key.set_mods — temporarily set which modifier keys are pressed
pygame.key.set_repeat — control how held keys are repeated
pygame.key.get_repeat — see how held keys are repeated
pygame.key.name — get the name of a key identifier

key interface

KeyASCII      ASCII   Common Name
K_BACKSPACE \b backspace
K_TAB \t tab
K_CLEAR clear
K_RETURN \r return
K_PAUSE pause
K_ESCAPE ^[ escape
K_SPACE space
K_EXCLAIM ! exclaim
K_QUOTEDBL " quotedbl
K_HASH # hash
K_DOLLAR $ dollar
K_AMPERSAND & ampersand
K_QUOTE quote
K_LEFTPAREN ( left parenthesis
K_RIGHTPAREN ) right parenthesis
K_ASTERISK * asterisk
K_PLUS + plus sign
K_COMMA , comma
K_MINUS - minus sign
K_PERIOD . period
K_SLASH / forward slash
K_0
K_1
K_2
K_3
K_4
K_5
K_6
K_7
K_8
K_9
K_COLON : colon
K_SEMICOLON ; semicolon
K_LESS < less-than sign
K_EQUALS = equals sign
K_GREATER > greater-than sign
K_QUESTION ? question mark
K_AT @ at
K_LEFTBRACKET [ left bracket
K_BACKSLASH \ backslash
K_RIGHTBRACKET ] right bracket
K_CARET ^ caret
K_UNDERSCORE _ underscore
K_BACKQUOTE ` grave
K_a a a
K_b b b
K_c c c
K_d d d
K_e e e
K_f f f
K_g g g
K_h h h
K_i i i
K_j j j
K_k k k
K_l l l
K_m m m
K_n n n
K_o o o
K_p p p
K_q q q
K_r r r
K_s s s
K_t t t
K_u u u
K_v v v
K_w w w
K_x x x
K_y y y
K_z z z
K_DELETE delete
K_KP0 keypad
K_KP1 keypad
K_KP2 keypad
K_KP3 keypad
K_KP4 keypad
K_KP5 keypad
K_KP6 keypad
K_KP7 keypad
K_KP8 keypad
K_KP9 keypad
K_KP_PERIOD . keypad period
K_KP_DIVIDE / keypad divide
K_KP_MULTIPLY * keypad multiply
K_KP_MINUS - keypad minus
K_KP_PLUS + keypad plus
K_KP_ENTER \r keypad enter
K_KP_EQUALS = keypad equals
K_UP up arrow
K_DOWN down arrow
K_RIGHT right arrow
K_LEFT left arrow
K_INSERT insert
K_HOME home
K_END end
K_PAGEUP page up
K_PAGEDOWN page down
K_F1 F1
K_F2 F2
K_F3 F3
K_F4 F4
K_F5 F5
K_F6 F6
K_F7 F7
K_F8 F8
K_F9 F9
K_F10 F10
K_F11 F11
K_F12 F12
K_F13 F13
K_F14 F14
K_F15 F15
K_NUMLOCK numlock
K_CAPSLOCK capslock
K_SCROLLOCK scrollock
K_RSHIFT right shift
K_LSHIFT left shift
K_RCTRL right control
K_LCTRL left control
K_RALT right alt
K_LALT left alt
K_RMETA right meta
K_LMETA left meta
K_LSUPER left Windows key
K_RSUPER right Windows key
K_MODE mode shift
K_HELP help
K_PRINT print screen
K_SYSREQ sysrq
K_BREAK break
K_MENU menu
K_POWER power
K_EURO Euro The keyboard also has a list of modifier states that can be assembled by bitwise-ORing them together. KMOD_NONE, KMOD_LSHIFT, KMOD_RSHIFT, KMOD_SHIFT, KMOD_CAPS,
KMOD_LCTRL, KMOD_RCTRL, KMOD_CTRL, KMOD_LALT, KMOD_RALT,
KMOD_ALT, KMOD_LMETA, KMOD_RMETA, KMOD_META, KMOD_NUM, KMOD_MODE

key type

mouse:

pygame.mouse.get_pressed     —     get the state of the mouse buttons
pygame.mouse.get_pos — get the mouse cursor position
pygame.mouse.get_rel — get the amount of mouse movement
pygame.mouse.set_pos — set the mouse cursor position
pygame.mouse.set_visible — hide or show the mouse cursor
pygame.mouse.get_focused — check if the display is receiving mouse input
pygame.mouse.set_cursor — set the image for the system mouse cursor
pygame.mouse.get_cursor — get the image for the system mouse cursor

mouse interface

cusor:

pygame.cursors.compile     —     create binary cursor data from simple strings
pygame.cursors.load_xbm — load cursor data from an XBM file

cursor interface

display

pygame.display.init     —     Initialize the display module
pygame.display.quit — Uninitialize the display module
pygame.display.get_init — Returns True if the display module has been initialized
pygame.display.set_mode — Initialize a window or screen for display
pygame.display.get_surface — Get a reference to the currently set display surface
pygame.display.flip — Update the full display Surface to the screen
pygame.display.update — Update portions of the screen for software displays
pygame.display.get_driver — Get the name of the pygame display backend
pygame.display.Info — Create a video display information object
pygame.display.get_wm_info — Get information about the current windowing system
pygame.display.list_modes — Get list of available fullscreen modes
pygame.display.mode_ok — Pick the best color depth for a display mode
pygame.display.gl_get_attribute — Get the value for an OpenGL flag for the current display
pygame.display.gl_set_attribute — Request an OpenGL display attribute for the display mode
pygame.display.get_active — Returns True when the display is active on the display
pygame.display.iconify — Iconify the display surface
pygame.display.toggle_fullscreen — Switch between fullscreen and windowed displays
pygame.display.set_gamma — Change the hardware gamma ramps
pygame.display.set_gamma_ramp — Change the hardware gamma ramps with a custom lookup
pygame.display.set_icon — Change the system image for the display window
pygame.display.set_caption — Set the current window caption
pygame.display.get_caption — Get the current window caption
pygame.display.set_palette — Set the display color palette for indexed displays

display interface

surface:

pygame.Surface.blit     —     draw one image onto another
pygame.Surface.convert — change the pixel format of an image
pygame.Surface.convert_alpha — change the pixel format of an image including per pixel alphas
pygame.Surface.copy — create a new copy of a Surface
pygame.Surface.fill — fill Surface with a solid color
pygame.Surface.scroll — Shift the surface image in place
pygame.Surface.set_colorkey — Set the transparent colorkey
pygame.Surface.get_colorkey — Get the current transparent colorkey
pygame.Surface.set_alpha — set the alpha value for the full Surface image
pygame.Surface.get_alpha — get the current Surface transparency value
pygame.Surface.lock — lock the Surface memory for pixel access
pygame.Surface.unlock — unlock the Surface memory from pixel access
pygame.Surface.mustlock — test if the Surface requires locking
pygame.Surface.get_locked — test if the Surface is current locked
pygame.Surface.get_locks — Gets the locks for the Surface
pygame.Surface.get_at — get the color value at a single pixel
pygame.Surface.set_at — set the color value for a single pixel
pygame.Surface.get_at_mapped — get the mapped color value at a single pixel
pygame.Surface.get_palette — get the color index palette for an -bit Surface
pygame.Surface.get_palette_at — get the color for a single entry in a palette
pygame.Surface.set_palette — set the color palette for an -bit Surface
pygame.Surface.set_palette_at — set the color for a single index in an -bit Surface palette
pygame.Surface.map_rgb — convert a color into a mapped color value
pygame.Surface.unmap_rgb — convert a mapped integer color value into a Color
pygame.Surface.set_clip — set the current clipping area of the Surface
pygame.Surface.get_clip — get the current clipping area of the Surface
pygame.Surface.subsurface — create a new surface that references its parent
pygame.Surface.get_parent — find the parent of a subsurface
pygame.Surface.get_abs_parent — find the top level parent of a subsurface
pygame.Surface.get_offset — find the position of a child subsurface inside a parent
pygame.Surface.get_abs_offset — find the absolute position of a child subsurface inside its top level parent
pygame.Surface.get_size — get the dimensions of the Surface
pygame.Surface.get_width — get the width of the Surface
pygame.Surface.get_height — get the height of the Surface
pygame.Surface.get_rect — get the rectangular area of the Surface
pygame.Surface.get_bitsize — get the bit depth of the Surface pixel format
pygame.Surface.get_bytesize — get the bytes used per Surface pixel
pygame.Surface.get_flags — get the additional flags used for the Surface
pygame.Surface.get_pitch — get the number of bytes used per Surface row
pygame.Surface.get_masks — the bitmasks needed to convert between a color and a mapped integer
pygame.Surface.set_masks — set the bitmasks needed to convert between a color and a mapped integer
pygame.Surface.get_shifts — the bit shifts needed to convert between a color and a mapped integer
pygame.Surface.set_shifts — sets the bit shifts needed to convert between a color and a mapped integer
pygame.Surface.get_losses — the significant bits used to convert between a color and a mapped integer
pygame.Surface.get_bounding_rect — find the smallest rect containing data
pygame.Surface.get_view — return a buffer view of the Surface’s pixels.
pygame.Surface.get_buffer — acquires a buffer object for the pixels of the Surface.
pygame.Surface._pixels_address — pixel buffer address

surface interface

pygame学习的更多相关文章

  1. pygame学习笔记(3)——时间、事件、文字

    转载请注明:@小五义 http://www.cnblogs.com/xiaowuyi 1.运动速率    上节中,实现了一辆汽车在马路上由下到上行驶,并使用了pygame.time.delay(200 ...

  2. PyGame学习笔记之壹

    新建窗口 代码 '''PyGame学习笔记之壹''' import pygame # 引入 PyGame 库 pygame.init() # PyGame 库初始化 screen = pygame.d ...

  3. 用pygame学习初级python(一) 15.4.19

    最近有计划要学一下python,主要是要用flask.django一些框架进行后端的学习工作,但是在web应用之前希望进行一些基础的项目进行一些语法的练习,熟悉一下写法, 这个时候我就想先做几个小游戏 ...

  4. pygame学习笔记(4)——声音

    转载请注明:@小五义 http://www.cnblogs.com/xiaowuyi pygame.mixer是一个用来处理声音的模块,其含义为“混音器”.游戏中对声音的处理一般包括制造声音和播放声音 ...

  5. pygame学习笔记(5)——精灵

    转载请注明:@小五义 http://www.cnblogs.com/xiaowuyi 据说在任天堂FC时代,精灵的作用相当巨大,可是那时候只知道怎么玩超级玛丽.魂斗罗,却对精灵一点也不知.pygame ...

  6. pygame学习笔记(1)——安装及矩形、圆型画图

    pygame是一个设计用来开发游戏的python模块,其实说白了和time.os.sys都是一样的东东.今天开始正式学习pygame,下载地址:www.pygame.org.下载后安装完成即可,在py ...

  7. Python之pygame学习绘制文字制作滚动文字

    pygame绘制文字 ✕ 今天来学习绘制文本内容,毕竟游戏中还是需要文字对玩家提示一些有用的信息. 字体常用的不是很多,在pygame中大多用于提示文字,或者记录分数等事件. 字体绘制基本分为以下几个 ...

  8. pygame学习笔记

    pygame参考文档pdf版:pygame API html版 pygame API 石头剪子布的简单小游戏,待改进的地方,自适应大小.感兴趣的小伙伴可以依据get_surface()返回值(即当前窗 ...

  9. 用pygame学习初级python(二) 15.5.11

    闲得无聊,对第一版的东西做了一些修改,让它更像一个游戏,也具有一些可玩性. 项目的github地址:https://github.com/lfkdsk/BrainHole_pygame 1.人物类进行 ...

  10. pygame学习资料

    pygame下载地址: https://bitbucket.org/pygame/pygame/downloads 12岁的少年教你用Python做小游戏 Beginning Game Program ...

随机推荐

  1. 机器学习用Pandas实现数据库的读取

    #读取数据库数据#import pandas as pd  导入模块#import pymysql  导入数据库模块#con = pymysql.connect(host='localhost',po ...

  2. java界面--WePush-master 项目跑起来 -碰到的问题

    仅能在IntelliJ里面打开GUI Form文件来进行界面的拖拽设计--eclipse中也可以了 当eclipse 打开.form文件时,提示有.对应的编辑工具可以打开它,请到市场去安装 但是:本人 ...

  3. 堆,set,优先队列

    当我们需要高效的完成以下操作时: 1.插入一个元素 2.取得最小(最大)的数值,并且删除 能够完成这种操作的数据结构叫做优先队列 而能够使用二叉树,完成这种操作的数据结构叫做堆(二叉堆) 堆与优先队列 ...

  4. Spring框架-IOC/DI详细学习

    一.IOC/DI概念 参考博客:https://www.cnblogs.com/xdp-gacl/p/4249939.html IOC(inversion of control, 控制反转)是一种设计 ...

  5. Oracle GoldenGate微服务架构的服务Shell脚本

    Oracle GoldenGate微服务架构的/etc/init.d下的OracleGoldenGate服务Shell脚本: #!/bin/sh # # Oracle GoldenGate Servi ...

  6. [Kubernetes]说说 Service 与 Ingress

    在 Kubernetes 中, Service 有三种对外暴露的方法,但是由于每个 Service 都要有一个负载均衡的服务,所以采用 Service 的话,会造成既浪费成本又高的现象.对于用户来说, ...

  7. Centos系统FastDFS搭建与排错

    FastDFS中Tracker server主要是负载均衡和调度,Storage server主要是文件存储. 1.1 系统环境 [root@ centos fastdfs]# cat /etc/re ...

  8. Java小程序练习

    1.选择排序法所谓的选择排序,就是把当前数据与它后面所有的数据做个比较,假如满足比较条件,则进行交换操作,直到最后二个数比较完毕,这样重新输出的数据就已经由大到小或者由小到大排好序了.for(int ...

  9. Android 使用gradle版本冲突

    gradle默认版本冲突解决策略:自动依赖最高版本jar包 修改默认解决策略,使之出现版本错误时报错 configurations.all{ resolutionStrategy{ failOnVer ...

  10. Maven项目引入log4j的详细配置

    注:本文来源于 _xiaoxiong  <Maven项目引入log4j的详细配置> 引入log4j pom.xml <dependency> <groupId>lo ...