Comments (10)
I'm not sure I understand your question. What exactly do you want to achieve? Could you elaborate or give a more specific example?
If you want to implement your own rendering then the ImDrawList
objects are available indirectly in render callbacks (via draw_data
argument).
from pyimgui.
Sorry I wasn't clear the first time. What I want is to create my own widget that will have some area that will be custom-drawn. I want to be able to draw my own charts, histograms, etc using 2D primitives like lines, curves, ellipses, rectangles -- this sort of stuff. Is that currently possible with pyimgui? It would be truly great if yes, but how?
I am a complete imgui beginner, but I remember seeing some custom-draw C++ code that was adding primitives to ImDrawList
. That's why I mentioned it. Please forgive my ignorance!
from pyimgui.
Just to be clear, my entire application is an imgui window - everything that I display on screen are imgui controls. This is slightly different to traditional use cases where imgui supplements the user's application. What I'm doing is essentially using imgui instead of Qt or wxWidgets for a UI application because I need better performance.
I want to have my own controls that draw themselves. For example, I want to have a scrollable list where each item is a widget that plots some data (a histogram, function plot, etc) thay is not supported by imgui out of the box.
from pyimgui.
Oh, now I understand. Thanks for clarification :)
Such thing is not possible right now but it is definitely doable. We will heave to expose some internal functions that return the current window object and also to create mapping for ImGuiWindow
and extend the existing mapping for ImDrawList that will allow to manually add new drawing primitives.
I will try to take a look into this in my free time soon to see how it could be done. I'm sure I won't have time to ensure 100% feature compatibility on my own but I will try to at least set some foundation for others so new functions could be easily contributed.
from pyimgui.
Thanks for the reply, I very much appreciate your time! The ability to take advantage of imgui's 2D drawing subsystem would be huge on its own!
In the mean time I hope option 1 from this post would be possible. That is, render my custom stuff to texture and then put this texture in a imgui widget. This is a bit less convenient as it has overhead (if I want to have many such widgets) and I'll have to use another drawing library. But I'd be fine with it if it's possible. Does pyimgui support placing images in widgets? Do I understand correctly that I can simply render to an OpenGL texture and then pass the ID (handle) of this texture to a call to imgui.core.image(texture_id, ...)
? If so, that would be great! These is also is this related discussion on the imgui issue tracker.
from pyimgui.
Yes, for now you can render directly to texture and display it as imgui.core.image()
widget.
from pyimgui.
Great, I will try and report, thanks!!
from pyimgui.
Note for anyone encountering this issue: The 1.0.0a2 pre-release has some ImDrawList
functionality exposed – we can draw lines and [filled] rectangles, and adding bindings for the rest should be easy.
from pyimgui.
Note for anyone encountering this issue: The 1.0.0a2 pre-release has some
ImDrawList
functionality exposed – we can draw lines and [filled] rectangles, and adding bindings for the rest should be easy.
Already found the ImDrawList exposed, however, I'm missing the ImDrawList::AddText
API. Are the missing parts to be added anytime soon?
from pyimgui.
Released as 1.0.0
from pyimgui.
Related Issues (20)
- Set unique/multiple imgui name, context
- -- deleted --
- Doesn't expose ImGuiStyle::ScaleAllSizes HOT 1
- Showing input text without a label HOT 1
- Documentation left side nav not scrollable
- Can't use it and i don't know why.
- "Game Insert"
- type stubs for pyimgui HOT 4
- None of the custom renderers change mouse cursor HOT 4
- default theme font HOT 4
- Loading SVGs as viewport/texture HOT 2
- [Bug}: When using pyimgui some users of my program have `GLError`s HOT 8
- Imgui port to pygame do not suport colaboration with programable opengl pipline
- Windows: Failed building wheel for imgui (from VsDevShell) HOT 5
- Example not working HOT 1
- pyimgui equivalent of ImGuiKey_NamedKey_END HOT 1
- Overflow error when using opengl, doublebuf and fullscreen HOT 1
- ImGui crashing when using OpenGL context 3.2+ even though GPU and driver support 4.6
- Upgrading dear imgui version beyond 1.82 HOT 6
- Anyone studied if F3D is able to render on pyimgui HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyimgui.