Program Listing for File render_ui_component.h

Return to documentation for file (rootex/framework/components/visual/ui/render_ui_component.h)

#pragma once

#include "component.h"
#include "components/space/transform_component.h"

class RenderUIComponent : public Component
{
    DEPENDS_ON(TransformComponent);

protected:
    bool m_IsVisible;

    RenderUIComponent(Entity& owner, const JSON::json& data);

public:
    virtual ~RenderUIComponent() = default;

    bool preRender();
    virtual void render() = 0;
    void postRender();

    void setIsVisible(bool enabled) { m_IsVisible = enabled; }
    bool isVisible() const { return m_IsVisible; }

    JSON::json getJSON() const override;
};