HelpMarker("This is testing the vertical alignment that gets applied on text to keep it aligned with widgets. Lines only composed of text or \"small\" widgets fit in less vertical spaces than lines with normal widgets.");
{
ImGui::BulletText("Text baseline:");
ImGui::Text("One\nTwo\nThree");ImGui::SameLine();
ImGui::SameLine();
ImGui::Text("Hello\nWorld");ImGui::SameLine();
HelpMarker("This is testing the vertical alignment that gets applied on text to keep it aligned with widgets. Lines only composed of text or \"small\" widgets fit in less vertical spaces than lines with normal widgets.");
ImGui::Text("Banana");
ImGui::Indent();
ImGui::Text("Banana");ImGui::SameLine();
ImGui::Text("Hello\nWorld");ImGui::SameLine();
ImGui::Text("One\nTwo\nThree");
ImGui::Button("HOP##1");ImGui::SameLine();
ImGui::Text("Banana");ImGui::SameLine();
ImGui::Text("Hello\nWorld");ImGui::SameLine();
ImGui::Text("Banana");
ImGui::Button("HOP##2");ImGui::SameLine();
ImGui::Text("Hello\nWorld");ImGui::SameLine();
ImGui::Text("Banana");
ImGui::Button("TEST##1");ImGui::SameLine();
ImGui::Text("TEST");ImGui::SameLine();
ImGui::SmallButton("TEST##2");
ImGui::AlignTextToFramePadding();// If your line starts with text, call this to align it to upcoming widgets.
ImGui::Text("Text aligned to Widget");ImGui::SameLine();
if(ImGui::TreeNode("Node##1")){for(inti=0;i<6;i++)ImGui::BulletText("Item %d..",i);ImGui::TreePop();}// Dummy tree data
ImGui::AlignTextToFramePadding();// Vertically align text node a bit lower so it'll be vertically centered with upcoming widget. Otherwise you can use SmallButton (smaller fit).
ImGui::Text("KO Blahblah");ImGui::SameLine();
boolnode_open=ImGui::TreeNode("Node##2");// Common mistake to avoid: if we want to SameLine after TreeNode we need to do it before we add child content.
if(ImGui::TreeNode("Node##1")){for(inti=0;i<6;i++)ImGui::BulletText("Item %d..",i);ImGui::TreePop();}// Dummy tree data
ImGui::AlignTextToFramePadding();// Vertically align text node a bit lower so it'll be vertically centered with upcoming widget. Otherwise you can use SmallButton (smaller fit).
boolnode_open=ImGui::TreeNode("Node##2");// Common mistake to avoid: if we want to SameLine after TreeNode we need to do it before we add child content.