|
Zappy GUI
C++ graphic client: renderer, camera, network
|
#include <TooltipRenderer.hpp>
Collaboration diagram for TooltipRenderer::Builder:Classes | |
| struct | ColoredSegment |
Public Member Functions | |
| Builder () | |
| Builder & | addLine (const std::string &text, Color color=WHITE) |
| Adds a single-color line to the tooltip. | |
| Builder & | addColoredText (const std::vector< std::string > &segments, const std::vector< Color > &colors) |
| Adds a line with multiple colored segments. | |
| Builder & | setBackgroundColor (Color color) |
| Sets the background color (ignoring alpha). | |
| Builder & | setBackgroundAlpha (unsigned char alpha) |
| Sets the background alpha transparency. | |
| Builder & | setBorderColor (Color color) |
| Sets the border color. | |
| Builder & | setBorderThickness (int thickness) |
| Sets the border thickness. | |
| Builder & | setFontSize (int size) |
| Sets the font size for all text. | |
| Builder & | setPadding (int padding) |
| Sets the internal padding. | |
| Builder & | setAnchor (Anchor anchor) |
| Sets the anchor point for positioning. | |
| void | draw (Vector2 position) |
| Draws the tooltip at the given position. | |
Private Member Functions | |
| Vector2 | _calculateAnchoredPosition (Vector2 position, int boxWidth, int boxHeight) const |
Private Attributes | |
| std::vector< std::vector< ColoredSegment > > | _lines |
| Color | _bgColor |
| unsigned char | _bgAlpha |
| Color | _borderColor |
| int | _borderThickness |
| int | _fontSize |
| int | _padding |
| Anchor | _anchor |
Definition at line 27 of file TooltipRenderer.hpp.
| TooltipRenderer::Builder::Builder | ( | ) |
Definition at line 9 of file TooltipRenderer.cpp.
|
private |
Definition at line 130 of file TooltipRenderer.cpp.
References TooltipRenderer::BottomCenter, TooltipRenderer::BottomLeft, TooltipRenderer::BottomRight, TooltipRenderer::Center, TooltipRenderer::MiddleLeft, TooltipRenderer::MiddleRight, TooltipRenderer::TopCenter, TooltipRenderer::TopLeft, and TooltipRenderer::TopRight.
| TooltipRenderer::Builder & TooltipRenderer::Builder::addColoredText | ( | const std::vector< std::string > & | segments, |
| const std::vector< Color > & | colors | ||
| ) |
Adds a line with multiple colored segments.
| segments | Vector of text segments. |
| colors | Vector of colors (must match segments size). |
| std::invalid_argument | if segments.size() != colors.size(). |
Definition at line 26 of file TooltipRenderer.cpp.
| TooltipRenderer::Builder & TooltipRenderer::Builder::addLine | ( | const std::string & | text, |
| Color | color = WHITE |
||
| ) |
Adds a single-color line to the tooltip.
| text | Text content. |
| color | Text color. |
Definition at line 20 of file TooltipRenderer.cpp.
Referenced by RaylibRenderer::_render2D().
Here is the caller graph for this function:| void TooltipRenderer::Builder::draw | ( | Vector2 | position | ) |
Draws the tooltip at the given position.
| position | Screen position (anchor point). |
Definition at line 83 of file TooltipRenderer.cpp.
References TextRenderer::draw(), and TextRenderer::measure().
Referenced by RaylibRenderer::_render2D().
Here is the call graph for this function:
Here is the caller graph for this function:| TooltipRenderer::Builder & TooltipRenderer::Builder::setAnchor | ( | Anchor | anchor | ) |
Sets the anchor point for positioning.
| anchor | Anchor position. |
Definition at line 77 of file TooltipRenderer.cpp.
Referenced by RaylibRenderer::_render2D().
Here is the caller graph for this function:| TooltipRenderer::Builder & TooltipRenderer::Builder::setBackgroundAlpha | ( | unsigned char | alpha | ) |
Sets the background alpha transparency.
| alpha | Alpha value (0-255). |
Definition at line 47 of file TooltipRenderer.cpp.
| TooltipRenderer::Builder & TooltipRenderer::Builder::setBackgroundColor | ( | Color | color | ) |
Sets the background color (ignoring alpha).
| color | Background color. |
Definition at line 41 of file TooltipRenderer.cpp.
Referenced by RaylibRenderer::_render2D().
Here is the caller graph for this function:| TooltipRenderer::Builder & TooltipRenderer::Builder::setBorderColor | ( | Color | color | ) |
Sets the border color.
| color | Border color. |
Definition at line 53 of file TooltipRenderer.cpp.
Referenced by RaylibRenderer::_render2D().
Here is the caller graph for this function:| TooltipRenderer::Builder & TooltipRenderer::Builder::setBorderThickness | ( | int | thickness | ) |
Sets the border thickness.
| thickness | Border thickness in pixels (0 = no border). |
Definition at line 59 of file TooltipRenderer.cpp.
Referenced by RaylibRenderer::_render2D().
Here is the caller graph for this function:| TooltipRenderer::Builder & TooltipRenderer::Builder::setFontSize | ( | int | size | ) |
Sets the font size for all text.
| size | Font size in pixels. |
Definition at line 65 of file TooltipRenderer.cpp.
Referenced by RaylibRenderer::_render2D().
Here is the caller graph for this function:| TooltipRenderer::Builder & TooltipRenderer::Builder::setPadding | ( | int | padding | ) |
Sets the internal padding.
| padding | Padding in pixels. |
Definition at line 71 of file TooltipRenderer.cpp.
Referenced by RaylibRenderer::_render2D().
Here is the caller graph for this function:
|
private |
Definition at line 117 of file TooltipRenderer.hpp.
|
private |
Definition at line 112 of file TooltipRenderer.hpp.
|
private |
Definition at line 111 of file TooltipRenderer.hpp.
|
private |
Definition at line 113 of file TooltipRenderer.hpp.
|
private |
Definition at line 114 of file TooltipRenderer.hpp.
|
private |
Definition at line 115 of file TooltipRenderer.hpp.
|
private |
Definition at line 110 of file TooltipRenderer.hpp.
|
private |
Definition at line 116 of file TooltipRenderer.hpp.