diff options
Diffstat (limited to 'src/View/MainWindow.cpp')
| -rw-r--r-- | src/View/MainWindow.cpp | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/src/View/MainWindow.cpp b/src/View/MainWindow.cpp index 274fc8e..a381bc5 100644 --- a/src/View/MainWindow.cpp +++ b/src/View/MainWindow.cpp @@ -6,12 +6,16 @@ MainWindow::MainWindow(int width, int height, std::string title): - RenderWindow(sf::VideoMode(width,height), title), - skin() + RenderWindow(sf::VideoMode(width,height), title,sf::Style::Titlebar | sf::Style::Close), + m_skin(), + m_windowMargin(10), + m_sizeCell(120), + m_spaceBetweenCell(10) { - + //Define skin: - skin.push_back(sf::Color(250,248,239)); + m_skin.push_back(sf::Color(250,248,239)); //Background MainWindow + m_skin.push_back(sf::Color(205,192,180)); //Background cells } @@ -20,6 +24,23 @@ MainWindow::MainWindow(int width, int height, std::string title): MainWindow::~MainWindow(){ } -void MainWindow::clearMW(){ - RenderWindow::clear(skin.at(0)); +void MainWindow::clearBG(){ + RenderWindow::clear(m_skin.at(0)); +} + + +void MainWindow::drawCells(){ + + for(int i=0;i<4;i++){ + + for(int j=0;j<4;j++){ + sf::RectangleShape cell(sf::Vector2f(m_sizeCell, m_sizeCell)); + cell.setFillColor(m_skin.at(1)); + int centerOffset=(800-(3*m_spaceBetweenCell+4*m_sizeCell))/2; + int distanceBetweenTopAndGrid=200; + cell.setPosition(centerOffset+j*(m_sizeCell+m_spaceBetweenCell),distanceBetweenTopAndGrid+i*(m_sizeCell+m_spaceBetweenCell)); + RenderWindow::draw(cell); + } + + } } |
