mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-23 21:09:01 +08:00
FAQ update
This commit is contained in:
parent
0c88fad6c2
commit
7adac4ab3e
@ -238,6 +238,7 @@ The library started its life and is best known as "ImGui" only due to the fact t
|
||||
<b>How can I tell whether to dispatch mouse/keyboard to imgui or to my application?</b>
|
||||
<br><b>How can I display an image? What is ImTextureID, how does it works?</b>
|
||||
<br><b>How can I have multiple widgets with the same label or without a label? A primer on labels and the ID Stack.</b>
|
||||
<br><b>How can I use my own math types instead of ImVec2/ImVec4?</b>
|
||||
<br><b>How can I load a different font than the default?</b>
|
||||
<br><b>How can I easily use icons in my application?</b>
|
||||
<br><b>How can I load multiple fonts?</b>
|
||||
|
@ -48,7 +48,7 @@
|
||||
//#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
|
||||
//#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
|
||||
|
||||
//---- Define constructor and implicit cast operators to convert back<>forth from your math types and ImVec2/ImVec4.
|
||||
//---- Define constructor and implicit cast operators to convert back<>forth between your math types and ImVec2/ImVec4.
|
||||
// This will be inlined as part of ImVec2 and ImVec4 class declarations.
|
||||
/*
|
||||
#define IM_VEC2_CLASS_EXTRA \
|
||||
|
@ -32,6 +32,7 @@
|
||||
- How can I tell whether to dispatch mouse/keyboard to imgui or to my application?
|
||||
- How can I display an image? What is ImTextureID, how does it works?
|
||||
- How can I have multiple widgets with the same label or without a label? A primer on labels and the ID Stack.
|
||||
- How can I use my own math types instead of ImVec2/ImVec4?
|
||||
- How can I load a different font than the default?
|
||||
- How can I easily use icons in my application?
|
||||
- How can I load multiple fonts?
|
||||
@ -685,6 +686,10 @@
|
||||
e.g. when displaying a list of objects, using indices or pointers as ID will preserve the
|
||||
node open/closed state differently. See what makes more sense in your situation!
|
||||
|
||||
Q: How can I use my own math types instead of ImVec2/ImVec4?
|
||||
A: You can edit imconfig.h and setup the IM_VEC2_CLASS_EXTRA/IM_VEC4_CLASS_EXTRA macros to add implicit type conversions.
|
||||
This way you'll be able to use your own types everywhere, e.g. passsing glm::vec2 to ImGui functions instead of ImVec2.
|
||||
|
||||
Q: How can I load a different font than the default?
|
||||
A: Use the font atlas to load the TTF/OTF file you want:
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
|
Loading…
Reference in New Issue
Block a user