pooltool.interact

An endpoint for classes that enable interaction

Overview

Classes

Game

This class runs the pooltool application

Function

show(*args, **kwargs)

Opens the interactive interface for one or more shots.

Classes

class pooltool.interact.Game(config=ShowBaseConfig.default())[source]

This class runs the pooltool application

Bases: Interface

Methods:

enter_game()[source]

Close the menu, setup the visualization, and start the game

create_system()[source]

Create the multisystem and game objects

FIXME This is where menu options for game type and further specifications should plug into.

Functions

pooltool.interact.show(*args, **kwargs)[source]

Opens the interactive interface for one or more shots.

Important

For instructions on how to use the interactive interface, see The Interface.

Parameters:
  • shot_or_shots --

    The shot or collection of shots to visualize. This can be a single pooltool.system.datatypes.System object or a pooltool.system.datatypes.MultiSystem object containing multiple systems.

    Note

    If a multisystem is passed, the systems can be scrolled through by pressing n (next) and p (previous).

  • title -- The title to display in the visualization. Defaults to an empty string.

  • camera_state -- The initial camera state that the visualization is rendered with.

Example

This example visualizes a single shot.

>>> import pooltool as pt
>>> system = pt.System.example()

Make sure the shot is simulated, otherwise it will make for a boring visualization:

>>> pt.simulate(system, inplace=True)

Now visualize the shot:

>>> pt.show(system)

(Press escape to exit the interface and continue script execution)