}
target.Update(delta);
focus = ctrl.Controlling()
- ? ctrl.Controlled().bounds.Center()
+ ? ctrl.Controlled().vbox.Center()
: target.Pos();
cam.Update(delta);
}
}
void Application::RenderEntities() {
- constexpr Color entityColor(0x00, 0xFA, 0x00);
- canvas.SetColor(entityColor);
+ constexpr Color vboxColor(0xFA, 0x00, 0x00);
+ constexpr Color hboxColor(0x00, 0xFA, 0x00);
for (const Entity &e : world.Entities()) {
- const Vector<float> pos(e.bounds.Left(), e.bounds.Top());
- const Vector<float> size(e.bounds.Size());
- canvas.OutlineRect(cam.ToScreen(pos), cam.ToScale(size));
+ canvas.SetColor(vboxColor);
+ canvas.Line(
+ cam.ToScreen(Vector<float>(e.vbox.Left(), e.vbox.Top())),
+ cam.ToScreen(Vector<float>(e.vbox.Right(), e.vbox.Top()))
+ );
+ canvas.Line(
+ cam.ToScreen(Vector<float>(e.vbox.Left(), e.vbox.Bottom())),
+ cam.ToScreen(Vector<float>(e.vbox.Right(), e.vbox.Bottom()))
+ );
+ canvas.SetColor(hboxColor);
+ canvas.Line(
+ cam.ToScreen(Vector<float>(e.hbox.Left(), e.hbox.Top())),
+ cam.ToScreen(Vector<float>(e.hbox.Left(), e.hbox.Bottom()))
+ );
+ canvas.Line(
+ cam.ToScreen(Vector<float>(e.hbox.Right(), e.hbox.Top())),
+ cam.ToScreen(Vector<float>(e.hbox.Right(), e.hbox.Bottom()))
+ );
}
}