Toast Engine
Loading...
Searching...
No Matches
ui::UISystem Class Reference

Classes

struct  LocalizationScope

Public Member Functions

void tick () noexcept
void initializeRenderer (const renderer::VulkanCore &core)
void buildDrawFrame (renderer::VulkanRenderer::RenderFrame &frame)
auto createContext (std::string_view name, glm::ivec2 dimensions, std::optional< float > fixed_dp_ratio=std::nullopt) -> Rml::Context *
void destroyContext (Rml::Context *context)
auto loadFontFace (std::string_view uri, bool fallback=false) -> bool
auto loadFontFace (const assets::Handle< assets::Font > &font, bool fallback=false) -> bool
void registerGlobalStyle (const assets::Handle< assets::UIStyle > &style)
void unregisterGlobalStyle (const assets::Handle< assets::UIStyle > &style)
auto globalStyleUris () const -> std::vector< std::string >
void registerGlobalScheme (const assets::Handle< assets::ColorScheme > &scheme)
void unregisterGlobalScheme (const assets::Handle< assets::ColorScheme > &scheme)
auto colorFromSchemes (std::string_view name) const -> std::optional< glm::vec4 >
auto colorHex (std::string_view name) const -> std::optional< std::string >
void pushLocalizationScope (LocalizationScope scope)
void popLocalizationScope ()
void registerGlobalLocalization (const assets::Handle< assets::Localization > &loc)
void unregisterGlobalLocalization (const assets::Handle< assets::Localization > &loc)
void registerGlobalImageLocalization (const assets::Handle< assets::ImageLocalization > &loc)
void unregisterGlobalImageLocalization (const assets::Handle< assets::ImageLocalization > &loc)
auto language () const -> const std::string &
void setLanguage (std::string language)
void reloadAllDocuments ()
auto translate (std::string_view input) const -> std::optional< std::string >
auto lookupLocalizationRaw (std::string_view id) const -> std::optional< std::string >
auto localizedImage (std::string_view id) const -> std::string
void deferSetup (toast::Node *owner, std::function< void()> setup)
 For panels initialized on a World::loadNode or World::spawn worker since RmlUi is not thread safe.
void runDeferredSetup (toast::Node *owner)
 Runs the setup deferred for owner when called on the tick thread.
void cancelDeferredSetup (toast::Node *owner)
void registerPanel (toast::Panel *panel)
void unregisterPanel (toast::Panel *panel)
void registerWorldPanel (toast::Panel3D *panel)
void unregisterWorldPanel (toast::Panel3D *panel)
void registerContextOwner (Rml::Context *context, toast::Node *owner)
void unregisterContextOwner (Rml::Context *context)
auto ownerForContext (Rml::Context *context) const -> toast::Node *
auto panels () -> const std::vector< toast::Panel * > &
auto worldPanels () -> const std::vector< toast::Panel3D * > &
void applyDpRatio (float ratio)
void setSDLWindow (void *window)
auto renderInterface () -> RenderInterface_VK *

Static Public Member Functions

static auto get () noexcept -> UISystem &
static auto exists () noexcept -> bool
static auto onUIThread () -> bool
 The engine tick thread where RmlUi may be used.

Member Function Documentation

◆ initializeRenderer()

void ui::UISystem::initializeRenderer ( const renderer::VulkanCore & core)
Note
Must run once the renderer exists

The documentation for this class was generated from the following files:
  • engine/src/toast/ui/ui_system.hpp
  • engine/src/toast/ui/ui_system.cpp