-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more IMGUI widgets for GGUI #3013
Comments
Hi, I am new to Taichi and glad to help improve it. I will start from an easy widget, maybe colored text. But I do not want to dibs the whole issue. Other people can also work on it since there are so many widgets in dear imgui, if I have understood well. |
Additional info for the issue:
|
@AmesingFlank Hi, it seems that there is only the Vulkan backend for GGUI, then why do we need to enable CUDA to compile GGUI here? https://github.com/taichi-dev/taichi/blob/master/cmake/TaichiCore.cmake#L36
|
Currently, the Vulkan backend for GGUI is only works with the CUDA/x64 compute backend of taichi. That is, you need |
OK, get it. Thanks for your reply. |
Do we have tests for GGUI? I am trying to add some new test cases for the widget, but I did not find any. |
We don't, adding tests for GGUI is on the top of my to-do list right now, but I just haven't found the time to do it :(( |
I am trying to add a colored text widget. You can take it as an example https://github.com/taichi-dev/taichi/pull/3078/files about how to add a new GGUI widget in Taichi. There are so many widgets not supported now. Welcome contributions! I am unassigning myself since it is an umbrella issue. |
Issue: #3013 ### Brief Summary Implementing colored texts: ```py window = ti.ui.Window('Window', (768, 768), vsync=True) canvas = window.get_canvas() gui = window.get_gui() while window.running: with gui.sub_window("Yo", 0.05, 0.05, 0.9, 0.2) as w: w.text("haha", (1.0,0.2,0.3)) window.show() ``` <img width="767" alt="Screenshot 2023-01-03 at 20 07 11" src="https://user-images.githubusercontent.com/16066115/210433302-e58fbc41-5331-4904-ae10-65f60e0b3446.png"> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Issue: taichi-dev#3013 ### Brief Summary Implementing colored texts: ```py window = ti.ui.Window('Window', (768, 768), vsync=True) canvas = window.get_canvas() gui = window.get_gui() while window.running: with gui.sub_window("Yo", 0.05, 0.05, 0.9, 0.2) as w: w.text("haha", (1.0,0.2,0.3)) window.show() ``` <img width="767" alt="Screenshot 2023-01-03 at 20 07 11" src="https://user-images.githubusercontent.com/16066115/210433302-e58fbc41-5331-4904-ae10-65f60e0b3446.png"> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Issue: taichi-dev#3013 ### Brief Summary Implementing colored texts: ```py window = ti.ui.Window('Window', (768, 768), vsync=True) canvas = window.get_canvas() gui = window.get_gui() while window.running: with gui.sub_window("Yo", 0.05, 0.05, 0.9, 0.2) as w: w.text("haha", (1.0,0.2,0.3)) window.show() ``` <img width="767" alt="Screenshot 2023-01-03 at 20 07 11" src="https://user-images.githubusercontent.com/16066115/210433302-e58fbc41-5331-4904-ae10-65f60e0b3446.png"> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Concisely describe the proposed feature
Currently, GGUI only supports 5 basic widgets (
text
,button
,check_box
,slider_float
,color_edit_3
). It would be nice to have support for more complicated widgets such as drop-down menus, menu bars, etc.Describe the solution you'd like (if any)
GGUI uses dear imgui internally. It's quite simple to write a wrapper for a widget. Take
button
for example, here are all the relevant code:taichi/taichi/ui/common/gui_base.h
Line 22 in 2f5c9df
taichi/taichi/ui/backends/vulkan/gui.h
Line 43 in 2f5c9df
taichi/taichi/ui/backends/vulkan/gui.cpp
Lines 159 to 164 in 2f5c9df
taichi/taichi/python/export_ggui.cpp
Lines 60 to 62 in 2f5c9df
taichi/python/taichi/ui/gui.py
Lines 68 to 74 in 2f5c9df
The text was updated successfully, but these errors were encountered: