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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user