slot 0.0.1
A real time UI render framework
载入中...
搜索中...
未找到
| Public 成员函数 | Private 成员函数 | 静态 Private 成员函数 | Private 属性 | 所有成员列表
z8::ui::ImmediateUI类 参考

#include <ImmediateUI.h>

z8::ui::ImmediateUI 的协作图:
Collaboration graph
[图例]

struct  Scope
 

Public 成员函数

 ImmediateUI (Layout &layout)
 
void BeginFrame ()
 
bool BeginMenu (const std::string &key, const std::string &text, const UIStyle &style={})
 
bool Button (const std::string &key, const std::string &text, const UIStyle &style={})
 
bool BeginPanel (const std::string &key, const std::string &title, const UIStyle &style={})
 
bool BeginToolBar (const std::string &key, const UIStyle &style={})
 
BaseNodeTerminal (const std::string &key, const std::string &title="Output Log", const UIStyle &style={})
 
void EndMenu ()
 
void EndPanel ()
 
void EndToolBar ()
 
BaseNodeImage (const std::string &key, const std::string &source, const UIStyle &style={})
 
bool MenuItem (const std::string &key, const std::string &text, const UIStyle &style={})
 
BaseNodeRect (const std::string &key, const UIStyle &style={})
 
bool Slider (const std::string &key, float &value, float minimum=0.0f, float maximum=1.0f, const UIStyle &style={})
 
BaseNodeScene (const std::string &key, const UIStyle &style={})
 
bool TextInput (const std::string &key, std::string &value, const std::string &placeholder="", const UIStyle &style={})
 
bool Toggle (const std::string &key, const std::string &text, bool &value, const UIStyle &style={})
 
bool EndFrame ()
 
const std::string & LastError () const
 

Private 成员函数

BaseNodeAcquire (const std::string &type, const std::string &key)
 
void CloseScope ()
 

静态 Private 成员函数

static void ResetStyle (BaseNode &node, bool keepsInteractiveGeometry)
 
static void ApplyStyle (BaseNode &node, const UIStyle &style)
 

Private 属性

LayoutTargetLayout
 
std::vector< ScopeScopeStack
 
bool Changed = false
 
std::string Error
 

详细描述

ImGui 风格声明入口,但内部保留并复用控件。 同级 key 和调用顺序稳定时不会重新分配布局节点或 UIObject。

构造及析构函数说明

◆ ImmediateUI()

ImmediateUI::ImmediateUI ( Layout & layout)
explicit

成员函数说明

◆ Acquire()

BaseNode * ImmediateUI::Acquire ( const std::string & type,
const std::string & key )
private
函数调用图:
这是这个函数的调用关系图:

◆ ApplyStyle()

void ImmediateUI::ApplyStyle ( BaseNode & node,
const UIStyle & style )
staticprivate
函数调用图:
这是这个函数的调用关系图:

◆ BeginFrame()

void ImmediateUI::BeginFrame ( )
这是这个函数的调用关系图:

◆ BeginMenu()

bool ImmediateUI::BeginMenu ( const std::string & key,
const std::string & text,
const UIStyle & style = {} )

声明可递归嵌套的 Menu 目录;其子项必须在 EndMenu 前稳定重放。

函数调用图:

◆ BeginPanel()

bool ImmediateUI::BeginPanel ( const std::string & key,
const std::string & title,
const UIStyle & style = {} )
函数调用图:

◆ BeginToolBar()

bool ImmediateUI::BeginToolBar ( const std::string & key,
const UIStyle & style = {} )

声明固定顶部 ToolBar,并开始其 Menu 集合作用域。

函数调用图:

◆ Button()

bool ImmediateUI::Button ( const std::string & key,
const std::string & text,
const UIStyle & style = {} )

声明按钮;返回本帧之前是否完成过一次激活。

函数调用图:

◆ CloseScope()

void ImmediateUI::CloseScope ( )
private
这是这个函数的调用关系图:

◆ EndFrame()

bool ImmediateUI::EndFrame ( )
函数调用图:
这是这个函数的调用关系图:

◆ EndMenu()

void ImmediateUI::EndMenu ( )
函数调用图:

◆ EndPanel()

void ImmediateUI::EndPanel ( )
函数调用图:

◆ EndToolBar()

void ImmediateUI::EndToolBar ( )
函数调用图:

◆ Image()

BaseNode * ImmediateUI::Image ( const std::string & key,
const std::string & source,
const UIStyle & style = {} )

声明内建图标;Source 使用 builtin://icon/* 资源名。

函数调用图:

◆ LastError()

const std::string & z8::ui::ImmediateUI::LastError ( ) const
inline
这是这个函数的调用关系图:

◆ MenuItem()

bool ImmediateUI::MenuItem ( const std::string & key,
const std::string & text,
const UIStyle & style = {} )

声明 Menu 叶子命令;返回本帧之前是否完成过激活。

函数调用图:

◆ Rect()

BaseNode * ImmediateUI::Rect ( const std::string & key,
const UIStyle & style = {} )
函数调用图:
这是这个函数的调用关系图:

◆ ResetStyle()

void ImmediateUI::ResetStyle ( BaseNode & node,
bool keepsInteractiveGeometry )
staticprivate

恢复控件构造时的主题样式,防止复用节点携带上一帧的声明值。

函数调用图:
这是这个函数的调用关系图:

◆ Scene()

BaseNode * ImmediateUI::Scene ( const std::string & key,
const UIStyle & style = {} )

声明一个由渲染后端填充的 3D 场景视口。

函数调用图:

◆ Slider()

bool ImmediateUI::Slider ( const std::string & key,
float & value,
float minimum = 0.0f,
float maximum = 1.0f,
const UIStyle & style = {} )

声明 Slider,并把交互后的值写回调用方状态。

函数调用图:

◆ Terminal()

BaseNode * ImmediateUI::Terminal ( const std::string & key,
const std::string & title = "Output Log",
const UIStyle & style = {} )

声明消息输出面板;其内容由 Layout 的运行时消息通道维护。

函数调用图:

◆ TextInput()

bool ImmediateUI::TextInput ( const std::string & key,
std::string & value,
const std::string & placeholder = "",
const UIStyle & style = {} )

声明单行文字输入,并把已编辑 UTF-8 文本写回调用方状态。

函数调用图:

◆ Toggle()

bool ImmediateUI::Toggle ( const std::string & key,
const std::string & text,
bool & value,
const UIStyle & style = {} )

声明布尔开关,并把交互后的状态写回调用方状态。

函数调用图:

类成员变量说明

◆ Changed

bool z8::ui::ImmediateUI::Changed = false
private

◆ Error

std::string z8::ui::ImmediateUI::Error
private

◆ ScopeStack

std::vector<Scope> z8::ui::ImmediateUI::ScopeStack
private

◆ TargetLayout

Layout* z8::ui::ImmediateUI::TargetLayout
private

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