Snoke
logo.cpp
Go to the documentation of this file.
1 #include "logo.h"
2 
8 void Logo::setPosition(int left, int top)
9 {
10  x = left;
11  y = top;
12 }
13 
19 {
20  Point size;
21  size.x = strlen(inscription[language][0]);
22  size.y = 5;
23 
24  return size;
25 }
26 
30 void Logo::draw()
31 {
32  init_color(COLOR_WHITE, 1000, 1000, 1000);
33  init_pair(1, style.fg, style.bg);
34  init_pair(2, shadowStyle.fg, shadowStyle.bg);
35 
36  for (int rowCounter = 0; rowCounter < 5; rowCounter++)
37  {
38  for (int colCounter = 0; colCounter < (int)strlen(inscription[language][0]); colCounter++)
39  {
40  if (inscription[language][rowCounter][colCounter] != ' ')
41  {
42  move(y + rowCounter, x + colCounter);
43  attron(COLOR_PAIR(1));
44  addch(style.letter);
45  attroff(COLOR_PAIR(1));
46 
47  attron(COLOR_PAIR(2));
48  move(y + rowCounter + 1, x + colCounter + 1);
49  addch(shadowStyle.letter);
50  attroff(COLOR_PAIR(2));
51  }
52  }
53  }
54 }
55 
62  x(x), y(y), style(style), shadowStyle(shadowStyle), language(language)
63 {
64  inscription.push_back(
65  {
66  " **** * * *** * * ****",
67  "* ** * * * * * * ",
68  " *** * * * * * **** ****",
69  " * * ** * * * * * ",
70  "**** * * *** * * ****"
71  });
72 
73  inscription.push_back(
74  {
75  "**** * * * * *** ",
76  " * ** ** * ** * *",
77  " ** * * * * * * * *",
78  " * * * ** * ****",
79  "**** * * * * * *"
80  });
81 }
PointStyle shadowStyle
Definition: logo.h:21
Point getSize()
Definition: logo.cpp:18
int x
Definition: logo.h:20
short x
Definition: common.h:55
void draw()
Definition: logo.cpp:30
Logo(int x, int y, PointStyle style, PointStyle shadowStyle, int language)
Definition: logo.cpp:61
int y
Definition: logo.h:20
PointStyle style
Definition: logo.h:21
std::vector< std::vector< const char * > > inscription
Definition: logo.h:23
int fg
Definition: common.h:41
Style of the cell in console window.
Definition: common.h:37
short y
Definition: common.h:56
char letter
Definition: common.h:40
int bg
Definition: common.h:42
Coordinates and style of the cell in console window.
Definition: common.h:52
short language
Definition: logo.h:22
void setPosition(int x, int y)
Definition: logo.cpp:8