Represents an arbitrary block of text, possibly with icons, colors, etc.
More...
#include <MRImGuiMeasurementIndicators.h>
Represents an arbitrary block of text, possibly with icons, colors, etc.
◆ ElemVar
◆ FontFunc
◆ Text() [1/4]
| MR::ImGuiMeasurementIndicators::Text::Text |
( |
| ) |
|
|
inline |
◆ Text() [2/4]
| MR::ImGuiMeasurementIndicators::Text::Text |
( |
const std::string & | text | ) |
|
|
inline |
◆ Text() [3/4]
| MR::ImGuiMeasurementIndicators::Text::Text |
( |
std::string_view | text | ) |
|
|
inline |
◆ Text() [4/4]
| MR::ImGuiMeasurementIndicators::Text::Text |
( |
const char * | text | ) |
|
|
inline |
◆ add()
| void MR::ImGuiMeasurementIndicators::Text::add |
( |
auto && | elem | ) |
|
|
inline |
Adds any element type of ElemVar.
◆ addElem()
| void MR::ImGuiMeasurementIndicators::Text::addElem |
( |
Elem | elem | ) |
|
|
inline |
A low-level function for adding layout elements. For strings prefer addText(). This function doesn't automatically split them by newlines, and so on.
◆ addLine()
| void MR::ImGuiMeasurementIndicators::Text::addLine |
( |
| ) |
|
|
inline |
Add an empty string to force some vertical size on empty lines.
◆ addText()
| MRVIEWER_API void MR::ImGuiMeasurementIndicators::Text::addText |
( |
std::string_view | text | ) |
|
Adds some string to the text. Automatically splits by newlines.
◆ draw()
| MRVIEWER_API DrawResult MR::ImGuiMeasurementIndicators::Text::draw |
( |
ImDrawList & | list, |
|
|
ImVec2 | pos, |
|
|
const TextColor & | defaultTextColor = {} ) const |
Draws the text to the specified draw list. Automatically calls update(). If defaultTextColor is not specified, takes it from ImGui.
◆ getStaticDefaultFontFunc()
| static MRVIEWER_API const FontFunc & MR::ImGuiMeasurementIndicators::Text::getStaticDefaultFontFunc |
( |
| ) |
|
|
staticnodiscard |
Get the default value for .defaultFont. This can be null to default to null, which means the current font.
◆ isEmpty()
| bool MR::ImGuiMeasurementIndicators::Text::isEmpty |
( |
| ) |
const |
|
inlinenodiscard |
◆ setStaticDefaultFontFunc()
| static MRVIEWER_API void MR::ImGuiMeasurementIndicators::Text::setStaticDefaultFontFunc |
( |
FontFunc | func | ) |
|
|
static |
◆ update()
| MRVIEWER_API void MR::ImGuiMeasurementIndicators::Text::update |
( |
bool | force = false | ) |
const |
Recalculate computedSize in various places in this class. If force == false, only acts if dirty == true. In any case, resets the dirty flag.
◆ align
| ImVec2 MR::ImGuiMeasurementIndicators::Text::align |
Alignment. [0,0] = top-left, [1,1] = bottom-right.
◆ computedSize
| ImVec2 MR::ImGuiMeasurementIndicators::Text::computedSize |
|
mutable |
The computed content size. Read-only. Don't set manually, update() sets this.
◆ defaultFont
If null, uses the current font. Currently this defaults to a monospaced font. This is here because update() needs to know the font too.
◆ dirty
| bool MR::ImGuiMeasurementIndicators::Text::dirty = false |
|
mutable |
No computedSizeWithPadding, because for the entire Text we use size exactly, without max( size, computedSize ).
◆ lines
| std::vector<Line> MR::ImGuiMeasurementIndicators::Text::lines |
◆ size
| ImVec2 MR::ImGuiMeasurementIndicators::Text::size |
The text size for alignment. Unlike size in other elements below, this isn't the minimum size. If this is zero, align will pivot the text around a point, as opposed to in a box (the math for this just happens to work automatically).
The documentation for this struct was generated from the following file: