Skip to content

Imgui::DragFloat and ImGui::DragInt with customizable speed with the middle mouse button. Totally inspired in Houdini.

License

Notifications You must be signed in to change notification settings

yabadabu/imgui_dragex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imgui_dragex

Imgui::DragFloat and ImGui::DragInt with runtime customizable speed with the middle mouse button. Totally inspired in Houdini UI.

#include "imgui/imgui_dragex.h"
static int ival = 100;
ImGui::DragIntEx("Int value", &ival, 1, 0, INT_MAX );

SampleIntegers

static float fval = 100;
float initial_speed = 0.1f;
ImGui::DragFloatEx("float value", &fval, initial_speed, -FLT_MAX, FLT_MAX);

SampleFloats

Same for ImGui::DragFloat2Ex, ImGui::DragFloat3Ex & ImGui::DragFloat4Ex

Integration

Drop the two files inside the imgui folder in your imgui installation
Add #include "imgui/imgui_dragex.h" in your source
Change ImGui::DragInt to ImGui::DragIntEx (same for DragFloat)
The 3rd argument speed becomes the initial speed. (I suggest 1 for integers)

About

Imgui::DragFloat and ImGui::DragInt with customizable speed with the middle mouse button. Totally inspired in Houdini.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published