Python Forum
How can I position a taichi GUI window on screen?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I position a taichi GUI window on screen?
#1
I have started to work with Taichi Lang package and I couldn't find how to position the GUI window.
A simple example:

import taichi as ti

gui = ti.GUI("Test", (640, 480))

while gui.running:
  if gui.get_event(ti.GUI.PRESS):
  gui.running = False
  # ... 
  gui.show()
Each time I run this, the window is placed at different locations. I would like to have a fixed location, mainly for automatic image screenshots and animation recordings in which the window needs to be grabbed.
Is there a way to fix the location of the window?

(I'm sorry for the "hard" indentation. The icon "Insert code snippet" doesn't work for me, in any way I tried. Neither does indentation, since any left margin (blank space) is just removed.)
buran write Oct-22-2024, 10:35 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Reply
#2
From the docs

import taichi as ti

gui = ti.ui.Window('Something', res=(800,600), pos=(300,300))

while gui.running:
    gui.show()
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
Download my project scripts


Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020