载入中...
搜索中...
未找到

ECS mount point for one UI panel/screen. Subclass to attach UI to game entities, e.g. class Hud : public UIHost. UISystem walks ecs::View<UIHost, Meta, Tree> (includes subclasses). 更多...

#include <UIHost.h>

类 eve::ui::UIHost 继承关系图:

struct  Meta
 
struct  Tree
 

Public 成员函数

void release () override
 
void setName (const std::string &name)
 Names the host.
 
const std::string & getName ()
 
void setOwnerId (uint32_t id)
 Attaches the host to an owner id (scene/UI ownership).
 
uint32_t getOwnerId ()
 
void setTree (WidgetDesc root)
 Full replace.
 
bool setTreeReconcile (WidgetDesc root)
 Key-aware patch when structure matches; else full replace.
 
void setSimplePanel (const std::string &title, const std::string &labelText, const std::string &buttonText, const std::string &labelId="label", const std::string &buttonId="btn")
 One-shot convenience panel: window + label + button.
 
void setTextById (const std::string &id, const std::string &text)
 Widget state updates by node id.
 
void setVisibleById (const std::string &id, bool visible)
 
void setCheckedById (const std::string &id, bool checked)
 
void setValueById (const std::string &id, float value)
 
void setValueTextById (const std::string &id, const std::string &value)
 
bool setClickHandler (const std::string &id, std::function< void()> fn)
 Installs a widget callback by node id (returns false if not found).
 
bool setToggleHandler (const std::string &id, std::function< void(bool)> fn)
 
bool setValueHandler (const std::string &id, std::function< void(float)> fn)
 
bool setTextHandler (const std::string &id, std::function< void(const std::string &)> fn)
 
UINodefindById (const std::string &id)
 Looks up a node by id or reconciliation key.
 
UINodefindByKey (const std::string &key)
 
void markDirty ()
 Marks the tree for a full rebuild on the next frame.
 
void setVisible (bool v)
 Host visibility / layer / modality.
 
void setLayer (int layer)
 
void setModal (bool modal)
 

静态 Public 成员函数

static UIHostcreateHost (const std::string &name="")
 

详细描述

ECS mount point for one UI panel/screen. Subclass to attach UI to game entities, e.g. class Hud : public UIHost. UISystem walks ecs::View<UIHost, Meta, Tree> (includes subclasses).

在文件 UIHost.h130 行定义.

成员函数说明

◆ createHost()

UIHost * eve::ui::UIHost::createHost ( const std::string &  name = "")
static

在文件 UIHost.cpp11 行定义.

引用了 h , 以及 name.

被这些函数引用 eve::ui::Component::mountAs(), eve::ui::UI::mountAs() , 以及 eve::ui::UI::remountBuildAs().

◆ findById()

◆ findByKey()

UINode * eve::ui::UIHost::findByKey ( const std::string &  key)

在文件 UIHost.cpp50 行定义.

引用了 n.

◆ getName()

◆ getOwnerId()

uint32_t eve::ui::UIHost::getOwnerId ( )
inline

在文件 UIHost.h178 行定义.

◆ markDirty()

void eve::ui::UIHost::markDirty ( )
inline

Marks the tree for a full rebuild on the next frame.

在文件 UIHost.h205 行定义.

◆ release()

void eve::ui::UIHost::release ( )
inlineoverride

在文件 UIHost.h134 行定义.

◆ setCheckedById()

void eve::ui::UIHost::setCheckedById ( const std::string &  id,
bool  checked 
)

在文件 UIHost.cpp67 行定义.

引用了 findById() , 以及 n.

被这些函数引用 eve::ui::UI::setChecked().

◆ setClickHandler()

bool eve::ui::UIHost::setClickHandler ( const std::string &  id,
std::function< void()>  fn 
)

Installs a widget callback by node id (returns false if not found).

在文件 UIHost.cpp79 行定义.

引用了 findById(), fn, idx , 以及 n.

◆ setLayer()

void eve::ui::UIHost::setLayer ( int  layer)
inline

在文件 UIHost.h209 行定义.

引用了 layer.

被这些函数引用 eve::ui::UI::setHostLayer().

◆ setModal()

void eve::ui::UIHost::setModal ( bool  modal)
inline

在文件 UIHost.h210 行定义.

被这些函数引用 eve::ui::UI::setHostModal().

◆ setName()

void eve::ui::UIHost::setName ( const std::string &  name)

Names the host.

在文件 UIHost.cpp22 行定义.

引用了 name.

◆ setOwnerId()

void eve::ui::UIHost::setOwnerId ( uint32_t  id)
inline

Attaches the host to an owner id (scene/UI ownership).

在文件 UIHost.h177 行定义.

引用了 id.

被这些函数引用 eve::ui::UI::bindOwner().

◆ setSimplePanel()

void eve::ui::UIHost::setSimplePanel ( const std::string &  title,
const std::string &  labelText,
const std::string &  buttonText,
const std::string &  labelId = "label",
const std::string &  buttonId = "btn" 
)

One-shot convenience panel: window + label + button.

在文件 UIHost.cpp30 行定义.

引用了 eve::ui::button(), setTree(), eve::ui::text(), title , 以及 eve::ui::window().

◆ setTextById()

void eve::ui::UIHost::setTextById ( const std::string &  id,
const std::string &  text 
)

Widget state updates by node id.

在文件 UIHost.cpp59 行定义.

引用了 findById(), n , 以及 eve::ui::text().

被这些函数引用 eve::ui::UI::setText().

◆ setTextHandler()

bool eve::ui::UIHost::setTextHandler ( const std::string &  id,
std::function< void(const std::string &)>  fn 
)

在文件 UIHost.cpp127 行定义.

引用了 findById(), fn, idx , 以及 n.

◆ setToggleHandler()

bool eve::ui::UIHost::setToggleHandler ( const std::string &  id,
std::function< void(bool)>  fn 
)

在文件 UIHost.cpp95 行定义.

引用了 findById(), fn, idx , 以及 n.

◆ setTree()

void eve::ui::UIHost::setTree ( WidgetDesc  root)

◆ setTreeReconcile()

bool eve::ui::UIHost::setTreeReconcile ( WidgetDesc  root)

Key-aware patch when structure matches; else full replace.

在文件 UIHost.cpp28 行定义.

引用了 eve::ui::applyTreeReconcile().

被这些函数引用 eve::ui::Component::rebuild() , 以及 eve::ui::UI::setListItems().

◆ setValueById()

void eve::ui::UIHost::setValueById ( const std::string &  id,
float  value 
)

在文件 UIHost.cpp71 行定义.

引用了 findById(), n , 以及 value.

被这些函数引用 eve::ui::UI::setValue().

◆ setValueHandler()

bool eve::ui::UIHost::setValueHandler ( const std::string &  id,
std::function< void(float)>  fn 
)

在文件 UIHost.cpp111 行定义.

引用了 findById(), fn, idx , 以及 n.

◆ setValueTextById()

void eve::ui::UIHost::setValueTextById ( const std::string &  id,
const std::string &  value 
)

在文件 UIHost.cpp75 行定义.

引用了 findById(), n , 以及 value.

被这些函数引用 eve::ui::UI::setValueText().

◆ setVisible()

void eve::ui::UIHost::setVisible ( bool  v)
inline

Host visibility / layer / modality.

在文件 UIHost.h208 行定义.

引用了 v.

被这些函数引用 eve::ui::UI::setHostVisible().

◆ setVisibleById()

void eve::ui::UIHost::setVisibleById ( const std::string &  id,
bool  visible 
)

在文件 UIHost.cpp63 行定义.

引用了 findById(), n , 以及 eve::ui::WidgetDesc::visible.

被这些函数引用 eve::ui::UI::setVisible().


该类的文档由以下文件生成: