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
This commit is contained in:
2026-04-03 12:43:49 +02:00
parent 1cf3b6f8e6
commit a776addf11
8 changed files with 97 additions and 60 deletions
+5
View File
@@ -11,13 +11,18 @@ class PD_API Text : public ElementBase {
~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