StartGUI.cpp 792 B

123456789101112131415161718192021222324252627
  1. #include "client/gui/StartGUI.h"
  2. StartGUI::StartGUI(BaseGUI b)
  3. : base(b), address(base.addInput()), test(base.addInput()) {
  4. }
  5. void StartGUI::tick() {
  6. base.tick();
  7. }
  8. void StartGUI::render(float lag, ShaderMatrix& sm, Renderer& r) {
  9. base.updateScale(sm);
  10. Vector2 size = Vector2(BaseGUI::FIXED_SIZE[0] - 80.0f, 110.0f);
  11. Vector2 pos = (base.scaledSize - size) * 0.5f;
  12. address.pos = pos + Vector2(40.0f, 30.0f);
  13. address.size = Vector2(size[0] - 80.0f, 30.0f);
  14. test.pos = pos + Vector2(40.0f, 70.0f);
  15. test.size = Vector2(size[0] - 80.0f, 30.0f);
  16. r.drawRectangle(pos, size, Color4(0x50, 0x50, 0x50, 0xFF));
  17. base.drawCenteredString(r, pos, Vector2(size[0], 30.0f),
  18. "Connect to server ...");
  19. base.render(lag, sm, r);
  20. }