parameters:
- fps -- number of frames per second
returns:
type: float -- number of frames per second
BLACK
RED
GREEN
BRAUN
BLUE
PURPLE
CYAN
LIGHT_GREY
DARK_GREY
LIGHT_RED
LIGHT_GREEN
YELLOW
LIGHT_BLUE
LIGHT_PURPLE
LIGHT_CYAN
WHITE
BLACK_BG
RED_BG
GREEN_BG
BRAUN_BG
BLUE_BG
PURPLE_BG
CYAN_BG
LIGHT_GREY_BG
RESET_COLOR
-
symbol: str,
arg1: str,
arg2=''
parameters:
- symbol, arg1, arg2 -- strings
returns:
type: str -- arg1 + arg2 + symbol
- x: int, y: int, screen, letter='▇'
description:
Draws a letter in coordinates (x, y).
parameters:
x, y -- coordinates of symbol
screen -- exemplar of class termgame.Screen
letter -- symbol that draws on screen
-
x1: int, y1: int, x2: int, y2: int,
screen, letter='▇'
description:
Draws a line from (x1, y1) to (x2, y2) with symbol letter
parameters:
x1, y1 -- coordinates from which draws line
x2, y2 -- coordinates to which draws line
screen -- exemplar of class termgame.Screen
letter -- symbol that draws on screen
- rectangle ( x, y, width, height, screen, outline_letter='▇', fill_letter=' ' )
description:
Draws a rectangle in coordinates (x, y) with width, height and outline_letter and fill it with fill_letter.
parameters:
x, y -- coordinates from which draws rectangle
width, height -- width and height of rectangle
screen -- exemplar of class termgame.Screen
outline_letter, fill_letter -- outline_letter and
fill_letter of rectangle
- drawing_matrix, start_x, start_y, x1, y1, x2, y2, screen, board
description:
Draws drawing_matrix in (start_x, start_y) from (x1, y1) to (x2, y2) and replace elements with board.
parameters:
drawing_matrix -- matrix, which one draws
start_x, start_y -- coordinates from which draws matrix
x1, y1 -- coordinates in matrix from which it draws
x2, y2 -- coordinates in matrix to which it draws
screen -- exemplar of class termgame.Screen
board -- dictionary with which replace elements of matrix
- drawing_text, x, y, screen
description:
Draws drawing_text in screen, when '\n' it's real line break.
parameters:
drawing_text -- text, which one draws
x, y -- coordinates from which draws text
screen -- exemplar of class termgame.Screen\
Warning! In start of programme must use:
termgame.events.init()
description:
Return an iterable object of events.
returns:
type: iter -- an iterable object of events
K_a
K_b
K_c
K_d
K_e
K_f
K_g
K_h
K_i
K_j
K_k
K_l
K_m
K_n
K_o
K_p
K_q
K_r
K_s
K_t
K_u
K_v
K_w
K_x
K_y
K_z
K_0
K_1
K_2
K_3
K_4
K_5
K_6
K_7
K_8
K_9
K_TAB
K_ENTER
K_ESC
SPACE
K_UP
K_DOWN
K_RIGHT
K_LEFT
description:
Return arg1 + symbol
returns:
type: str -- arg1 + symbol
BOLD
HALF_BOLD
ITALICS
UNDERLINED
FLASHING
DEDICATED
INVISIBLE
CROSSED_OUT
RESET_FONT\
- x, y, text, screen
parameters:
x, y -- coordinates from which draws image
text -- string, which provides an image
screen -- exemplar of class termgame.Screen
parameters:
x, y -- coordinates, that function checks.
description:
Return True if point (x, y) collide with image, else False.
parameters:
image -- exemplar of class image.Image.
description:
Return True if image collide with an image, to that this function, else False.
description:
Draws attribute text in (self.x, self.y) in screen and fill spaces with screen's symbol.
description:
Create and return exemplar of class termgame.image.Image with attribute text from file with name file_name.
returns:
type: Image -- exemplar of class termgame.image.Image with attribute text from file with name file_name.
This module has some useful pictures:
- rocket1, rocket2 -- pictures of rockets
- alien1 -- picture of alien
- ball -- picture of ball
- tetraminos -- list of pictures for Tetris game
- size=None, symbol=' ', color='', bg=''
parameters:
size -- size of screen, default = os.get_terminal_size()
symbol -- symbol, which fill a screen, default -- space
color -- color of screen, default -- empty
bg -- background of screen, default -- empty
description:
Empty attribute board.
description:
Draws attribute board in screen.