Skip to content

Commit

Permalink
remove some song and gui test
Browse files Browse the repository at this point in the history
  • Loading branch information
Hopson97 committed May 14, 2017
1 parent ecc3892 commit b9be0f2
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 4 deletions.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion Source/GUI/Button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace GUI
std::function<void(void)> function)
: m_function (function)
{
m_quad.setSize({500, 100});
m_quad.setSize({BASE_WIDTH, BASE_HEIGHT});
m_quad.setTexture(&Component::guiTexture);
m_quad.setOutlineColor(sf::Color::Black);
m_quad.setOutlineThickness(4);
Expand Down
3 changes: 3 additions & 0 deletions Source/GUI/Component.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ namespace GUI
class Component
{
public:
static constexpr int BASE_WIDTH = 500;
static constexpr int BASE_HEIGHT = 100;

Component();
virtual ~Component(){}

Expand Down
2 changes: 1 addition & 1 deletion Source/GUI/Imaged_Button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace GUI
std::function<void(void)>function)
: m_function (function)
{
m_quad.setSize({800, 150});
m_quad.setSize({BASE_WIDTH, BASE_HEIGHT});
m_quad.setTexture(&Component::guiTexture);
m_quad.setOutlineColor(sf::Color::Black);
m_quad.setOutlineThickness(2);
Expand Down
19 changes: 19 additions & 0 deletions Source/GUI/Panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,26 @@ namespace GUI

void Panel::addComponentGrid2x(std::unique_ptr<Component>& component)
{
if(m_2xCount == 2)
{
m_currentY += Component::BASE_HEIGHT;
m_2xRow++;
m_2xCount = 0;
}
m_2xCount++;

static auto w = Component::BASE_WIDTH;
if (m_isGrid2xleft)
{
component->setPosition({Display::get().getSize().x / 2 - component->getSize().x / 2 - w / 2,
float(m_currentY) });
}
else
{
component->setPosition({Display::get().getSize().x / 2 + component->getSize().x / 2 + w / 2,
float(m_currentY) });
}
m_isGrid2xleft = !m_isGrid2xleft;
}


Expand Down
4 changes: 4 additions & 0 deletions Source/GUI/Panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ namespace GUI
int m_currentX = 0;
int m_currentY = 15;

bool m_isGrid2xleft = true;
int m_2xRow = 0;
int m_2xCount = 0;

};
}

Expand Down
2 changes: 1 addition & 1 deletion Source/GUI/Toggle_Option_Button.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace GUI
, m_pOption (&option)
, m_label (std::move(title))
{
m_quad.setSize({500, 100});
m_quad.setSize({BASE_WIDTH, BASE_HEIGHT});
m_quad.setTexture(&Component::guiTexture);
m_quad.setOutlineColor(sf::Color::Black);
m_quad.setOutlineThickness(4);
Expand Down
2 changes: 1 addition & 1 deletion Source/States/SPlaying.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ namespace State
return
{
centre,
m_world.getHeightAt({centre, 0, centre}) + 3,
200, //m_world.getHeightAt({centre, 0, centre}) + 3,
centre
};
}
Expand Down

0 comments on commit b9be0f2

Please sign in to comment.