1234567891011121314151617181920212223242526272829303132333435363738 |
- #include "StartMenu.h"
- StartMenu::StartMenu()
- {
- }
- StartMenu::~StartMenu()
- {
- }
- void StartMenu::render2DTick(Shader& shader, DirectRenderer& dr, float lag)
- {
- shader.setToIdentity();
- shader.updateModelMatrix();
-
- float w = Engine::getScaledWidth();
- float h = Engine::getScaledHeight();
-
- Engine::setColorMode();
- dr.drawRectangle(0, 0, w, h, 0xFF004B96);
-
- float halfW = w * 0.5;
- float halfH = h * 0.5;
-
- float startHalfW = w * 0.25;
- float startHalfH = h * 0.25;
-
- dr.drawRectangle(startHalfW, startHalfH, startHalfW + halfW, startHalfH + halfH, 0x30000000);
-
- float textWidth;
- float textHeight;
-
- string title = "Cubes Plus Plus";
- dr.getStringSize(textWidth, textHeight, title);
- Engine::setMixMode();
- dr.drawString(startHalfW + (halfW - textWidth) * 0.5, startHalfH + 10, true, title);
- }
|