20 entt::meta_factory<ui_render_mode>{}
21 .type(
"ui_render_mode"_hs)
26 .data<ui_render_mode::screen_space_overlay>(
"screen_space_overlay"_hs)
31 .data<ui_render_mode::world_space>(
"world_space"_hs)
37 entt::meta_factory<ui_document_component>{}
38 .type(
"ui_document_component"_hs)
54 .data<&ui_document_component::asset>(
"asset"_hs)
59 .data<&ui_document_component::render_mode>(
"render_mode"_hs)
63 entt::attribute{
"tooltip",
"Screen-space overlay or world-space 3D quad"},
68 return "Screen Space Overlay can be viewed in the Game View.";
73 .data<&ui_document_component::size>(
"size"_hs)
78 entt::attribute{
"tooltip",
"Document resolution (pixels). For world-space only."},
81 .data<&ui_document_component::pixels_per_world_unit>(
"pixels_per_world_unit"_hs)
86 entt::attribute{
"tooltip",
"Pixels per world unit for world-space rendering."},
93 try_save(ar, ser20::make_nvp(
"enabled", obj.is_enabled()));
94 try_save(ar, ser20::make_nvp(
"asset", obj.asset));
95 try_save(ar, ser20::make_nvp(
"render_mode", obj.render_mode));
96 try_save(ar, ser20::make_nvp(
"size", obj.size));
97 try_save(ar, ser20::make_nvp(
"pixels_per_world_unit", obj.pixels_per_world_unit));
109 try_load(ar, ser20::make_nvp(
"asset", obj.asset));
110 try_load(ar, ser20::make_nvp(
"render_mode", obj.render_mode));
111 try_load(ar, ser20::make_nvp(
"size", obj.size));
112 try_load(ar, ser20::make_nvp(
"pixels_per_world_unit", obj.pixels_per_world_unit));
auto property_predicate(property_predicate_t< T > predicate) -> property_predicate_t< T >
attributes::value_type attribute
std::map< std::string, meta_any > attributes
BinaryInputArchive iarchive_binary_t
simd::JSONOutputArchive oarchive_associative_t
BinaryOutputArchive oarchive_binary_t
simd::JSONInputArchive iarchive_associative_t
@ screen_space_overlay
Screen-space overlay (viewport-sized or positioned)
@ world_space
World-space (rendered on 3D quad, uses transform)
#define SAVE_INSTANTIATE(cls, Archive)
auto try_save(Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
#define LOAD_INSTANTIATE(cls, Archive)
auto try_load(Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
Component that holds a reference to a UI document for RmlUi rendering.
void set_enabled(bool enabled)
Set the enabled state of the document.
auto is_enabled() const -> bool
Check if document is currently enabled.
ui_render_mode render_mode
Rendering mode: screen or world.