Files
palladium/source/ultra/layout.cpp
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

18 lines
523 B
C++

#include <pd/lithium/formatters.hpp>
#include <pd/ultra/layout.hpp>
namespace PD {
namespace Ultra {
PD_API void Layout::Render(PD::Li::Drawlist& list) {
float fc = list.GetFontScale();
list.SetFontscale(GetCanvas().VTranslateFontscale(fc));
for (auto& it : GetElements()) {
it->Update();
it->Draw(list);
}
list.DrawText(PD::fvec2(5, GetBotLeft().y - 40),
std::format("Lyt: [{}]", GetRenderspace()).c_str(), 0xffff00ff);
list.SetFontscale(fc);
}
} // namespace Ultra
} // namespace PD