-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUIGameOverScreen.cpp
67 lines (57 loc) · 1.37 KB
/
UIGameOverScreen.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
* UIGameOverScreen.cpp
* tractionedge
*
* Created by Steven Hamilton on 8/09/10.
* Copyright 2010 n/a. All rights reserved.
*
*/
#include "DisplayManager.h"
#include "GameWorld.h"
#include "UIGameOverScreen.h"
UIGameOverScreen::UIGameOverScreen()
{
defaultColor=COLORLIGHTGREY;
defaultFont=BODYSMALL;
defaultStyle=REGULAR;
defaultSize=FONTSIZESMALL;
}
UIGameOverScreen::~UIGameOverScreen(){}
event_t UIGameOverScreen::process(event_t event)
{
switch(event){
case KEY_RETURN:
event = EVENT_CONTINUE;
break;
default:
break;
}
return event;
}
void UIGameOverScreen::draw()
{
clearArrays();
std::string str="Game Over. Thank you for playing Traction Edge.";
Position pos(80,80);
addToArrays(str, pos, defaultColor, defaultFont, defaultStyle, defaultSize);
//send it off to draw
DISPLAY.gfxEngine.renderStrings(strings, colors, fonts, styles, sizes, positions);
}
void UIGameOverScreen::clearArrays()
{
strings.resize(0);
colors.resize(0);
positions.resize(0);
styles.resize(0);
sizes.resize(0);
fonts.resize(0);
}
void UIGameOverScreen::addToArrays(std::string str, Position pos, int col, font_t fnt, fontStyle_t style, int size)
{
strings.push_back(str);
positions.push_back(pos);
colors.push_back(col);
fonts.push_back(fnt);
styles.push_back(style);
sizes.push_back(size);
}