Declarative UI module (eve.UI). 更多...
#include <UI.h>
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. | |
| UIHost * | mountAs (const std::string &name, WidgetDesc root) |
| Creates/replaces a named host from a WidgetDesc tree and selects it. | |
| UIHost * | mount (WidgetDesc root) |
| Mounts the tree as an auto-named host and selects it. | |
| UIHost * | remount (WidgetDesc root) |
| Replaces the selected host's tree. | |
| UIHost * | remountReconcile (WidgetDesc root) |
| Remount with key reconcile (props-only when structure matches). | |
| UIHost * | remountAs (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. | |
| UIHost * | findHost (const std::string &name) const |
| Finds a host by name, or nullptr. | |
| UIHost * | findHostByOwner (uint32_t ownerId) const |
| Finds the host bound to an owner id, or nullptr. | |
| UIHost * | current () 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::Canvas * | viewportCanvas (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()
| eve::ui::UI::UI | ( | ) |
◆ ~UI()
|
override |
引用了 shutdownBackend().
成员函数说明
◆ addButton()
| void eve::ui::UI::addButton | ( | const std::string & | label, |
| const std::string & | id = "" |
||
| ) |
Adds a button to the current container.
◆ addCheckbox()
| void eve::ui::UI::addCheckbox | ( | const std::string & | label, |
| bool | checked, | ||
| const std::string & | id = "" |
||
| ) |
◆ 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.
引用了 eve::ui::WidgetDesc::children, eve::ui::combo() , 以及 end().
◆ addImage()
◆ addImageButton()
| void eve::ui::UI::addImageButton | ( | const std::string & | id, |
| float | width, | ||
| float | height | ||
| ) |
Clickable image button (click routes through consumeClick / callbacks).
引用了 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.
引用了 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).
引用了 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.
◆ addSameLine()
| void eve::ui::UI::addSameLine | ( | const std::string & | id = "" | ) |
Adds an inline-break spacer.
◆ addSeparator()
| void eve::ui::UI::addSeparator | ( | const std::string & | id = "" | ) |
Adds a separator line.
引用了 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.
引用了 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).
◆ addText()
| void eve::ui::UI::addText | ( | const std::string & | content, |
| const std::string & | id = "" |
||
| ) |
Adds a text label to the current container.
引用了 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).
引用了 eve::ui::WidgetDesc::children, d, eve::ui::text() , 以及 width.
◆ addViewport()
Embedded viewport widget (see viewportCanvas / viewport* input getters).
引用了 eve::ui::WidgetDesc::children, height, eve::ui::viewport() , 以及 width.
◆ animateHostPos()
| void eve::ui::UI::animateHostPos | ( | float | x, |
| float | y, | ||
| float | durationMs | ||
| ) |
◆ beginBuild()
| void eve::ui::UI::beginBuild | ( | ) |
Imperative builder: open a new build pass (see beginWindow etc.).
被这些函数引用 beginWindow().
◆ beginChild()
◆ beginCollapsing()
| void eve::ui::UI::beginCollapsing | ( | const std::string & | label, |
| const std::string & | id = "", |
||
| bool | open = true |
||
| ) |
◆ beginColumn()
| void eve::ui::UI::beginColumn | ( | const std::string & | id = "", |
| float | gap = -1.f |
||
| ) |
◆ 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) id stable node id gap spacing between children; <0 uses theme ItemSpacing
引用了 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.
引用了 initBackend(), isBackendReady() , 以及 eve::ui::UISystem::render().
◆ beginGroup()
| void eve::ui::UI::beginGroup | ( | const std::string & | id = "" | ) |
◆ beginList()
| void eve::ui::UI::beginList | ( | const std::string & | id | ) |
◆ beginRow()
| void eve::ui::UI::beginRow | ( | const std::string & | id = "", |
| float | gap = -1.f |
||
| ) |
◆ 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().
引用了 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.
引用了 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.
◆ consumeChange()
| std::string eve::ui::UI::consumeChange | ( | ) |
Returns the id of the changed widget since the last frame (or "").
◆ consumeClick()
| std::string eve::ui::UI::consumeClick | ( | ) |
Returns the id of the clicked widget since the last frame (or "").
◆ current()
|
inline |
◆ dispatchEvents()
| void eve::ui::UI::dispatchEvents | ( | ) |
Dispatches queued widget callbacks (click/toggle/value/text).
引用了 eve::ui::UISystem::dispatchEvents(), events , 以及 eve::ui::UISystem::pendingEvents().
◆ end()
| void eve::ui::UI::end | ( | ) |
◆ findHost()
| UIHost * eve::ui::UI::findHost | ( | const std::string & | name | ) | const |
Finds a host by name, or nullptr.
引用了 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.
◆ getChecked()
| bool eve::ui::UI::getChecked | ( | const std::string & | id | ) | const |
引用了 eve::ui::UIHost::findById() , 以及 n.
◆ getScale()
| float eve::ui::UI::getScale | ( | ) | const |
◆ getStats()
| std::string eve::ui::UI::getStats | ( | ) | const |
"hosts=.. nodes=.. measureMs=.. walkMs=.." from the last render frame.
引用了 s , 以及 eve::ui::UISystem::stats().
◆ getTheme()
| std::string eve::ui::UI::getTheme | ( | ) | const |
◆ getValue()
| float eve::ui::UI::getValue | ( | const std::string & | id | ) | const |
引用了 eve::ui::UIHost::findById() , 以及 n.
◆ getValueText()
| std::string eve::ui::UI::getValueText | ( | const std::string & | id | ) | const |
引用了 eve::ui::UIHost::findById() , 以及 n.
◆ initBackend()
| bool eve::ui::UI::initBackend | ( | ) |
Creates the platform UI backend (ImGui); true on success.
引用了 eve::ui::createImGuiBackend(), ok , 以及 eve::ui::UISystem::setBackend().
被这些函数引用 beginFrameAndRender(), registerTexture() , 以及 setScale().
◆ isBackendReady()
| bool eve::ui::UI::isBackendReady | ( | ) | const |
True once the backend exists.
被这些函数引用 beginFrameAndRender(), registerTexture() , 以及 setScale().
◆ loadTreeJson()
| bool eve::ui::UI::loadTreeJson | ( | const std::string & | json | ) |
Replace the selected host's tree from JSON produced by saveTreeJson().
◆ 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.
引用了 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.
引用了 eve::ui::UIHost::createHost(), findHost(), h , 以及 name.
被这些函数引用 mount(), mountBuildAs(), mountSimple() , 以及 remountAs().
◆ mountBuild()
| bool eve::ui::UI::mountBuild | ( | ) |
◆ mountBuildAs()
| bool eve::ui::UI::mountBuildAs | ( | const std::string & | 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.
引用了 eve::ui::button(), mountAs(), eve::ui::text(), title , 以及 eve::ui::window().
◆ onChange()
| void eve::ui::UI::onChange | ( | const std::string & | id, |
| ssq::Function | fn | ||
| ) |
引用了 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).
引用了 fn , 以及 eve::ui::UIHost::getName().
◆ processEvent()
| void eve::ui::UI::processEvent | ( | const SDL_Event * | event | ) |
◆ registerTexture()
| uint64_t eve::ui::UI::registerTexture | ( | graphics::Texture * | tex | ) |
Register an engine texture for UI drawing; returns opaque id (0 = failure).
引用了 initBackend() , 以及 isBackendReady().
◆ remount()
| UIHost * eve::ui::UI::remount | ( | WidgetDesc | root | ) |
◆ remountAs()
| UIHost * eve::ui::UI::remountAs | ( | const std::string & | name, |
| WidgetDesc | root | ||
| ) |
◆ remountBuildAs()
| bool eve::ui::UI::remountBuildAs | ( | const std::string & | name | ) |
Like mountBuildAs but reconciles by key when possible.
引用了 eve::ui::UIHost::createHost(), findHost(), h , 以及 name.
◆ remountReconcile()
| UIHost * eve::ui::UI::remountReconcile | ( | WidgetDesc | root | ) |
◆ saveTreeJson()
| std::string eve::ui::UI::saveTreeJson | ( | ) | const |
Serialize the selected host's tree to JSON (UI asset pipeline).
◆ select()
| bool eve::ui::UI::select | ( | const std::string & | name | ) |
Selects a named host; false when it does not exist.
引用了 findHost(), h , 以及 name.
◆ setChecked()
| void eve::ui::UI::setChecked | ( | const std::string & | id, |
| bool | checked | ||
| ) |
◆ 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).
引用了 eve::ui::Flex , 以及 parent.
◆ setFlexJustify()
| void eve::ui::UI::setFlexJustify | ( | const std::string & | justify | ) |
Sets Flex container justify on the current open Flex.
引用了 eve::ui::Flex , 以及 parent.
◆ setHostAnchor()
| void eve::ui::UI::setHostAnchor | ( | float | x, |
| float | y | ||
| ) |
◆ setHostLayer()
| void eve::ui::UI::setHostLayer | ( | int | layer | ) |
引用了 layer , 以及 eve::ui::UIHost::setLayer().
◆ setHostModal()
| void eve::ui::UI::setHostModal | ( | bool | modal | ) |
Marks the host as a modal (blocks other hosts) / overlay.
◆ setHostOverlay()
◆ setHostPercent()
| void eve::ui::UI::setHostPercent | ( | float | w, |
| float | h | ||
| ) |
◆ setHostPos()
◆ setHostSize()
| void eve::ui::UI::setHostSize | ( | float | w, |
| float | h | ||
| ) |
◆ setHostVisible()
| void eve::ui::UI::setHostVisible | ( | bool | visible | ) |
◆ setImageCornerRadius()
| void eve::ui::UI::setImageCornerRadius | ( | const std::string & | id, |
| float | radius | ||
| ) |
引用了 eve::ui::UIHost::findById() , 以及 n.
◆ setImageNinePatch()
| void eve::ui::UI::setImageNinePatch | ( | const std::string & | id, |
| float | l, | ||
| float | t, | ||
| float | r, | ||
| float | b | ||
| ) |
引用了 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.
引用了 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 |
||
| ) |
◆ setImageUv()
| void eve::ui::UI::setImageUv | ( | const std::string & | id, |
| float | u0, | ||
| float | v0, | ||
| float | u1, | ||
| float | v1 | ||
| ) |
引用了 eve::ui::UIHost::findById() , 以及 n.
◆ setItemAbsolute()
◆ setItemFlexGrow()
| void eve::ui::UI::setItemFlexGrow | ( | float | grow | ) |
◆ setItemMargin()
| void eve::ui::UI::setItemMargin | ( | float | l, |
| float | t, | ||
| float | r, | ||
| float | b | ||
| ) |
◆ setItemMaxSize()
◆ setItemMinSize()
◆ setItemPadding()
| void eve::ui::UI::setItemPadding | ( | float | l, |
| float | t, | ||
| float | r, | ||
| float | b | ||
| ) |
◆ setItemPercent()
◆ setItemSize()
| void eve::ui::UI::setItemSize | ( | float | width, |
| float | height | ||
| ) |
◆ 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.
引用了 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 | ) |
◆ setNavKeyboard()
| void eve::ui::UI::setNavKeyboard | ( | bool | enabled | ) |
Enables/disables keyboard navigation support.
引用了 enabled, eve::ui::globalTheme() , 以及 eve::ui::Theme::navEnableKeyboard.
◆ setScale()
| void eve::ui::UI::setScale | ( | float | scale | ) |
Global UI scale factor (default 1).
引用了 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).
◆ setTextWrap()
| void eve::ui::UI::setTextWrap | ( | const std::string & | id, |
| float | width | ||
| ) |
引用了 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.
引用了 name , 以及 eve::ui::setThemeByName().
◆ setThemeDark()
| void eve::ui::UI::setThemeDark | ( | ) |
◆ setThemeLight()
| void eve::ui::UI::setThemeLight | ( | ) |
◆ setValue()
| void eve::ui::UI::setValue | ( | const std::string & | id, |
| float | value | ||
| ) |
引用了 eve::ui::UIHost::setValueById() , 以及 value.
◆ setValueText()
| void eve::ui::UI::setValueText | ( | const std::string & | id, |
| const std::string & | value | ||
| ) |
引用了 eve::ui::UIHost::setValueTextById() , 以及 value.
◆ setVisible()
| void eve::ui::UI::setVisible | ( | const std::string & | id, |
| bool | visible | ||
| ) |
◆ shutdownBackend()
| void eve::ui::UI::shutdownBackend | ( | ) |
◆ viewportActive()
| bool eve::ui::UI::viewportActive | ( | const std::string & | id | ) |
◆ 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).
引用了 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 | ) |
◆ viewportDragDY()
| float eve::ui::UI::viewportDragDY | ( | const std::string & | id | ) |
◆ viewportHovered()
| bool eve::ui::UI::viewportHovered | ( | const std::string & | id | ) |
◆ viewportMouseX()
| float eve::ui::UI::viewportMouseX | ( | const std::string & | id | ) |
◆ viewportMouseY()
| float eve::ui::UI::viewportMouseY | ( | const std::string & | id | ) |
◆ viewportWheel()
| float eve::ui::UI::viewportWheel | ( | const std::string & | id | ) |
◆ wantCaptureKeyboard()
| bool eve::ui::UI::wantCaptureKeyboard | ( | ) | const |
◆ wantCaptureMouse()
| bool eve::ui::UI::wantCaptureMouse | ( | ) | const |
该类的文档由以下文件生成:
Public 成员函数 继承自