17#ifndef DL_DISABLE_RENDER
65 _statePre{ b._statePre },
68 _isClick{ b._isClick },
69 _bDisable{ b._bDisable },
70 _cptElemData{ b._cptElemData },
122 void SetSound(std::string_view click, std::string_view over)
124 _strSndClick = std::string{ click };
125 _strSndOver = std::string{ over };
141 _cptElemData.
_hv = hv;
142 _cptElemData.
_pos = pos;
147 _cptElemData._bRunAble = able;
151 _cptElemData._bParentW = parent_w;
152 _cptElemData._bParentH = parent_h;
162 return _clickControl;
167 if (_clickControl ==
this)
168 _clickControl =
nullptr;
181 std::string _strSndClick;
182 std::string _strSndOver;
198 return (std::size_t)state;
205 _cptElemData._size =
GetSize();
211#if DL_PLATFORM == DL_PLATFORM_ANDROID
235 void _delete_this() {
delete this; }
244 _cptDeleteThis = std::bind(&Button::_delete_this,
this);
255 _cptClone = std::bind(&Button::_clone,
this);
276 static Button* _clickControl;
281 virtual void UpdateChild(
State state_pre,
State state) = 0;
282 virtual void RenderChild(
State state_pre,
State state) = 0;
284 void _update_button();
285 void _update_switch();
286 void _update_radio();
void PushBack(AnyType any)
添加一个任意对象
static Coor * Create(Coor *parent=nullptr)
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< Position(void)>, str_uid("GetSize")> GetSize
获取大小
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