summaryrefslogtreecommitdiff
path: root/src/View/MainWindow.cpp
diff options
context:
space:
mode:
authormanzerbredes <loic.guegan_secondary@yahoo.fr>2015-05-03 15:12:46 +0200
committermanzerbredes <loic.guegan_secondary@yahoo.fr>2015-05-03 15:12:46 +0200
commit7f0edabb5dff0e88d33cd8855eacda07aa17b1ca (patch)
treeeb13ff258201f8ec7cad3d670fd244de5684bae0 /src/View/MainWindow.cpp
parentce3f721e16c779d519c04469e49a65f60546ab8d (diff)
Quickly draw basic grid (no reliable code)
Diffstat (limited to 'src/View/MainWindow.cpp')
-rw-r--r--src/View/MainWindow.cpp33
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);
+ }
+
+ }
}