Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. void GUI::CreateButtonList(sf::Vector2f position, sf::Vector2f size, int xCount, int yCount, float spacing) {
  2. for(int y = 1; y<yCount+1; y++) {
  3. for(int x = 1; x<xCount+1; x++) {
  4. std::unique_ptr<struct ButtonListSettings> bls (new struct ButtonListSettings()); //here's the problem, I think
  5. bls->button.setSize(sf::Vector2f((size.x / (float)xCount)-spacing, (size.y / (float)yCount)-spacing));
  6. bls->button.setPosition(((x * size.x/xCount))+position.x, ((y * size.y/yCount))+position.y);
  7. bls->button.setFillColor(sf::Color::White);
  8. buttonList.push_back(std::move(bls));
  9. }
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement