Rigs of Rods 2023.09
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
RoR::ImTextFeeder Struct Reference

Helper for drawing multiline wrapped & colored text. More...

#include <GUIUtils.h>

Public Member Functions

 ImTextFeeder (ImDrawList *_drawlist, ImVec2 _origin)
 
void AddInline (ImU32 color, ImVec2 text_size, const char *text, const char *text_end)
 No wrapping or trimming.
 
void AddWrapped (ImU32 color, float wrap_width, const char *text, const char *text_end)
 Wraps entire input. Trims leading blanks on extra lines. wrap_width=-1.f disables wrapping.
 
void AddMultiline (ImU32 color, float wrap_width, const char *text, const char *text_end)
 Wraps substrings separated by blanks. wrap_width=-1.f disables wrapping.
 
void AddRectWrapped (ImVec2 size, ImVec2 spacing, float wrap_width, ImVec2 &out_rect_min)
 Reserves space for i.e. an image. wrap_width=-1.f disables wrapping.
 
void NextLine ()
 

Data Fields

ImDrawList * drawlist = nullptr
 
ImVec2 cursor
 Next draw position, screen space.
 
ImVec2 origin
 First draw position, screen space.
 
ImVec2 size = ImVec2(0,0)
 Accumulated text size.
 
float line_height = 0.f
 

Detailed Description

Helper for drawing multiline wrapped & colored text.

Definition at line 27 of file GUIUtils.h.

Constructor & Destructor Documentation

◆ ImTextFeeder()

RoR::ImTextFeeder::ImTextFeeder ( ImDrawList *  _drawlist,
ImVec2  _origin 
)

Definition at line 36 of file GUIUtils.cpp.

Member Function Documentation

◆ AddInline()

void RoR::ImTextFeeder::AddInline ( ImU32  color,
ImVec2  text_size,
const char *  text,
const char *  text_end 
)

No wrapping or trimming.

Definition at line 42 of file GUIUtils.cpp.

◆ AddMultiline()

void RoR::ImTextFeeder::AddMultiline ( ImU32  color,
float  wrap_width,
const char *  text,
const char *  text_end 
)

Wraps substrings separated by blanks. wrap_width=-1.f disables wrapping.

Definition at line 78 of file GUIUtils.cpp.

◆ AddRectWrapped()

void RoR::ImTextFeeder::AddRectWrapped ( ImVec2  size,
ImVec2  spacing,
float  wrap_width,
ImVec2 &  out_rect_min 
)

Reserves space for i.e. an image. wrap_width=-1.f disables wrapping.

Definition at line 124 of file GUIUtils.cpp.

◆ AddWrapped()

void RoR::ImTextFeeder::AddWrapped ( ImU32  color,
float  wrap_width,
const char *  text,
const char *  text_end 
)

Wraps entire input. Trims leading blanks on extra lines. wrap_width=-1.f disables wrapping.

Definition at line 50 of file GUIUtils.cpp.

◆ NextLine()

void RoR::ImTextFeeder::NextLine ( )

Definition at line 143 of file GUIUtils.cpp.

Field Documentation

◆ cursor

ImVec2 RoR::ImTextFeeder::cursor

Next draw position, screen space.

Definition at line 42 of file GUIUtils.h.

◆ drawlist

ImDrawList* RoR::ImTextFeeder::drawlist = nullptr

Definition at line 41 of file GUIUtils.h.

◆ line_height

float RoR::ImTextFeeder::line_height = 0.f

Definition at line 45 of file GUIUtils.h.

◆ origin

ImVec2 RoR::ImTextFeeder::origin

First draw position, screen space.

Definition at line 43 of file GUIUtils.h.

◆ size

ImVec2 RoR::ImTextFeeder::size = ImVec2(0,0)

Accumulated text size.

Definition at line 44 of file GUIUtils.h.


The documentation for this struct was generated from the following files: