17#ifndef DL_DISABLE_RENDER
65 for (
auto& iter :
_col)
134 void SetSound(std::string_view click, std::string_view over)
136 _strSndClick = std::string{ click };
137 _strSndOver = std::string{ over };
161 _cptElemData.
_hv = hv;
162 _cptElemData.
_pos = pos;
167 _cptElemData._bRunAble = able;
171 _cptElemData._bParentW = parent_w;
172 _cptElemData._bParentH = parent_h;
181 return _txtData->_txt->GetString();
191 const std::vector<Color>& mul_col,
192 const std::vector<Position>& mul_offset);
209 _cptName.Set(std::string{ name });
225 return _clickControl;
230 if (_clickControl ==
this)
231 _clickControl =
nullptr;
246 std::string _strSndClick;
247 std::string _strSndOver;
263 return (std::size_t)state;
270 _cptElemData._size =
GetSize();
276#if DL_PLATFORM == DL_PLATFORM_ANDROID
323 void _delete_this() {
delete this; }
332 _cptDeleteThis = std::bind(&Button::_delete_this,
this);
343 _cptClone = std::bind(&Button::_clone,
this);
366 static Button* _clickControl;
369 void _update_button();
370 void _update_switch();
371 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