``pooltool.interact`` ===================== .. py:module:: pooltool.interact An endpoint for classes that enable interaction. Classes ------- .. autoclass:: Game Bases: :py:obj:`Interface` .. rubric:: Methods: .. py:method:: attach_system(system: pooltool.system.datatypes.System) -> None .. py:method:: attach_ruleset(ruleset: pooltool.ruleset.datatypes.Ruleset) -> None .. py:method:: start() Functions --------- .. py:function:: show(*args, **kwargs) Opens the interactive interface for one or more shots. .. important:: For instructions on how to use the interactive interface, see :doc:`The Interface `. :param shot_or_shots: The shot or collection of shots to visualize. This can be a single :class:`pooltool.system.System` object or a :class:`pooltool.system.MultiSystem` object containing multiple systems. .. note:: If a multisystem is passed, the systems can be scrolled through by pressing *n* (next) and *p* (previous). When using :func:`show`, press *Enter* to toggle parallel visualization mode where all systems play simultaneously with reduced opacity except the active one. In parallel mode, use *n* and *p* to change which system has full opacity. Note that parallel visualization is only available in :func:`show` and not when playing the game through the CLI ``run-pooltool``. :param title: The title to display in the visualization. Defaults to an empty string. :param camera_state: The initial camera state that the visualization is rendered with. .. admonition:: 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)