17#ifndef DL_DISABLE_RENDER
64 _statePre{ b._statePre },
67 _bDisable{ b._bDisable },
68 _cptElemData{ b._cptElemData },
118 void SetSound(std::string_view click, std::string_view over)
120 _strSndClick = std::string{ click };
121 _strSndOver = std::string{ over };
137 _cptElemData.
_hv = hv;
138 _cptElemData.
_pos = pos;
143 _cptElemData._bRunAble = able;
164 std::string _strSndClick;
165 std::string _strSndOver;
181 return (std::size_t)state;
188 _cptElemData._size =
GetSize();
209 void _delete_this() {
delete this; }
218 _cptDeleteThis = std::bind(&Button::_delete_this,
this);
229 _cptClone = std::bind(&Button::_clone,
this);
248 static Button* _clickControl;
253 virtual void UpdateChild(
State state_pre,
State state) = 0;
254 virtual void RenderChild(
State state_pre,
State state) = 0;
256 void _update_button();
257 void _update_switch();
258 void _update_radio();
void PushBack(AnyType any)
添加一个任意对象
static Coor * Create(Coor *parent=nullptr)
std::array< Direction, 2 > Direction2
Function< std::function< bool()>, str_uid("IsSelect")> IsSelect
选择
Function< std::function< void(float)>, str_uid("SetOrder")> SetOrder
设置order
Function< std::function< void()>, str_uid("RenderD")> RenderDebug
调试绘图
Function< std::function< dl::Coor *()>, str_uid("GetCoor")> GetCoor
返回坐标系
Function< std::function< bool()>, str_uid("IsPickup")> IsPickup
---------------------------—具体组件----------------------------------—
Function< std::function< bool()>, str_uid("IsDown")> IsDown
按下状态
Function< std::function< void(bool)>, str_uid("SetSelect")> SetSelect
设置是否选择
Function< std::function< void()>, str_uid("Render")> Render
绘制
Function< std::function< void()>, str_uid("DeleteThis")> DeleteThis
删除自身
Function< std::function< void()>, str_uid("Update")> Update
逻辑
Function< std::function< bool()>, str_uid("IsClick")> IsClick
点击
Function< std::function< Components *()>, str_uid("Clone")> Clone
克隆
Button::State ButtonState