Skip to content
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

Is there an easy way to get vertex data for rendering a text out of ImGui? #628

Closed
darthdeus opened this issue May 4, 2016 · 4 comments
Closed

Comments

@darthdeus
Copy link

Originally I asked here, but then realized this is probably a better place.

ImGui already can load/process truetype fonts and render them, so I thought it would make sense to use this for my own font rendering purposes, instead of using stb_truetype directly.

To put it simply, I'm either looking to render text outside of ImGui windows, or just use ImGui to generate vertex data to use in conjuction with its font textures to render the text myself.

@ocornut
Copy link
Owner

ocornut commented May 4, 2016

#530
#545

Will add something about this in the FAQ.

ocornut added a commit that referenced this issue May 4, 2016
@ocornut
Copy link
Owner

ocornut commented May 4, 2016

I added this in the FAQ and it is really the simplest way:

 Q: How can I use the drawing facilities without an ImGui window? (using ImDrawList API)
 A: The easiest way is to create a dummy window. Call Begin() with NoTitleBar|NoResize|NoMove|NoScrollbar|NoSavedSettings|NoInputs flag, zero background alpha, 
    then retrieve the ImDrawList* via GetWindowDrawList() and draw to it in any way you like.

Let me know if that works for you.

@ocornut ocornut closed this as completed May 22, 2016
biojppm added a commit to biojppm/imgui that referenced this issue Mar 4, 2018
The flags are ImGuiWindowFlags_NoBackground/NoWindow. They make it easier to create an invisible window for drawing texts outside of imgui via raw access to the draw lists as suggested in ocornut#628.
@anentropic
Copy link

The info no longer appears on the FAQ page, as far as I can tell...

Is this still a valid way to achieve this?

@ocornut
Copy link
Owner

ocornut commented Apr 2, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants