tamcolors.tam package¶
Submodules¶
tamcolors.tam.tam_loop module¶
-
class
tamcolors.tam.tam_loop.
TAMFrame
(fps, char, foreground_color, background_color, min_width=0, max_width=1000, min_height=0, max_height=1000)¶ Bases:
object
-
done
(tam_loop, loop_data)¶ info: will clean up the frame and can only be called once :param tam_loop: TAMLoop :param loop_data: dict :return:
-
draw
(tam_buffer, loop_data)¶ info: will draw frame onto terminal :param tam_buffer: TAMBuffer :param loop_data: dict :return:
-
get_defaults
()¶ info: gets defaults :return: (str, int, int)
-
get_fps
()¶ info: returns the frame fps :return: int
-
get_height_min_and_max
()¶ info: returns min and max height :return: (int, int)
-
get_width_min_and_max
()¶ info: returns min and max width :return: (int, int)
-
make_buffer_ready
(tam_buffer, screen_width, screen_height)¶ info: will make buffer ready for frame :param tam_buffer: TAMBuffer :param screen_width: int: 0 - inf :param screen_height: int: 0 - inf :return:
-
update
(tam_loop, keys, loop_data)¶ info: will update terminal :param tam_loop: TAMLoop :param keys: list, tuple :param loop_data: dict :return:
-
-
class
tamcolors.tam.tam_loop.
TAMLoop
(tam_frame, io=None, only_any_os=False, color_change_key='ESCAPE', loop_data=None, stability_check=False, tam_color_defaults=True, highest_mode_lock=False, preferred_mode=None, test_mode=False)¶ Bases:
object
-
add_frame_stack
(frame)¶ info: will add a TAMFrame to stack :param frame: TAMFrame :return:
-
done
(reset_colors_to_console_defaults=True)¶ info: will stop tam loop :param: reset_colors_to_console_defaults: bool :return: None
-
get_color_16
(spot)¶ info: Will get color from color palette 16 :param spot: int :return: RGBA
-
get_color_16_pal_256
(spot)¶ info: Will get color from color palette 2 :param spot: int :return: RGBA
-
get_color_2
(spot)¶ info: Will get color from color palette 2 :param spot: int :return: RGBA
-
get_color_256
(spot)¶ info: Will get color from color palette 256 :param spot: int :return: RGBA
-
get_running
()¶ info: None has not ran, True is running, False has ran :return: bool or None
-
pop_frame_stack
()¶ info: will remove TAMFrame from stack :return: TAMFrame or None
-
reset_colors_to_console_defaults
()¶ info: will reset colors to console defaults :return: None
-
run
()¶ info: will call tam loop :return: None
-
static
run_application
(*args, **kwargs)¶ info: will run tam loop as an application note: when tam loop is done running the program will quit if tam loop has an error and the frame does not catch it the error will be printed onto the screen and the program will quit after user input :param args: :param kwargs: :return:
-
run_with_profiler
()¶ info: will run with a profiler and print out data when done :return: None
-
set_color_16
(spot, color)¶ info: sets a color value :param spot: int :param color: RGBA :return: None
-
set_color_16_pal_256
(spot, color)¶ info: sets a color value :param spot: int :param color: int :return: None
-
set_color_2
(spot, color)¶ info: sets a color value :param spot: int :param color: RGBA :return: None
-
set_color_256
(spot, color)¶ info: sets a color value :param spot: int :param color: RGBA :return: None
-
set_tam_color_defaults
()¶ info: will set console colors to tam defaults :return: None
-
step
(keys=())¶ info: only works in test mode but lets you update and draw in tests :param keys: tuple: ((str, str), …) :return: TAMBuffer or None
-
-
exception
tamcolors.tam.tam_loop.
TAMLoopError
¶ Bases:
Exception