Files
palladium/source/ultra/elems/text.cpp
T

22 lines
624 B
C++
Raw Normal View History

2026-04-03 12:43:49 +02:00
#include <pd/ultra/container.hpp>
2026-03-26 21:02:10 +01:00
#include <pd/ultra/elems/text.hpp>
namespace PD {
namespace Ultra {
PD_API void Text::Draw(PD::Li::Drawlist& l) {
2026-04-03 12:43:49 +02:00
if (!pFont) return;
l.SetFont(pFont);
2026-04-02 23:29:53 +02:00
l.DrawText(pRenderspace.TopLeft(), pText.c_str(), pColor);
2026-03-26 21:02:10 +01:00
}
2026-04-03 12:43:49 +02:00
PD_API void Text::Update() {
if (!pFont) return;
if (!pParent) ElementBase::Update();
pRenderspace = pParent->GetCanvas().VTranslateObject(
pParent->GetTopLeft() + pPos,
pFont->GetTextBounds(pText.c_str(),
pParent->GetCanvas().VTranslateFontscale(pScale)),
pAlignment, true);
}
2026-03-26 21:02:10 +01:00
} // namespace Ultra
} // namespace PD