17#ifndef DL_DISABLE_RENDER
66 for (
auto& iter :
_col)
135 void SetSound(std::string_view click, std::string_view over)
137 _strSndClick = std::string{ click };
138 _strSndOver = std::string{ over };
166 _cptElemData.
_hv = hv;
167 _cptElemData.
_pos = pos;
172 _cptElemData._bRunAble = able;
176 _cptElemData._bParentW = parent_w;
177 _cptElemData._bParentH = parent_h;
186 return _txtData->_txt->GetString();
196 const std::vector<Color>& mul_col,
197 const std::vector<Position>& mul_offset);
214 _cptName.Set(std::string{ name });
234 return _clickControl;
239 if (_clickControl ==
this)
240 _clickControl =
nullptr;
255 std::string _strSndClick;
256 std::string _strSndOver;
272 return (std::size_t)state;
279 _cptElemData._size =
GetSize();
285#if DL_PLATFORM == DL_PLATFORM_ANDROID
333 void _delete_this() {
delete this; }
342 _cptDeleteThis = std::bind(&Button::_delete_this,
this);
353 _cptClone = std::bind(&Button::_clone,
this);
376 static Button* _clickControl;
379 void _update_button();
380 void _update_switch();
381 void _update_radio();
void PushBack(AnyType any)
添加一个任意对象
static Coor * Create(Coor *parent=nullptr)
Array< Direction, 2 > Direction2
Variable< std::string, str_uid("CustomName")> CustomName
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
---------------------------—具体组件----------------------------------—
Variable< int, str_uid("CustomTag")> CustomTag
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
克隆
constexpr float OffsetOrder(float order, int u=1, int v=0, int w=0)
偏移order
Button::State ButtonState
ArrayEnum< Position, Button::State::MAX_NUM > _offset
ArrayEnum< Color, Button::State::MAX_NUM > _col