载入中...
搜索中...
未找到
eve::ui::UI类 参考

Declarative UI module (eve.UI). 更多...

#include <UI.h>

类 eve::ui::UI 继承关系图:
eve::Module

Public 成员函数

 Module_REG (UI)
 
 UI ()
 
 ~UI () override
 
bool initBackend ()
 Creates the platform UI backend (ImGui); true on success.
 
void shutdownBackend ()
 Destroys the platform UI backend.
 
bool isBackendReady () const
 True once the backend exists.
 
void processEvent (const SDL_Event *event)
 Feeds an SDL event into the UI backend (before window/game handling).
 
void beginFrameAndRender ()
 Builds and presents the current frame's UI.
 
void dispatchEvents ()
 Dispatches queued widget callbacks (click/toggle/value/text).
 
bool wantCaptureMouse () const
 True when the UI wants to capture mouse input this frame.
 
bool wantCaptureKeyboard () const
 True when the UI wants to capture keyboard input this frame.
 
UIHostmountAs (const std::string &name, WidgetDesc root)
 Creates/replaces a named host from a WidgetDesc tree and selects it.
 
UIHostmount (WidgetDesc root)
 Mounts the tree as an auto-named host and selects it.
 
UIHostremount (WidgetDesc root)
 Replaces the selected host's tree.
 
UIHostremountReconcile (WidgetDesc root)
 Remount with key reconcile (props-only when structure matches).
 
UIHostremountAs (const std::string &name, WidgetDesc root)
 Creates/replaces a named host (does not select it).
 
bool select (const std::string &name)
 Selects a named host; false when it does not exist.
 
UIHostfindHost (const std::string &name) const
 Finds a host by name, or nullptr.
 
UIHostfindHostByOwner (uint32_t ownerId) const
 Finds the host bound to an owner id, or nullptr.
 
UIHostcurrent () const
 Currently selected host, or nullptr.
 
void bindOwner (uint32_t ownerId)
 Binds the selected host to a UI/scene owner id.
 
void beginBuild ()
 Imperative builder: open a new build pass (see beginWindow etc.).
 
void beginWindow (const std::string &title, const std::string &id="root")
 Opens a window for the current build pass.
 
void beginGroup (const std::string &id="")
 Opens a group container in the current build pass.
 
void beginList (const std::string &id)
 Opens a list container (rows added with addListItem).
 
void beginCollapsing (const std::string &label, const std::string &id="", bool open=true)
 Opens a collapsible header.
 
void beginChild (const std::string &id, float width=0.f, float height=120.f)
 Opens a sized child region.
 
void beginScrollList (const std::string &id="", float height=0.f, float itemHeight=0.f)
 
void beginFlex (const std::string &direction="row", const std::string &id="", float gap=-1.f)
 Begin a Flex container.
 
void beginRow (const std::string &id="", float gap=-1.f)
 Opens a row flex container.
 
void beginColumn (const std::string &id="", float gap=-1.f)
 Opens a column flex container.
 
void end ()
 Closes the innermost open container.
 
void addText (const std::string &content, const std::string &id="")
 Adds a text label to the current container.
 
void addTextWrapped (const std::string &content, float width, const std::string &id="")
 
void addButton (const std::string &label, const std::string &id="")
 Adds a button to the current container.
 
void addSameLine (const std::string &id="")
 Adds an inline-break spacer.
 
void addSeparator (const std::string &id="")
 Adds a separator line.
 
void addCheckbox (const std::string &label, bool checked, const std::string &id="")
 Adds a checkbox.
 
void addSlider (const std::string &label, float value, float minV, float maxV, const std::string &id="")
 Adds a slider.
 
void addProgress (float fraction, const std::string &id="", const std::string &overlay="")
 Adds a progress bar.
 
void addImage (const std::string &id="", float width=0.f, float height=0.f)
 
void addImageButton (const std::string &id, float width, float height)
 
void addViewport (const std::string &id, float width=0.f, float height=0.f)
 
void addCombo (const std::string &label, const std::string &options, int selected, const std::string &id="")
 
void addInputText (const std::string &label, const std::string &value, const std::string &id="")
 Adds an editable text field.
 
void addSpacer (const std::string &id="", float grow=1.f)
 Flexible empty space inside Flex (default grow=1).
 
void setItemFlexGrow (float grow)
 Set flex item props on the most recently added child of the current open container. No-op if there is no current child.
 
void setItemSize (float width, float height)
 Sets width/height on the most recently added child.
 
void setItemMargin (float l, float t, float r, float b)
 
void setItemPadding (float l, float t, float r, float b)
 
void setItemMinSize (float w, float h)
 
void setItemMaxSize (float w, float h)
 
void setItemPercent (float w, float h)
 
void setItemAbsolute (float anchorX, float anchorY, float x=0.f, float y=0.f)
 
void setFlexAlign (const std::string &align)
 Set Flex container align/justify on the current open Flex (no-op otherwise).
 
void setFlexJustify (const std::string &justify)
 Sets Flex container justify on the current open Flex.
 
void addListItem (const std::string &label, const std::string &id="")
 Append one list row button (call inside beginList).
 
bool mountBuild ()
 Finishes the build pass and mounts the built tree.
 
bool mountBuildAs (const std::string &name)
 Finishes the build pass and mounts as a named host.
 
bool remountBuildAs (const std::string &name)
 Like mountBuildAs but reconciles by key when possible.
 
bool setListItems (const std::string &listId, const std::vector< std::string > &items)
 Replace children of a Group listId with buttons for each label (reconcile). Host must already exist and contain a group with that id.
 
void setText (const std::string &id, const std::string &text)
 Widget state setters/getters on the current host (by node id).
 
void setTextWrap (const std::string &id, float width)
 
void setVisible (const std::string &id, bool visible)
 
void setChecked (const std::string &id, bool checked)
 
void setValue (const std::string &id, float value)
 
void setValueText (const std::string &id, const std::string &value)
 
void setImageTint (const std::string &id, float r, float g, float b, float a=1.f)
 
void setImageUv (const std::string &id, float u0, float v0, float u1, float v1)
 
void setImageNinePatch (const std::string &id, float l, float t, float r, float b)
 
void setImageCornerRadius (const std::string &id, float radius)
 
void setImageTextureId (const std::string &id, uint64_t textureId)
 
uint64_t registerTexture (graphics::Texture *tex)
 
float getValue (const std::string &id) const
 
std::string getValueText (const std::string &id) const
 
bool getChecked (const std::string &id) const
 
void setHostVisible (bool visible)
 Host-level state.
 
void setHostLayer (int layer)
 
void setHostModal (bool modal)
 Marks the host as a modal (blocks other hosts) / overlay.
 
void setHostOverlay (bool overlay)
 
void setHostPos (float x, float y, float pivotX=0.f, float pivotY=0.f)
 Positions the host window with a pivot (0..1 each axis).
 
void setHostAnchor (float x, float y)
 
void setHostSize (float w, float h)
 
void setHostPercent (float w, float h)
 
void animateHostPos (float x, float y, float durationMs)
 
std::string consumeClick ()
 Returns the id of the clicked widget since the last frame (or "").
 
std::string consumeChange ()
 Returns the id of the changed widget since the last frame (or "").
 
void onClick (const std::string &id, ssq::Function fn)
 
void onChange (const std::string &id, ssq::Function fn)
 
void setThemeDark ()
 Applies the dark/light built-in theme.
 
void setThemeLight ()
 
bool setTheme (const std::string &name)
 Named preset: "dark" / "light" (case-insensitive). Returns false if unknown.
 
std::string getTheme () const
 Name of the active theme.
 
void setNavKeyboard (bool enabled)
 Enables/disables keyboard navigation support.
 
void setNavGamepad (bool enabled)
 
void setScale (float scale)
 Global UI scale factor (default 1).
 
float getScale () const
 Current UI scale factor.
 
std::string getStats () const
 
std::string saveTreeJson () const
 
bool loadTreeJson (const std::string &json)
 
graphics::CanvasviewportCanvas (const std::string &id)
 
bool viewportHovered (const std::string &id)
 
bool viewportActive (const std::string &id)
 
float viewportMouseX (const std::string &id)
 
float viewportMouseY (const std::string &id)
 
float viewportDragDX (const std::string &id)
 
float viewportDragDY (const std::string &id)
 
float viewportWheel (const std::string &id)
 
void mountSimple (const std::string &title, const std::string &labelText, const std::string &buttonText)
 One-shot convenience: a window with a label and a button.
 
- Public 成员函数 继承自 eve::Module
virtual ~Module ()
 
virtual std::string getName () const =0
 

详细描述

Declarative UI module (eve.UI).

ECS: named UIHost panels. Builder + Component.build (C++/script) + list/when/theme.

在文件 UI.h30 行定义.

构造及析构函数说明

◆ UI()

eve::ui::UI::UI ( )

在文件 UI.cpp147 行定义.

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

◆ ~UI()

eve::ui::UI::~UI ( )
override

在文件 UI.cpp148 行定义.

引用了 shutdownBackend().

成员函数说明

◆ addButton()

void eve::ui::UI::addButton ( const std::string &  label,
const std::string &  id = "" 
)

Adds a button to the current container.

在文件 UI.cpp421 行定义.

引用了 eve::ui::button() , 以及 eve::ui::WidgetDesc::children.

◆ addCheckbox()

void eve::ui::UI::addCheckbox ( const std::string &  label,
bool  checked,
const std::string &  id = "" 
)

Adds a checkbox.

在文件 UI.cpp431 行定义.

引用了 eve::ui::checkbox() , 以及 eve::ui::WidgetDesc::children.

◆ addCombo()

void eve::ui::UI::addCombo ( const std::string &  label,
const std::string &  options,
int  selected,
const std::string &  id = "" 
)

Dropdown; options separated by '
', selected = initial index.

在文件 UI.cpp456 行定义.

引用了 eve::ui::WidgetDesc::children, eve::ui::combo() , 以及 end().

◆ addImage()

void eve::ui::UI::addImage ( const std::string &  id = "",
float  width = 0.f,
float  height = 0.f 
)

Colored / textured image; size 0 = default (32px or flex-assigned).

在文件 UI.cpp444 行定义.

引用了 eve::ui::WidgetDesc::children, height, image , 以及 width.

◆ addImageButton()

void eve::ui::UI::addImageButton ( const std::string &  id,
float  width,
float  height 
)

Clickable image button (click routes through consumeClick / callbacks).

在文件 UI.cpp448 行定义.

引用了 eve::ui::WidgetDesc::children, height, eve::ui::imageButton() , 以及 width.

◆ addInputText()

void eve::ui::UI::addInputText ( const std::string &  label,
const std::string &  value,
const std::string &  id = "" 
)

Adds an editable text field.

在文件 UI.cpp470 行定义.

引用了 eve::ui::WidgetDesc::children, eve::ui::inputText() , 以及 value.

◆ addListItem()

void eve::ui::UI::addListItem ( const std::string &  label,
const std::string &  id = "" 
)

Append one list row button (call inside beginList).

在文件 UI.cpp552 行定义.

引用了 eve::ui::button(), id , 以及 parent.

◆ addProgress()

void eve::ui::UI::addProgress ( float  fraction,
const std::string &  id = "",
const std::string &  overlay = "" 
)

Adds a progress bar.

在文件 UI.cpp440 行定义.

引用了 eve::ui::WidgetDesc::children , 以及 eve::ui::progress().

◆ addSameLine()

void eve::ui::UI::addSameLine ( const std::string &  id = "")

Adds an inline-break spacer.

在文件 UI.cpp425 行定义.

引用了 eve::ui::WidgetDesc::children , 以及 eve::ui::sameLine().

◆ addSeparator()

void eve::ui::UI::addSeparator ( const std::string &  id = "")

Adds a separator line.

在文件 UI.cpp427 行定义.

引用了 eve::ui::WidgetDesc::children , 以及 eve::ui::separator().

◆ addSlider()

void eve::ui::UI::addSlider ( const std::string &  label,
float  value,
float  minV,
float  maxV,
const std::string &  id = "" 
)

Adds a slider.

在文件 UI.cpp435 行定义.

引用了 eve::ui::WidgetDesc::children, eve::ui::slider() , 以及 value.

◆ addSpacer()

void eve::ui::UI::addSpacer ( const std::string &  id = "",
float  grow = 1.f 
)

Flexible empty space inside Flex (default grow=1).

在文件 UI.cpp474 行定义.

引用了 eve::ui::WidgetDesc::children , 以及 eve::ui::spacer().

◆ addText()

void eve::ui::UI::addText ( const std::string &  content,
const std::string &  id = "" 
)

Adds a text label to the current container.

在文件 UI.cpp411 行定义.

引用了 eve::ui::WidgetDesc::children , 以及 eve::ui::text().

◆ addTextWrapped()

void eve::ui::UI::addTextWrapped ( const std::string &  content,
float  width,
const std::string &  id = "" 
)

Text with an explicit wrap width (0 = no wrap).

在文件 UI.cpp415 行定义.

引用了 eve::ui::WidgetDesc::children, d, eve::ui::text() , 以及 width.

◆ addViewport()

void eve::ui::UI::addViewport ( const std::string &  id,
float  width = 0.f,
float  height = 0.f 
)

Embedded viewport widget (see viewportCanvas / viewport* input getters).

在文件 UI.cpp452 行定义.

引用了 eve::ui::WidgetDesc::children, height, eve::ui::viewport() , 以及 width.

◆ animateHostPos()

void eve::ui::UI::animateHostPos ( float  x,
float  y,
float  durationMs 
)

Animate the selected host's window position (px) from its current value to (x, y) over durationMs (0 = jump immediately). Driven by wall clock inside beginFrameAndRender().

在文件 UI.cpp743 行定义.

引用了 m, x , 以及 y.

◆ beginBuild()

void eve::ui::UI::beginBuild ( )

Imperative builder: open a new build pass (see beginWindow etc.).

在文件 UI.cpp320 行定义.

被这些函数引用 beginWindow().

◆ beginChild()

void eve::ui::UI::beginChild ( const std::string &  id,
float  width = 0.f,
float  height = 120.f 
)

Opens a sized child region.

在文件 UI.cpp346 行定义.

引用了 eve::ui::child(), height , 以及 width.

◆ beginCollapsing()

void eve::ui::UI::beginCollapsing ( const std::string &  label,
const std::string &  id = "",
bool  open = true 
)

Opens a collapsible header.

在文件 UI.cpp342 行定义.

引用了 eve::ui::collapsingHeader() , 以及 id.

◆ beginColumn()

void eve::ui::UI::beginColumn ( const std::string &  id = "",
float  gap = -1.f 
)

Opens a column flex container.

在文件 UI.cpp397 行定义.

引用了 beginFlex().

◆ beginFlex()

void eve::ui::UI::beginFlex ( const std::string &  direction = "row",
const std::string &  id = "",
float  gap = -1.f 
)

Begin a Flex container.

参数
direction"row" / "column" (case-insensitive; default row)
idstable node id
gapspacing between children; <0 uses theme ItemSpacing

在文件 UI.cpp389 行定义.

引用了 d, eve::ui::flex(), eve::ui::WidgetDesc::gap , 以及 id.

被这些函数引用 beginColumn() , 以及 beginRow().

◆ beginFrameAndRender()

void eve::ui::UI::beginFrameAndRender ( )

Builds and presents the current frame's UI.

在文件 UI.cpp175 行定义.

引用了 initBackend(), isBackendReady() , 以及 eve::ui::UISystem::render().

◆ beginGroup()

void eve::ui::UI::beginGroup ( const std::string &  id = "")

Opens a group container in the current build pass.

在文件 UI.cpp338 行定义.

引用了 group , 以及 id.

◆ beginList()

void eve::ui::UI::beginList ( const std::string &  id)

Opens a list container (rows added with addListItem).

在文件 UI.cpp340 行定义.

引用了 group , 以及 id.

◆ beginRow()

void eve::ui::UI::beginRow ( const std::string &  id = "",
float  gap = -1.f 
)

Opens a row flex container.

在文件 UI.cpp395 行定义.

引用了 beginFlex().

◆ beginScrollList()

void eve::ui::UI::beginScrollList ( const std::string &  id = "",
float  height = 0.f,
float  itemHeight = 0.f 
)

Virtualized scroll list; rows are the children added before end().

在文件 UI.cpp350 行定义.

引用了 height , 以及 eve::ui::scrollList().

◆ beginWindow()

void eve::ui::UI::beginWindow ( const std::string &  title,
const std::string &  id = "root" 
)

Opens a window for the current build pass.

在文件 UI.cpp333 行定义.

引用了 beginBuild(), id, title , 以及 eve::ui::window().

◆ bindOwner()

void eve::ui::UI::bindOwner ( uint32_t  ownerId)

Binds the selected host to a UI/scene owner id.

在文件 UI.cpp269 行定义.

引用了 eve::ui::UIHost::setOwnerId().

◆ consumeChange()

std::string eve::ui::UI::consumeChange ( )

Returns the id of the changed widget since the last frame (or "").

在文件 UI.cpp762 行定义.

引用了 eve::ui::UISystem::consumeChange().

◆ consumeClick()

std::string eve::ui::UI::consumeClick ( )

Returns the id of the clicked widget since the last frame (or "").

在文件 UI.cpp760 行定义.

引用了 eve::ui::UISystem::consumeClick().

◆ current()

UIHost * eve::ui::UI::current ( ) const
inline

Currently selected host, or nullptr.

在文件 UI.h73 行定义.

◆ dispatchEvents()

void eve::ui::UI::dispatchEvents ( )

Dispatches queued widget callbacks (click/toggle/value/text).

在文件 UI.cpp211 行定义.

引用了 eve::ui::UISystem::dispatchEvents(), events , 以及 eve::ui::UISystem::pendingEvents().

◆ end()

void eve::ui::UI::end ( )

Closes the innermost open container.

在文件 UI.cpp399 行定义.

被这些函数引用 addCombo().

◆ findHost()

UIHost * eve::ui::UI::findHost ( const std::string &  name) const

Finds a host by name, or nullptr.

在文件 UI.cpp256 行定义.

引用了 eve::ui::UISystem::findHost() , 以及 name.

被这些函数引用 mountAs(), remountBuildAs() , 以及 select().

◆ findHostByOwner()

UIHost * eve::ui::UI::findHostByOwner ( uint32_t  ownerId) const

Finds the host bound to an owner id, or nullptr.

在文件 UI.cpp258 行定义.

引用了 eve::ui::UISystem::findHostByOwner().

◆ getChecked()

bool eve::ui::UI::getChecked ( const std::string &  id) const

在文件 UI.cpp689 行定义.

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

◆ getScale()

float eve::ui::UI::getScale ( ) const

Current UI scale factor.

在文件 UI.cpp788 行定义.

被这些函数引用 setScale().

◆ getStats()

std::string eve::ui::UI::getStats ( ) const

"hosts=.. nodes=.. measureMs=.. walkMs=.." from the last render frame.

在文件 UI.cpp792 行定义.

引用了 s , 以及 eve::ui::UISystem::stats().

◆ getTheme()

std::string eve::ui::UI::getTheme ( ) const

Name of the active theme.

在文件 UI.cpp770 行定义.

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

◆ getValue()

float eve::ui::UI::getValue ( const std::string &  id) const

在文件 UI.cpp677 行定义.

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

◆ getValueText()

std::string eve::ui::UI::getValueText ( const std::string &  id) const

在文件 UI.cpp683 行定义.

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

◆ initBackend()

bool eve::ui::UI::initBackend ( )

Creates the platform UI backend (ImGui); true on success.

在文件 UI.cpp152 行定义.

引用了 eve::ui::createImGuiBackend(), ok , 以及 eve::ui::UISystem::setBackend().

被这些函数引用 beginFrameAndRender(), registerTexture() , 以及 setScale().

◆ isBackendReady()

bool eve::ui::UI::isBackendReady ( ) const

True once the backend exists.

在文件 UI.cpp150 行定义.

被这些函数引用 beginFrameAndRender(), registerTexture() , 以及 setScale().

◆ loadTreeJson()

bool eve::ui::UI::loadTreeJson ( const std::string &  json)

Replace the selected host's tree from JSON produced by saveTreeJson().

在文件 UI.cpp812 行定义.

引用了 eve::ui::UIHost::setTree().

◆ Module_REG()

eve::ui::UI::Module_REG ( UI  )

◆ mount()

UIHost * eve::ui::UI::mount ( WidgetDesc  root)

Mounts the tree as an auto-named host and selects it.

在文件 UI.cpp296 行定义.

引用了 mountAs() , 以及 eve::ui::UIHost::setTree().

◆ mountAs()

UIHost * eve::ui::UI::mountAs ( const std::string &  name,
WidgetDesc  root 
)

Creates/replaces a named host from a WidgetDesc tree and selects it.

在文件 UI.cpp287 行定义.

引用了 eve::ui::UIHost::createHost(), findHost(), h , 以及 name.

被这些函数引用 mount(), mountBuildAs(), mountSimple() , 以及 remountAs().

◆ mountBuild()

bool eve::ui::UI::mountBuild ( )

Finishes the build pass and mounts the built tree.

在文件 UI.cpp562 行定义.

引用了 remount().

◆ mountBuildAs()

bool eve::ui::UI::mountBuildAs ( const std::string &  name)

Finishes the build pass and mounts as a named host.

在文件 UI.cpp570 行定义.

引用了 mountAs() , 以及 name.

◆ mountSimple()

void eve::ui::UI::mountSimple ( const std::string &  title,
const std::string &  labelText,
const std::string &  buttonText 
)

One-shot convenience: a window with a label and a button.

在文件 UI.cpp1089 行定义.

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

◆ onChange()

void eve::ui::UI::onChange ( const std::string &  id,
ssq::Function  fn 
)

在文件 UI.cpp241 行定义.

引用了 fn, eve::ui::UIHost::getName() , 以及 kind.

◆ onClick()

void eve::ui::UI::onClick ( const std::string &  id,
ssq::Function  fn 
)

Script-side event callbacks (P0-3): register a closure on a node id of the selected host. onClick(id, fn) fires fn(); onChange(id, fn) fires fn(kind, value) where kind is "toggle"|"value"|"text" and value matches the widget type (bool / float / string). Handlers run inside dispatchEvents() (after the C++ callbacks and before the poll queues).

在文件 UI.cpp235 行定义.

引用了 fn , 以及 eve::ui::UIHost::getName().

◆ processEvent()

void eve::ui::UI::processEvent ( const SDL_Event *  event)

Feeds an SDL event into the UI backend (before window/game handling).

在文件 UI.cpp171 行定义.

◆ registerTexture()

uint64_t eve::ui::UI::registerTexture ( graphics::Texture tex)

Register an engine texture for UI drawing; returns opaque id (0 = failure).

在文件 UI.cpp670 行定义.

引用了 initBackend() , 以及 isBackendReady().

◆ remount()

UIHost * eve::ui::UI::remount ( WidgetDesc  root)

Replaces the selected host's tree.

在文件 UI.cpp304 行定义.

引用了 h.

被这些函数引用 mountBuild().

◆ remountAs()

UIHost * eve::ui::UI::remountAs ( const std::string &  name,
WidgetDesc  root 
)

Creates/replaces a named host (does not select it).

在文件 UI.cpp316 行定义.

引用了 mountAs() , 以及 name.

◆ remountBuildAs()

bool eve::ui::UI::remountBuildAs ( const std::string &  name)

Like mountBuildAs but reconciles by key when possible.

在文件 UI.cpp578 行定义.

引用了 eve::ui::UIHost::createHost(), findHost(), h , 以及 name.

◆ remountReconcile()

UIHost * eve::ui::UI::remountReconcile ( WidgetDesc  root)

Remount with key reconcile (props-only when structure matches).

在文件 UI.cpp310 行定义.

引用了 h.

◆ saveTreeJson()

std::string eve::ui::UI::saveTreeJson ( ) const

Serialize the selected host's tree to JSON (UI asset pipeline).

在文件 UI.cpp801 行定义.

引用了 eve::ui::UIHost::getName().

◆ select()

bool eve::ui::UI::select ( const std::string &  name)

Selects a named host; false when it does not exist.

在文件 UI.cpp262 行定义.

引用了 findHost(), h , 以及 name.

◆ setChecked()

void eve::ui::UI::setChecked ( const std::string &  id,
bool  checked 
)

在文件 UI.cpp618 行定义.

引用了 eve::ui::UIHost::setCheckedById().

◆ setFlexAlign()

void eve::ui::UI::setFlexAlign ( const std::string &  align)

Set Flex container align/justify on the current open Flex (no-op otherwise).

Set Flex container align/justify on the current open Flex (no-op otherwise).

在文件 UI.cpp540 行定义.

引用了 eve::ui::Flex , 以及 parent.

◆ setFlexJustify()

void eve::ui::UI::setFlexJustify ( const std::string &  justify)

Sets Flex container justify on the current open Flex.

在文件 UI.cpp546 行定义.

引用了 eve::ui::Flex , 以及 parent.

◆ setHostAnchor()

void eve::ui::UI::setHostAnchor ( float  x,
float  y 
)

Host anchor in display (0..1); offsets come from setHostPos.

在文件 UI.cpp721 行定义.

引用了 m, x , 以及 y.

◆ setHostLayer()

void eve::ui::UI::setHostLayer ( int  layer)

在文件 UI.cpp699 行定义.

引用了 layer , 以及 eve::ui::UIHost::setLayer().

◆ setHostModal()

void eve::ui::UI::setHostModal ( bool  modal)

Marks the host as a modal (blocks other hosts) / overlay.

在文件 UI.cpp703 行定义.

引用了 eve::ui::UIHost::setModal().

◆ setHostOverlay()

void eve::ui::UI::setHostOverlay ( bool  overlay)

在文件 UI.cpp707 行定义.

◆ setHostPercent()

void eve::ui::UI::setHostPercent ( float  w,
float  h 
)

Host window size as a fraction of the display (0..1).

在文件 UI.cpp736 行定义.

引用了 h, m , 以及 w.

◆ setHostPos()

void eve::ui::UI::setHostPos ( float  x,
float  y,
float  pivotX = 0.f,
float  pivotY = 0.f 
)

Positions the host window with a pivot (0..1 each axis).

在文件 UI.cpp711 行定义.

引用了 m, x , 以及 y.

◆ setHostSize()

void eve::ui::UI::setHostSize ( float  w,
float  h 
)

Explicit host window size (px).

在文件 UI.cpp728 行定义.

引用了 h, m , 以及 w.

◆ setHostVisible()

void eve::ui::UI::setHostVisible ( bool  visible)

Host-level state.

在文件 UI.cpp695 行定义.

引用了 eve::ui::UIHost::setVisible().

◆ setImageCornerRadius()

void eve::ui::UI::setImageCornerRadius ( const std::string &  id,
float  radius 
)

在文件 UI.cpp660 行定义.

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

◆ setImageNinePatch()

void eve::ui::UI::setImageNinePatch ( const std::string &  id,
float  l,
float  t,
float  r,
float  b 
)

在文件 UI.cpp650 行定义.

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

◆ setImageTextureId()

void eve::ui::UI::setImageTextureId ( const std::string &  id,
uint64_t  textureId 
)

Bind a texture id from registerTexture() to an Image/ImageButton node.

在文件 UI.cpp665 行定义.

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

◆ setImageTint()

void eve::ui::UI::setImageTint ( const std::string &  id,
float  r,
float  g,
float  b,
float  a = 1.f 
)

在文件 UI.cpp630 行定义.

引用了 a, b, eve::ui::UIHost::findById() , 以及 n.

◆ setImageUv()

void eve::ui::UI::setImageUv ( const std::string &  id,
float  u0,
float  v0,
float  u1,
float  v1 
)

在文件 UI.cpp640 行定义.

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

◆ setItemAbsolute()

void eve::ui::UI::setItemAbsolute ( float  anchorX,
float  anchorY,
float  x = 0.f,
float  y = 0.f 
)

Place the most recently added child absolutely inside the current Flex.

在文件 UI.cpp530 行定义.

引用了 parent, x , 以及 y.

◆ setItemFlexGrow()

void eve::ui::UI::setItemFlexGrow ( float  grow)

Set flex item props on the most recently added child of the current open container. No-op if there is no current child.

在文件 UI.cpp478 行定义.

引用了 parent.

◆ setItemMargin()

void eve::ui::UI::setItemMargin ( float  l,
float  t,
float  r,
float  b 
)

Layout box model on the most recently added child (no-op if none).

在文件 UI.cpp491 行定义.

引用了 b , 以及 parent.

◆ setItemMaxSize()

void eve::ui::UI::setItemMaxSize ( float  w,
float  h 
)

在文件 UI.cpp516 行定义.

引用了 h, parent , 以及 w.

◆ setItemMinSize()

void eve::ui::UI::setItemMinSize ( float  w,
float  h 
)

在文件 UI.cpp509 行定义.

引用了 h, parent , 以及 w.

◆ setItemPadding()

void eve::ui::UI::setItemPadding ( float  l,
float  t,
float  r,
float  b 
)

在文件 UI.cpp500 行定义.

引用了 b , 以及 parent.

◆ setItemPercent()

void eve::ui::UI::setItemPercent ( float  w,
float  h 
)

在文件 UI.cpp523 行定义.

引用了 h, parent , 以及 w.

◆ setItemSize()

void eve::ui::UI::setItemSize ( float  width,
float  height 
)

Sets width/height on the most recently added child.

在文件 UI.cpp484 行定义.

引用了 height, parent , 以及 width.

◆ setListItems()

bool eve::ui::UI::setListItems ( const std::string &  listId,
const std::vector< std::string > &  items 
)

Replace children of a Group listId with buttons for each label (reconcile). Host must already exist and contain a group with that id.

在文件 UI.cpp589 行定义.

引用了 eve::ui::UIHost::findById(), eve::ui::UIHost::getName(), eve::ui::Group, eve::ui::listButtons(), eve::ui::UIHost::setTree(), eve::ui::UIHost::setTreeReconcile() , 以及 eve::ui::window().

◆ setNavGamepad()

void eve::ui::UI::setNavGamepad ( bool  enabled)

在文件 UI.cpp776 行定义.

引用了 enabled, eve::ui::globalTheme() , 以及 eve::ui::Theme::navEnableGamepad.

◆ setNavKeyboard()

void eve::ui::UI::setNavKeyboard ( bool  enabled)

Enables/disables keyboard navigation support.

在文件 UI.cpp772 行定义.

引用了 enabled, eve::ui::globalTheme() , 以及 eve::ui::Theme::navEnableKeyboard.

◆ setScale()

void eve::ui::UI::setScale ( float  scale)

Global UI scale factor (default 1).

在文件 UI.cpp780 行定义.

引用了 getScale(), initBackend(), isBackendReady(), scale , 以及 eve::ui::setThemeUiScale().

◆ setText()

void eve::ui::UI::setText ( const std::string &  id,
const std::string &  text 
)

Widget state setters/getters on the current host (by node id).

在文件 UI.cpp605 行定义.

引用了 eve::ui::UIHost::setTextById() , 以及 eve::ui::text().

◆ setTextWrap()

void eve::ui::UI::setTextWrap ( const std::string &  id,
float  width 
)

在文件 UI.cpp609 行定义.

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

◆ setTheme()

bool eve::ui::UI::setTheme ( const std::string &  name)

Named preset: "dark" / "light" (case-insensitive). Returns false if unknown.

在文件 UI.cpp768 行定义.

引用了 name , 以及 eve::ui::setThemeByName().

◆ setThemeDark()

void eve::ui::UI::setThemeDark ( )

Applies the dark/light built-in theme.

在文件 UI.cpp764 行定义.

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

◆ setThemeLight()

void eve::ui::UI::setThemeLight ( )

在文件 UI.cpp766 行定义.

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

◆ setValue()

void eve::ui::UI::setValue ( const std::string &  id,
float  value 
)

在文件 UI.cpp622 行定义.

引用了 eve::ui::UIHost::setValueById() , 以及 value.

◆ setValueText()

void eve::ui::UI::setValueText ( const std::string &  id,
const std::string &  value 
)

在文件 UI.cpp626 行定义.

引用了 eve::ui::UIHost::setValueTextById() , 以及 value.

◆ setVisible()

void eve::ui::UI::setVisible ( const std::string &  id,
bool  visible 
)

在文件 UI.cpp614 行定义.

引用了 eve::ui::UIHost::setVisibleById().

◆ shutdownBackend()

void eve::ui::UI::shutdownBackend ( )

Destroys the platform UI backend.

在文件 UI.cpp167 行定义.

被这些函数引用 ~UI().

◆ viewportActive()

bool eve::ui::UI::viewportActive ( const std::string &  id)

在文件 UI.cpp846 行定义.

引用了 eve::ui::UIHost::getName() , 以及 eve::ui::UISystem::viewportState().

◆ viewportCanvas()

graphics::Canvas * eve::ui::UI::viewportCanvas ( const std::string &  id)

Offscreen render target of a Viewport widget in the selected host. The game renders 2D (gfx.setCanvas) or 3D (gfx.renderScene3DToCanvas) into it each frame before ui.beginFrameAndRender(); the UI then shows it. Returns nullptr until the widget has a layout rect (first render frame).

在文件 UI.cpp832 行定义.

引用了 eve::ui::ViewportState::canvas, eve::ui::UISystem::ensureViewport(), eve::ui::UIHost::getName(), id , 以及 eve::ui::UISystem::viewportState().

◆ viewportDragDX()

float eve::ui::UI::viewportDragDX ( const std::string &  id)

在文件 UI.cpp864 行定义.

引用了 eve::ui::UIHost::getName() , 以及 eve::ui::UISystem::viewportState().

◆ viewportDragDY()

float eve::ui::UI::viewportDragDY ( const std::string &  id)

在文件 UI.cpp870 行定义.

引用了 eve::ui::UIHost::getName() , 以及 eve::ui::UISystem::viewportState().

◆ viewportHovered()

bool eve::ui::UI::viewportHovered ( const std::string &  id)

在文件 UI.cpp840 行定义.

引用了 eve::ui::UIHost::getName() , 以及 eve::ui::UISystem::viewportState().

◆ viewportMouseX()

float eve::ui::UI::viewportMouseX ( const std::string &  id)

在文件 UI.cpp852 行定义.

引用了 eve::ui::UIHost::getName() , 以及 eve::ui::UISystem::viewportState().

◆ viewportMouseY()

float eve::ui::UI::viewportMouseY ( const std::string &  id)

在文件 UI.cpp858 行定义.

引用了 eve::ui::UIHost::getName() , 以及 eve::ui::UISystem::viewportState().

◆ viewportWheel()

float eve::ui::UI::viewportWheel ( const std::string &  id)

在文件 UI.cpp876 行定义.

引用了 eve::ui::UIHost::getName() , 以及 eve::ui::UISystem::viewportState().

◆ wantCaptureKeyboard()

bool eve::ui::UI::wantCaptureKeyboard ( ) const

True when the UI wants to capture keyboard input this frame.

在文件 UI.cpp252 行定义.

◆ wantCaptureMouse()

bool eve::ui::UI::wantCaptureMouse ( ) const

True when the UI wants to capture mouse input this frame.

在文件 UI.cpp248 行定义.


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