|
dl
|
2d文本绘制对象 更多...
#include <dl_text.h>
类 | |
| struct | Layout |
| 布局属性 更多... | |
Public 成员函数 | |
| void | Render () |
| 绘制 | |
| void | SetFormat (bool open) |
| 设置是否要格式化字符串(默认为否) | |
| void | SetLayoutAlign (Align::Direction dir_h) |
| 设置布局属性(多行内的单行) | |
| void | SetPositionAlign (const Position &pos={}, const Align::Direction2 &dir=Align::LT) |
| 设置Coor位置,来整体对齐 | |
| void | SetCenter (const Position &pos={}) |
| 设置Coor位置,并根据整体大小居中 | |
| void | SetMaxW (float w) |
| 设置自动换行宽度,0为不自动换行 | |
| void | SetLineSpacing (Float k) |
| 设置行间距,默认为1.0 | |
| const Layout & | GetLayout () |
| void | SetOrder (float order) |
| 设置绘制顺序 | |
| void | SetColor (const Color &col, TextParam type=TextParam::NORMAL) |
| 设置颜色 | |
| bool | SetString (std::string_view str) |
| 设置内容 | |
| void | SetFontId (std::size_t id) |
| 设置字体id | |
| void | SetFontSize (unsigned size) |
| 设置字体大小 | |
| void | SetOutline (unsigned outline, const Color &color=ColorDef::BLACK) |
| 设置描边属性 | |
| void | SetShadow (unsigned shadow, const Color &color=ColorDef::BLACK) |
| 设置阴影属性 | |
| void | SetBackground (bool open, const Color &col=ColorDef::TEXT_BG) |
| 设置背景精灵 | |
| void | SetBackground (Text *b) |
| 注意传入gcText会调用上面的重载 | |
| Coor * | GetCoor () |
| 返回坐标系 | |
| float | GetOrder () |
| std::string | GetString () |
| Color | GetColor (TextParam type=TextParam::NORMAL) |
| Position | GetSize () |
| 返回区域大小 | |
| unsigned | GetFontSize (TextParam type=TextParam::NORMAL) |
| 返回字体大小 | |
| void | SetUI (bool ui) |
| 设置是否是ui(影响穿透) | |
| bool | IsPickup () |
| 是否被光标选中 | |
| size_t | Pos2Index (const Position &pos) |
| 返回所在位置(本地坐标系)的字符下标 | |
| Position | Index2Pos (size_t i) |
| 下标转到 字符位置(本地坐标系、左上角) | |
| Position | GetNodeSize (size_t i) |
| 获取某个字的包围盒大小 | |
| unsigned | GetNodeFontSize (size_t i) |
| 获取某个字的字体大小 | |
| size_t | Pos2IndexOutRange (const Position &pos) |
| 返回所在位置(本地坐标系)的字符下标 | |
| size_t | Pos2CursorIndex (const Position &pos) |
| 返回所在位置(本地坐标系)的光标下标 | |
| void | RenderDebug () |
| ~Text () | |
友元 | |
| class | Factory |
| class | PoolList< Text > |
| dl::Text::~Text | ( | ) |
|
inline |
|
inline |
|
inline |
| unsigned dl::Text::GetNodeFontSize | ( | size_t | i | ) |
获取某个字的字体大小
| Position dl::Text::GetNodeSize | ( | size_t | i | ) |
获取某个字的包围盒大小
| Position dl::Text::GetSize | ( | ) |
返回区域大小
| std::string dl::Text::GetString | ( | ) |
| Position dl::Text::Index2Pos | ( | size_t | i | ) |
下标转到 字符位置(本地坐标系、左上角)
| bool dl::Text::IsPickup | ( | ) |
是否被光标选中
| size_t dl::Text::Pos2CursorIndex | ( | const Position & | pos | ) |
返回所在位置(本地坐标系)的光标下标
| [in] | pos | 位置 |
| size_t dl::Text::Pos2Index | ( | const Position & | pos | ) |
返回所在位置(本地坐标系)的字符下标
| [in] | pos | 位置 |
| size_t dl::Text::Pos2IndexOutRange | ( | const Position & | pos | ) |
返回所在位置(本地坐标系)的字符下标
| [in] | pos | 位置 |
| void dl::Text::Render | ( | ) |
绘制
| void dl::Text::RenderDebug | ( | ) |
| void dl::Text::SetBackground | ( | bool | open, |
| const Color & | col = ColorDef::TEXT_BG ) |
设置背景精灵
| void dl::Text::SetCenter | ( | const Position & | pos = {} | ) |
设置Coor位置,并根据整体大小居中
| void dl::Text::SetColor | ( | const Color & | col, |
| TextParam | type = TextParam::NORMAL ) |
设置颜色
| void dl::Text::SetFontId | ( | std::size_t | id | ) |
设置字体id
| void dl::Text::SetFontSize | ( | unsigned | size | ) |
设置字体大小
|
inline |
| void dl::Text::SetOrder | ( | float | order | ) |
设置绘制顺序
| void dl::Text::SetOutline | ( | unsigned | outline, |
| const Color & | color = ColorDef::BLACK ) |
设置描边属性
|
inline |
| void dl::Text::SetShadow | ( | unsigned | shadow, |
| const Color & | color = ColorDef::BLACK ) |
设置阴影属性
| bool dl::Text::SetString | ( | std::string_view | str | ) |
设置内容
| [in] | str | 要设置的内容 |
| 未修改返回false |