Raven Engine v0.1
A modern 3D Game Engine
Loading...
Searching...
No Matches
Raven::UI Namespace Reference

Classes

class  ScopedStyle
 RAII helper to push and pop a single ImGui style variable. Pushes the style var on construction, pops on destruction. More...
class  ScopedColor
 RAII helper to push and pop a single ImGui style color. More...
class  ScopedFont
 RAII helper to push and pop an ImGui font. More...
class  ScopedID
 RAII helper to push and pop an ImGui ID. Supports any type convertible to ImGuiID. More...
class  ScopedColorStack
 RAII helper to push and pop multiple ImGui style colors in one go. Expects a list of pairs: (ImGuiCol colorID, ColorValue). More...
class  ScopedStyleStack
 RAII helper to push and pop multiple ImGui style variables in one go. Expects a list of pairs: (ImGuiStyleVar, Value). More...
class  ScopedItemFlags
 RAII helper to push and pop ImGui item flags. More...
struct  Toast
 Simple structure to represent a toast notification. More...

Functions

void Image (Ref< Image2D > image, float width, float height)
 Render an Image2D at the specified size.
bool CreateCombo (const char *label, std::string &currentItem, std::vector< std::string > &items, ImGuiComboFlags_ flags)
 Create a combo box widget with a list of string items.
void BeginSection (const char *icon, const char *title)
void BeginStyledChild (const char *id, float height)
void EndStyledChild ()
void SuspendLayout ()
 Suspend layout updates for batching UI changes.
void ResumeLayout ()
 Resume layout updates after suspension.
void ShiftCursorX (float distance)
 Shift the ImGui cursor horizontally.
void ShiftCursorY (float distance)
 Shift the ImGui cursor vertically.
void ShiftCursor (float x, float y)
 Shift the ImGui cursor position by a 2D offset.
ImRect GetItemRect ()
 Retrieve the rectangle of the last rendered ImGui item.
ImRect RectExpanded (const ImRect &rect, float x, float y)
 Expand an ImRect by a fixed pixel amount on each axis.
ImRect RectOffset (const ImRect &rect, float x, float y)
 Offset an ImRect by fixed pixel amounts.
ImRect RectOffset (const ImRect &rect, ImVec2 xy)
 Offset an ImRect by a 2D vector.
void DrawVec3Control (const std::string &label, Crux::vec3 &values, float resetValue=0.0f, float columnLabelWidth=50.0f)
 Draw a labeled UI control for editing a 3D vector.
void DrawVec2Control (const std::string &label, Crux::vec2 &values, float resetValue=0.0f, float columnLabelWidth=50.0f)
 Draw a labeled UI control for editing a 2D vector.
bool DrawButtonImage (const Ref< Texture2D > &imageNormal, const Ref< Texture2D > &imageHovered, const Ref< Texture2D > &imagePressed, ImU32 tintNormal, ImU32 tintHovered, ImU32 tintPressed, ImVec2 rectMin, ImVec2 rectMax)
 Draw a textured button with different states and tinting.
bool DrawButtonImage (const Ref< Texture2D > &imageNormal, const Ref< Texture2D > &imageHovered, const Ref< Texture2D > &imagePressed, ImU32 tintNormal, ImU32 tintHovered, ImU32 tintPressed, ImRect rectangle)
 Draw a textured button using an ImRect.
bool DrawButtonImage (const Ref< Texture2D > &image, ImU32 tintNormal, ImU32 tintHovered, ImU32 tintPressed, ImVec2 rectMin, ImVec2 rectMax)
 Draw a textured button with a single image.
bool DrawButtonImage (const Ref< Texture2D > &image, ImU32 tintNormal, ImU32 tintHovered, ImU32 tintPressed, ImRect rectangle)
 Draw a textured button with a single image using a rectangle.
bool DrawButtonImage (const Ref< Texture2D > &imageNormal, const Ref< Texture2D > &imageHovered, const Ref< Texture2D > &imagePressed, ImU32 tintNormal, ImU32 tintHovered, ImU32 tintPressed)
 Draw a textured button with multiple states and implicit rect.
bool DrawButtonImage (const Ref< Texture2D > &image, ImU32 tintNormal, ImU32 tintHovered, ImU32 tintPressed)
 Draw a textured button with single image and implicit rect.
void BeginHorizontal (const char *str_id=nullptr, const ImVec2 &size=ImVec2(0, 0))
 Begin a horizontal UI layout group.
void EndHorizontal ()
 End the current horizontal layout group.
void BeginVertical (const char *str_id=nullptr, const ImVec2 &size=ImVec2(0, 0))
 Begin a vertical UI layout group.
void EndVertical ()
 End the current vertical layout group.
void Spring (float weightX=1.0f, float weightY=1.0f)
 Insert flexible spacing using weights.
bool SelectableW (const wchar_t *label, bool selected, ImGuiSelectableFlags flags=0)
 Render a selectable item using a wide-character label.
void RenderWindowOuterBorders (ImGuiWindow *window)
 Render borders around the outer edge of a window.
bool UpdateWindowManualResize (ImGuiWindow *window, ImVec2 &newSize, ImVec2 &newPosition)
 Handle manual window resize operation.
bool BeginMenubar (const ImRect &barRectangle)
 Begin a custom menubar inside a defined rectangle.
void EndMenubar ()
 End the current menubar.
bool ButtonCentered (const char *label)
 Draw a centered button.
void Chip (const char *label, ImU32 bg, ImU32 border, ImU32 textColor)
void SectionHeader (const char *title)
void DrawBorder (ImRect rect, float thickness=1.0f, float rounding=0.0f, float offsetX=0.0f, float offsetY=0.0f)
 Draws a border around a given ImRect area.
void ShowToast (const std::string &message, float duration, ImVec4 color=ImVec4(1.0f, 1.0f, 1.0f, 1.0f))
 Display a toast notification.
void RenderToasts (const ImVec2 &viewportPos, const ImVec2 &viewportSize)
 Render all active toasts within the given viewport area.

Function Documentation

◆ BeginSection()

FRAMEWORK_API void Raven::UI::BeginSection ( const char * icon,
const char * title )

◆ BeginStyledChild()

FRAMEWORK_API void Raven::UI::BeginStyledChild ( const char * id,
float height )

◆ ButtonCentered()

FRAMEWORK_API bool Raven::UI::ButtonCentered ( const char * label)

Draw a centered button.

Parameters
labelButton label text.
Returns
true if the button was pressed.

◆ Chip()

FRAMEWORK_API void Raven::UI::Chip ( const char * label,
ImU32 bg,
ImU32 border,
ImU32 textColor )

◆ DrawButtonImage() [1/6]

FRAMEWORK_API bool Raven::UI::DrawButtonImage ( const Ref< Texture2D > & image,
ImU32 tintNormal,
ImU32 tintHovered,
ImU32 tintPressed )

Draw a textured button with single image and implicit rect.

Returns
true if the button was pressed, false otherwise.

◆ DrawButtonImage() [2/6]

FRAMEWORK_API bool Raven::UI::DrawButtonImage ( const Ref< Texture2D > & image,
ImU32 tintNormal,
ImU32 tintHovered,
ImU32 tintPressed,
ImRect rectangle )

Draw a textured button with a single image using a rectangle.

Returns
true if the button was pressed, false otherwise.

◆ DrawButtonImage() [3/6]

FRAMEWORK_API bool Raven::UI::DrawButtonImage ( const Ref< Texture2D > & image,
ImU32 tintNormal,
ImU32 tintHovered,
ImU32 tintPressed,
ImVec2 rectMin,
ImVec2 rectMax )

Draw a textured button with a single image.

Returns
true if the button was pressed, false otherwise.

◆ DrawButtonImage() [4/6]

FRAMEWORK_API bool Raven::UI::DrawButtonImage ( const Ref< Texture2D > & imageNormal,
const Ref< Texture2D > & imageHovered,
const Ref< Texture2D > & imagePressed,
ImU32 tintNormal,
ImU32 tintHovered,
ImU32 tintPressed )

Draw a textured button with multiple states and implicit rect.

Returns
true if the button was pressed, false otherwise.

◆ DrawButtonImage() [5/6]

FRAMEWORK_API bool Raven::UI::DrawButtonImage ( const Ref< Texture2D > & imageNormal,
const Ref< Texture2D > & imageHovered,
const Ref< Texture2D > & imagePressed,
ImU32 tintNormal,
ImU32 tintHovered,
ImU32 tintPressed,
ImRect rectangle )

Draw a textured button using an ImRect.

Returns
true if the button was pressed, false otherwise.

◆ DrawButtonImage() [6/6]

FRAMEWORK_API bool Raven::UI::DrawButtonImage ( const Ref< Texture2D > & imageNormal,
const Ref< Texture2D > & imageHovered,
const Ref< Texture2D > & imagePressed,
ImU32 tintNormal,
ImU32 tintHovered,
ImU32 tintPressed,
ImVec2 rectMin,
ImVec2 rectMax )

Draw a textured button with different states and tinting.

Parameters
imageNormalTexture to display in the normal state.
imageHoveredTexture when hovered.
imagePressedTexture when pressed.
tintNormalTint color in normal state (RGBA).
tintHoveredTint color when hovered.
tintPressedTint color when pressed.
rectMinTop-left coordinate of the button.
rectMaxBottom-right coordinate of the button.
Returns
true if the button was pressed, false otherwise.

◆ EndStyledChild()

FRAMEWORK_API void Raven::UI::EndStyledChild ( )

◆ SectionHeader()

FRAMEWORK_API void Raven::UI::SectionHeader ( const char * title)