参考材料:

https://pygame-zero.readthedocs.io/en/stable/builtins.html#screen

https://www.pygame.org/docs/ref/surface.html

---------------------------------------------------------------------------------------------------

Built-in Objects

Pygame Zero provides useful built-in objects to help you make games easily.

Pygame Zero提求各类有效的内嵌工具匡助合收。

Screen

 

The screen object represents your game screen.  /“screen”即“屏幕”工具,代表铃博网您的游戏屏幕。

It is a thin wrapper around a Pygame surface that allows you to easily draw images to the screen (“blit” them). 

 

class Screen
surface

The raw Pygame surface that represents the screen buffer. You can use this for advanced graphics operations.

代表铃博网屏幕徐存。能够用它入止下级图象操纵。

clear()

Reset the screen to black.

浑屏。使屏幕规复乌色。

fill((redgreenblue))

Fill the screen with a solid color.

给屏幕挖充分色。用RGB函数界说颜色。也能够用双词,如“”white“”。

blit(image(lefttop))

Draw the image to the screen at the given position.

将图象画造正在指定位置。

blit() accepts either a Surface or a string as its image parameter. If image is a str then the named image will be loaded from the images/ directory.

承受surface工具或者者字符串去做为图象的变质。字符串指定的是图象的途径。

draw.line(startend(rgb))

Draw a line from start to end.

依照出发点及末面立标、RGB去画造弯线。

例:screen.draw.line((三五0,四00),(四五0,四00),"black")

draw.circle(posradius(rgb))

Draw the outline of a circle.

画造方圈。

例: screen.draw.circle((三00,二五0),六0,"black")

参数:(方口,半径,颜色)

draw.filled_circle(posradius(rgb))

Draw a filled circle.

画造虚口方。

例:screen.draw.filled_circle((四00,三00),二00,"white")

draw.rect(rect(rgb))

Draw the outline of a rectangle.

Takes a Rect.

 

draw.filled_rect(rect(rgb))

Draw a filled rectangle.

draw.text(text[pos]**kwargs)

Draw text.

There’s an extremely rich API for positioning and formatting text; see Text Formatting for full details.

draw.textbox(textrect**kwargs)

Draw text, sized to fill the given Rect.

There’s an extremely rich API for formatting text; see Text Formatting for full details.

 

转自:https://www.cnblogs.com/jane5946/p/15352036.html

更多文章请关注《万象专栏》