15#ifndef DL_DISABLE_RENDER
37 Background* ret =
new Background;
106 void SetUI(
bool ui,
bool change_sampler =
true);
152 Cpt::ElementData _cptElemData;
154 void _delete_this() {
delete this; }
158 _cptDeleteThis = std::bind(&Background::_delete_this,
this);
166 _cpt.PushBack(&_cptDeleteThis);
167 _cpt.PushBack(&_cptSetOrder);
168 _cpt.PushBack(&_cptIsPickup);
169 _cpt.PushBack(&_cptRender);
170 _cpt.PushBack(&_cptGetCoor);
171 _cpt.PushBack(&_cptSetSize);
172 _cpt.PushBack(&_cptRenderDebug);
174 _cpt.PushBack(&_cptElemData);
static Coor * Create(Coor *parent=nullptr)
void SetUI(bool ui, bool change_sampler=true)
void SetWindowW(bool fixed)
float GetOrder(int offset)
static Background * Create()
void SetSizeExtra(const Position &size)
设置额外大小
void SetCustomRender(CbCustomRender cb)
void SetColor(const Color &col)
设置颜色
Position GetSize()
返回设置的大小(不包含额外大小)
void RefreshSize()
ui缩放变更后会调用
Position GetSizeReal()
返回显示的实际大小
void SetSize(const Position &size)
设置大小
void SetOrder(float order)
Cpt::ElementData & GetElementData()
std::function< void(Background *)> CbCustomRender
void SetWindowH(bool fixed)
void SetOffset(const Position &offset)
设置偏移
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< void(const Position &size)>, str_uid("SetSize")> SetSize
设置大小
Function< std::function< void()>, str_uid("Render")> Render
绘制
Function< std::function< void()>, str_uid("DeleteThis")> DeleteThis
删除自身
constexpr float OffsetOrder(float order, int u=1, int v=0, int w=0)
偏移order