|
dl
|
现代风格 按钮 更多...
#include <dl_ui_button_normal.h>
继承自 dl::UI::Button .
Public 成员函数 | |
| ButtonNormal * | Clone () |
| 必须实现的函数 | |
| void | AddText (gcText txt, const std::vector< Color > &mul_col, const std::vector< Position > &mul_offset) |
| 添加文本属性 | |
| void | SetString (std::string_view str) |
| virtual bool | IsPickup () override |
| virtual void | SetOrder (float order) override |
| virtual Position | GetSize () override |
| virtual Position | GetAnchor () override |
| ~ButtonNormal () | |
Public 成员函数 继承自 dl::UI::Button | |
| Button () | |
| Button (const Button &b) | |
| void | Update () |
| void | Render () |
| bool | IsClick () |
| 控件被点击 | |
| bool | IsDown () |
| 控件按下状态 | |
| bool | IsOverOnce () |
| 经过按钮,直到离开控件再次进入才会返回真 | |
| bool | IsRadio () |
| bool | IsSelect () |
| 控件是选中状态 | |
| void | SetSelect (bool open) |
| void | SetMode (Mode mode) |
| void | SetDisable (bool disable) |
| void | ClearState () |
| 清理状态为普通 | |
| void | SetSound (std::string_view click, std::string_view over) |
| 设置按钮音效 | |
| State | GetState () |
| Coor * | GetCoor () |
| 添加到Panel后会自动设置Coor数据,要设置位置等 请调用SetElementData | |
| virtual float | GetOrder ()=0 |
| float | GetOrder (int offset) |
| void | SetElementData (const Align::Direction2 &hv, const Position &pos={}) |
| void | SetElementDataRunAble (bool able) |
| void | SetElementDataAutoSize (bool parent_w, bool parent_h) |
| std::string | GetString () |
| void | AddText (gcText txt, const std::vector< Color > &mul_col, const std::vector< Position > &mul_offset) |
| 添加文本属性 | |
| void | AddTextDefault () |
| void | AddText (gcText txt) |
| void | AddText (gcText txt, const std::vector< Color > &mul_col) |
| void | SetString (std::string_view str) |
| void | SetTextAlign (const Align::Direction2 &hv) |
| void | SetSizeWithText (bool with, const Position &extra_size) |
| 设置精灵大小跟随文本 | |
| void | SetName (std::string_view name) |
| void | SetCustomRender (CbCustomRender cb) |
| void | SetEevntClick (CbEventClick cb) |
| Components * | GetCpt () |
| Mode | GetMode () |
| virtual | ~Button () |
静态 Public 成员函数 | |
| static ButtonNormal * | Create (std::string_view bg) |
| 精灵组成的按钮 | |
静态 Public 成员函数 继承自 dl::UI::Button | |
| static Button * | GetClickControl () |
额外继承的成员函数 | |
Public 类型 继承自 dl::UI::Button | |
| enum class | State { NORMAL , OVER , DOWN , DISABLE , DOWN_OVER , DOWN_DISABLE , MAX_NUM } |
| enum class | Mode { BUTTON , SWITCH , RADIO } |
| using | CbCustomRender = std::function<void(Button*)> |
| using | CbEventClick = std::function<void(Button*)> |
Protected 成员函数 继承自 dl::UI::Button | |
| std::size_t | GetIndex (State state) |
| 返回索引 | |
| void | _refresh_element_data () |
| constexpr bool | _use_over () |
| virtual void | UpdateChild (State state_pre, State state) |
| 重载此函数,制定控件行为 | |
| virtual void | RenderDebug () |
| void | UpdateTextOrder (float order) |
| order变化时需要调用 | |
| virtual void | OnTextSizeChange (const Position &size) |
| TextData * | GetTextData () |
Protected 属性 继承自 dl::UI::Button | |
| Coor * | _coor |
现代风格 按钮
在文件 dl_ui_button_normal.h 第 23 行定义.
|
inline |
在文件 dl_ui_button_normal.h 第 69 行定义.
| void dl::UI::ButtonNormal::AddText | ( | gcText | txt, |
| const std::vector< Color > & | mul_col, | ||
| const std::vector< Position > & | mul_offset ) |
添加文本属性
| [in] | txt | 文本 |
| [in] | mul_col | 5种状态颜色 |
| [in] | mul_offset | 5种状态的文本偏移 |
|
virtual |
必须实现的函数
实现了 dl::UI::Button.
|
inlinestatic |
精灵组成的按钮
| [in] | mul_spr | 多个精灵,浅拷贝 |
在文件 dl_ui_button_normal.h 第 33 行定义.
|
inlineoverridevirtual |
实现了 dl::UI::Button.
在文件 dl_ui_button_normal.h 第 67 行定义.
|
inlineoverridevirtual |
实现了 dl::UI::Button.
在文件 dl_ui_button_normal.h 第 66 行定义.
|
inlineoverridevirtual |
实现了 dl::UI::Button.
在文件 dl_ui_button_normal.h 第 53 行定义.
|
inlineoverridevirtual |
实现了 dl::UI::Button.
在文件 dl_ui_button_normal.h 第 57 行定义.
| void dl::UI::ButtonNormal::SetString | ( | std::string_view | str | ) |