![]() |
Rigs of Rods 2023.09
Soft-body Physics Simulation
|
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 |
Helper for drawing multiline wrapped & colored text.
Definition at line 27 of file GUIUtils.h.
| RoR::ImTextFeeder::ImTextFeeder | ( | ImDrawList * | _drawlist, |
| ImVec2 | _origin | ||
| ) |
Definition at line 36 of file GUIUtils.cpp.
| 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.
| 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.
| 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.
| 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.
| void RoR::ImTextFeeder::NextLine | ( | ) |
Definition at line 143 of file GUIUtils.cpp.
| ImVec2 RoR::ImTextFeeder::cursor |
Next draw position, screen space.
Definition at line 42 of file GUIUtils.h.
| ImDrawList* RoR::ImTextFeeder::drawlist = nullptr |
Definition at line 41 of file GUIUtils.h.
| float RoR::ImTextFeeder::line_height = 0.f |
Definition at line 45 of file GUIUtils.h.
| ImVec2 RoR::ImTextFeeder::origin |
First draw position, screen space.
Definition at line 43 of file GUIUtils.h.
| ImVec2 RoR::ImTextFeeder::size = ImVec2(0,0) |
Accumulated text size.
Definition at line 44 of file GUIUtils.h.