Files
palladium/include/pd/ultra/elems/text.hpp
T
tobid7 a776addf11 Implement VCanvas and Update TextElem
- Text now requires a font and is able to take an individual scale
- Container requires &ref for Elements to make sure they always exist
- SetViewport now sets the canvas as well
- SetBaseViewport Sets the Virtual Canvas Size
- Layout Now requires a Drawlist reference in Render function
- main.cpp: updated the template
2026-04-03 12:43:49 +02:00

29 lines
632 B
C++

#pragma once
#include <pd/core/core.hpp>
#include <pd/ultra/elems/element.hpp>
namespace PD {
namespace Ultra {
class PD_API Text : public ElementBase {
public:
Text() {}
~Text() {}
void Draw(PD::Li::Drawlist& l) override;
void Update() override;
void SetColor(const PD::Color& color) { pColor = color; }
void SetText(const std::string& text) { pText = text; }
void SetFont(PD::Li::Font& font) { pFont = &font; }
void SetScale(float scale) { pScale = scale; }
private:
PD::Color pColor;
float pScale = 1.f;
std::string pText;
PD::Li::Font* pFont = nullptr;
};
} // namespace Ultra
} // namespace PD