taichi.ui.window

Module Contents

Classes

Window

The window class.

class taichi.ui.window.Window(name, res, vsync=False, show_window=True)

Bases: taichi._lib.core.PyWindow

The window class.

Parameters
  • name (str) – name of the window.

  • res (Tuple[Int]) – resolution (width, height) of the window, in pixels.

  • layout (vsync) – whether or not vertical sync should be enabled.

property running(self)
get_events(self, tag=None)

Obtain a list of unprocessed events.

Parameters

tag (str) – A tag used for filtering events. If it is None, then all events are returned.

get_event(self, tag=None)

Returns whether or not a event that matches tag has occurred.

If tag is None, then no filters are applied. If this function returns True, the event property of the window will be set to the corresponding event.

is_pressed(self, *keys)
get_canvas(self)

Returns a canvas handle. See :class`~taichi.ui.canvas.Canvas`

property GUI(self)

Returns a IMGUI handle. See :class`~taichi.ui.ui.Gui`