From 74bdc0d9c75149ff2d1ca5bc443b597c56407142 Mon Sep 17 00:00:00 2001 From: omar Date: Sat, 12 Oct 2019 23:51:41 +0200 Subject: [PATCH] Updated Tips (markdown) --- Tips.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Tips.md b/Tips.md index 44b8478..44293a6 100644 --- a/Tips.md +++ b/Tips.md @@ -1,4 +1,8 @@ -**Use the Metrics window!** +This section is lacking... + +---- + +### Use the Metrics window! Many internal state and tools are exposed in the Metrics window. To access the Metrics window: - Call `ShowMetricsWindow()`. @@ -6,10 +10,12 @@ Many internal state and tools are exposed in the Metrics window. To access the M They will help you understand how Dear ImGui works, and can help you diagnose problems. ---- -**Use `Begin`/`BeginChild` to put yourself back into the context of another window** -https://github.com/ocornut/imgui/issues/270 +### Using Begin/BeginChild +- You can call `Begin()` multiple times to append to a same window from different place. + +- Use `Begin()`/`BeginChild()` to put yourself back into the context of another window (see [#270](https://github.com/ocornut/imgui/issues/270) An interesting trick that isn't obvious is that you can use Begin() just to put yourself into the context of that window. So here I want to react to the user inputting an address to scroll to, I use BeginChild() again on the child that I've already drawn so I can use SetScrollFromPosY() on it. ```cpp @@ -25,7 +31,7 @@ ImGui::End(); ---- -**Tip: use Stride for easily plotting a field in array of structures**
+### Plot: Use Stride for easily plotting a field in array of structures https://github.com/ocornut/imgui/issues/271 Here I've got some code sampling joints of an animation as e.g 60 hz. @@ -43,7 +49,7 @@ ImGui::PlotLines("LeftToeBase y", &all_sampled_joints[skel.getBoneIndex("LeftToe ---- -**Tip: use c++11 lambas with Combo/ListBox/Plot functions** +### Use C++11 lambas with Combo/ListBox/Plot functions ```cpp void SelectBoneByName(const char* label, int* bone_idx, const Skeleton* skeleton)