Widgets: Reimplement Hide/Show

This commit is contained in:
Jérôme Leclercq
2021-11-24 22:24:14 +01:00
parent d2cfc5fdf5
commit 6c97f538a1
4 changed files with 15 additions and 30 deletions

View File

@@ -17,9 +17,15 @@ namespace Nz
{
m_textSprite = std::make_shared<TextSprite>(Widgets::Instance()->GetTransparentMaterial());
m_textEntity = CreateEntity();
GetRegistry().emplace<GraphicsComponent>(m_textEntity).AttachRenderable(m_textSprite, GetCanvas()->GetRenderMask());
GetRegistry().emplace<NodeComponent>(m_textEntity).SetParent(this);
auto& registry = GetRegistry();
m_entity = CreateEntity();
auto& gfxComponent = registry.emplace<GraphicsComponent>(m_entity, IsVisible());
gfxComponent.AttachRenderable(m_textSprite, GetCanvas()->GetRenderMask());
auto& nodeComponent = registry.emplace<NodeComponent>(m_entity);
nodeComponent.SetParent(this);
Layout();
}