Skip to content
Snippets Groups Projects
PElement.cpp 482 B
Newer Older
gyroninja's avatar
gyroninja committed
#include "PElement.h"
#include "../components/TextComponent.h"
#include "../../html/TextNode.h"
gyroninja's avatar
gyroninja committed
std::unique_ptr<Component> PElement::renderer(const std::shared_ptr<Node> node, const int x, const int y, const int windowWidth, const int windowHeight) {
    TextNode *textNode = dynamic_cast<TextNode*>(node.get());
    if (textNode) {
gyroninja's avatar
gyroninja committed
        return std::make_unique<TextComponent>(textNode->text, x, y, 12, false, 0x000000FF, windowWidth, windowHeight);
    }
    return nullptr;