using std::vector;
int main(int argc, char **argv) {
- const int width = 800;
- const int height = 480;
+ const int width = 512;
+ const int height = 448;
const float walkSpeed = 128.0f;
graphics::Sprite statusLabels(IMG_Load("test-data/status-labels.png"), 32, 16);
menuResources.statusLabels = &statusLabels;
+ graphics::Frame statusFrame(IMG_Load("test-data/status-frame.png"), 32, 32, 32, 32);
+ menuResources.statusFrame = &statusFrame;
+
InitScreen screen(width, height);
app::State *state(0);
#include "../common/GameState.h"
#include "../geometry/Vector.h"
#include "../graphics/Font.h"
+#include "../graphics/Frame.h"
#include "../graphics/Texture.h"
using app::Input;
void PartyMenu::Render(SDL_Surface *screen) {
Res().menubg->Render(screen, Vector<int>(), Vector<int>(screen->w, screen->h));
- RenderHeros(screen, Vector<int>());
+ RenderHeros(screen, Vector<int>(Res().normalFont->CharWidth(), 2 * Res().normalFont->CharHeight()));
+ RenderMenu(screen, Vector<int>(8 * Res().normalFont->CharWidth(), 13 * Res().normalFont->CharHeight() + Res().normalFont->CharHeight() / 8));
+ RenderInfo(screen, Vector<int>(14 * Res().normalFont->CharWidth(), 21 * Res().normalFont->CharHeight() + Res().normalFont->CharHeight() / 8));
}
void PartyMenu::RenderHeros(SDL_Surface *screen, const geometry::Vector<int> &offset) const {
}
}
+void PartyMenu::RenderMenu(SDL_Surface *screen, const geometry::Vector<int> &offset) const {
+ Res().statusFrame->Draw(screen, offset, 23 * Res().normalFont->CharWidth(), 8 * Res().normalFont->CharHeight());
+}
+
+void PartyMenu::RenderInfo(SDL_Surface *screen, const geometry::Vector<int> &offset) const {
+ Res().statusFrame->Draw(screen, offset, 17 * Res().normalFont->CharWidth(), 5 * Res().normalFont->CharHeight());
+}
+
Resources &PartyMenu::Res() {
return *game->menuResources;
virtual void OnResize(int width, int height);
void RenderHeros(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
+ void RenderMenu(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
+ void RenderInfo(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
private:
HeroStatus status[4];