Standard Button
Button()
Create a clickable button that returnstrue when pressed:
const char*
required
The text displayed on the button
ImVec2
default:"ImVec2(0, 0)"
Button size in pixels. Use (0,0) for auto-sizing to fit the label.
Button Variants
SmallButton()
A button with reduced padding, useful for embedding in text:InvisibleButton()
A button without visual decoration, useful for custom rendering:const char*
required
String identifier (not displayed)
ImVec2
required
Button size in pixels
ImGuiButtonFlags
Optional button flags:
ImGuiButtonFlags_MouseButtonLeft(default)ImGuiButtonFlags_MouseButtonRightImGuiButtonFlags_MouseButtonMiddle
ArrowButton()
A button displaying a directional arrow:ImGuiDir
required
Arrow direction:
ImGuiDir_LeftImGuiDir_RightImGuiDir_UpImGuiDir_Down
Button Modifiers
Repeating Buttons
Make buttons fire continuously while held down:With
ImGuiItemFlags_ButtonRepeat enabled, the button returns true multiple times while held, not just on initial press.Colored Buttons
Customize button colors using style modifiers:Checkbox and Radio Buttons
Checkbox()
Toggle boolean values:RadioButton()
Select one option from a group:- Manual Mode
- Automatic Mode
Image Buttons
ImageButton()
Create a button with an image:const char*
required
String identifier for the button
ImTextureRef
required
Texture reference (your texture ID cast to ImTextureRef)
ImVec2
required
Size of the image to display
ImVec2
default:"(0,0), (1,1)"
UV coordinates for the image texture