41 ret->_cptElemData = _cptElemData;
46 ret->
SetLang(cpt->_str[0], cpt->_str[1]);
74 void SetLang(std::string_view tag, std::string_view name)
76 _cptLang.
_str = { std::string{tag}, std::string{name} };
77 _cptLang.
_func = std::bind(&Text::_refresh_lang,
this, std::placeholders::_1, std::placeholders::_2);
80 _refresh_lang(tag, name);
98 _cptElemData.
_hv = hv;
127 void _delete_this() {
delete this; }
131 _cptDeleteThis = std::bind(&Text::_delete_this,
this);
132 _cptSetOrder = std::bind(&
Text::SetOrder,
this, std::placeholders::_1);
135 _cptSetOrder = std::bind(&
Text::SetOrder,
this, std::placeholders::_1);
146 void _refresh_lang(std::string_view tag, std::string_view name)
T * Get(size_t index=0)
返回第n个类型对象,失败返回nullptr
void PushBack(AnyType any)
添加一个任意对象
std::array< std::string, 2 > _str
std::function< void(std::string_view, std::string_view)> _func
gcText CloneText(gcText txt, bool copy_str=false)
复制一个文本
void SetOrder(float order)
设置绘制顺序
void SetString(std::string_view str)
设置内容
void SetOrder(float order)
设置绘制顺序
void RefreshElementData()
void SetLang(std::string_view tag, std::string_view name)
设置语言
void SetString(std::string_view str)
void SetElementData(const Align::Direction2 &hv)
static Text * Create(gcText txt)
Text * Clone()
复制一个,注意有些组件属性需要复制
gcText GetText()
返回文本对象,注意在大小变化后,不会更新ui的元素数据
std::array< Direction, 2 > Direction2
constexpr float Z_DEFAULT_UI
std::string_view lang(std::string_view tag, std::string_view name)
返回一个语言配置的字符串,传入 menu、start
constexpr std::array< Position::value_type, N > toPosition(const std::array< T, N > &a)