【整理】pygame学習ノート(5)--pygameライブラリの関数と方法整理
4894 ワード
PYGAMEの方法と公式文書の照会
公式文書
http://www.pygame.org/docs/
モジュール
概要
pygame.BufferProxy
An array protocol view of surface pixels
pygame.cdrom
How to access and control the CD audio devices.
pygame.co or
Color representation.
pygame.cursors
Loading and comppiling cursor imags.
pygame.display
Configre the display surface.
pygame.draw
Drawing simple shops like lines and ellipspes to surfaces.
pygame.イベント
Manage the incomping events from various input devices and the windowing plotform.
pygame.examples
Varous programs demostrating the use of individual pyame modules.
pygame.font
Loading and rendeng Truetype fonts.
pygame.freetype
Enhanced Pygame module for loading and rendeng font faces.
pygame.gfxdraw
Anti-aliasing draw functions.
pygame.image
Loading、saving、and transferring of surfaces.
pygame.joystick
Manage the joystick devices.
pygame.key
Manage the keyboard device.
pygame.local s
Pygame constants.
pygame.mixer
ロードアンドプレイsounds
pygame.mouse
Manage the mouse device and display.
pygame.movie
ビデオプレーヤーfrom MPEG movies.
pygame.mixer.music
Play streaming music trocs.
pygame.Overlay
Access advancend video overlays.
pygame
Top level functions to manage Pygame.
pygame.PixelAray
Manipullate image pixel data.
pygame.Rect
Flexible container for a rectangle.
pygame.scrap
Native clipboard access.
pygame.sdarray
Manipullate sound sample data.
pygame.sprite
Higher level object to represent game mages.
pygame.Surface
Object for imags and the screen.
pygame.surfarray
Manipullate image pixel data.
pygame.tests
Test Pygame.
pygame.time
Manage timing and frame erate.
pygame.transform
Resize and move mages.
Rect(left,top,width,height)->Rect
Rect((left,top),(width,height)->Rect
Rect->Rect
pygame.Rect.co py
—
copy the rectangle
pygame.Rect.move
—
moves the rectangle
pygame.Rect.move_ip
—
moves the rectangle,in place
pygame.Rect.inflate
—
grow or shrink the rectangle size
pygame.Rect.inflate_ip
—
grow or shrink the rectangle size,in place
pygame.Rect.clamp
—
moves the rectanle inside another
pygame.Rect.clamp_ip
—
moves the rectanle inside another,in place
pygame.Rect.clip
—
crops a rectangle inside another
pygame.Rect.union
—
ジョins two rectangles into one
pygame.Rect.union_ip
—
ジョins two rectangles into one,in place
pygame.Rect.unionall
—
the union of many rectangles
pygame.Rect.unionall_ip
—
the union of many rectangles,in place
pygame.Rect.fit
—
reize and move a rectanle with aspect ratio
pygame.Rect.normalize
—
corect negative sizes
pygame.Rect.co ntains
—
test if one rectanle is inside another
pygame.Rect.co.llidepoint
—
test if a point is inside a rectangle
pygame.Rect.co llidersect
—
test if two rectangles overlap
pygame.Rect.co.llidelist
—
test if one rectanglen a list intersects
pygame.Rect.co.llidelistall
—
test if all rectangles in a list intersect
pygame.Rect.co.llidedict
—
test if one rectanglen a dictionary intersects
pygame.Rect.co.llidedictall
—
test if all rectangles in a dictionary intersect
(転)RECT詳細画像説明
ソースの原文:https://blog.csdn.net/qq_39546430/articale/detail/80407817
Rectオブジェクトの属性:1.座標番号x,y top,left,bottom,right center x,センターrysize width,height w,hを返します.2.座標配列topleft(左上)bottomleft(左下)bottomright(右下)を返します.
midtop(中上)midleft(左中)midbottom(底中)midright(右中)
センター(中心点座標)に直接図を描き、灰色の長方形の大きさ(900、450)、中央の青い長方形(400、510)をご自分で体験ください.
これに基づいて、私の理解と、より詳細で分かりやすい図を描きました.
しかし、今は確定していません.x、y、sizeのいくつかは何ですか?
ある兄弟はx yを研究しました.つまり、left topはつまりtopleftです.
https://blog.csdn.net/weixin_39480632/articale/detail/81273020
sizeは(width height)だと思います.
また、スッポンにはもっと多くの方法があります.後で勉強します.
https://fishc.com.cn/thread-62186-1-1.html
公式文書
http://www.pygame.org/docs/
モジュール
概要
pygame.BufferProxy
An array protocol view of surface pixels
pygame.cdrom
How to access and control the CD audio devices.
pygame.co or
Color representation.
pygame.cursors
Loading and comppiling cursor imags.
pygame.display
Configre the display surface.
pygame.draw
Drawing simple shops like lines and ellipspes to surfaces.
pygame.イベント
Manage the incomping events from various input devices and the windowing plotform.
pygame.examples
Varous programs demostrating the use of individual pyame modules.
pygame.font
Loading and rendeng Truetype fonts.
pygame.freetype
Enhanced Pygame module for loading and rendeng font faces.
pygame.gfxdraw
Anti-aliasing draw functions.
pygame.image
Loading、saving、and transferring of surfaces.
pygame.joystick
Manage the joystick devices.
pygame.key
Manage the keyboard device.
pygame.local s
Pygame constants.
pygame.mixer
ロードアンドプレイsounds
pygame.mouse
Manage the mouse device and display.
pygame.movie
ビデオプレーヤーfrom MPEG movies.
pygame.mixer.music
Play streaming music trocs.
pygame.Overlay
Access advancend video overlays.
pygame
Top level functions to manage Pygame.
pygame.PixelAray
Manipullate image pixel data.
pygame.Rect
Flexible container for a rectangle.
pygame.scrap
Native clipboard access.
pygame.sdarray
Manipullate sound sample data.
pygame.sprite
Higher level object to represent game mages.
pygame.Surface
Object for imags and the screen.
pygame.surfarray
Manipullate image pixel data.
pygame.tests
Test Pygame.
pygame.time
Manage timing and frame erate.
pygame.transform
Resize and move mages.
pygame.
Rect
pygame object for storing rectanglar coordinationRect(left,top,width,height)->Rect
Rect((left,top),(width,height)->Rect
Rect->Rect
pygame.Rect.co py
—
copy the rectangle
pygame.Rect.move
—
moves the rectangle
pygame.Rect.move_ip
—
moves the rectangle,in place
pygame.Rect.inflate
—
grow or shrink the rectangle size
pygame.Rect.inflate_ip
—
grow or shrink the rectangle size,in place
pygame.Rect.clamp
—
moves the rectanle inside another
pygame.Rect.clamp_ip
—
moves the rectanle inside another,in place
pygame.Rect.clip
—
crops a rectangle inside another
pygame.Rect.union
—
ジョins two rectangles into one
pygame.Rect.union_ip
—
ジョins two rectangles into one,in place
pygame.Rect.unionall
—
the union of many rectangles
pygame.Rect.unionall_ip
—
the union of many rectangles,in place
pygame.Rect.fit
—
reize and move a rectanle with aspect ratio
pygame.Rect.normalize
—
corect negative sizes
pygame.Rect.co ntains
—
test if one rectanle is inside another
pygame.Rect.co.llidepoint
—
test if a point is inside a rectangle
pygame.Rect.co llidersect
—
test if two rectangles overlap
pygame.Rect.co.llidelist
—
test if one rectanglen a list intersects
pygame.Rect.co.llidelistall
—
test if all rectangles in a list intersect
pygame.Rect.co.llidedict
—
test if one rectanglen a dictionary intersects
pygame.Rect.co.llidedictall
—
test if all rectangles in a dictionary intersect
(転)RECT詳細画像説明
ソースの原文:https://blog.csdn.net/qq_39546430/articale/detail/80407817
Rectオブジェクトの属性:1.座標番号x,y top,left,bottom,right center x,センターrysize width,height w,hを返します.2.座標配列topleft(左上)bottomleft(左下)bottomright(右下)を返します.
midtop(中上)midleft(左中)midbottom(底中)midright(右中)
センター(中心点座標)に直接図を描き、灰色の長方形の大きさ(900、450)、中央の青い長方形(400、510)をご自分で体験ください.
これに基づいて、私の理解と、より詳細で分かりやすい図を描きました.
しかし、今は確定していません.x、y、sizeのいくつかは何ですか?
ある兄弟はx yを研究しました.つまり、left topはつまりtopleftです.
https://blog.csdn.net/weixin_39480632/articale/detail/81273020
sizeは(width height)だと思います.
また、スッポンにはもっと多くの方法があります.後で勉強します.
https://fishc.com.cn/thread-62186-1-1.html