Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void GUI::CreateButtonList(sf::Vector2f position, sf::Vector2f size, int xCount, int yCount, float spacing) {
- for(int y = 1; y<yCount+1; y++) {
- for(int x = 1; x<xCount+1; x++) {
- std::unique_ptr<struct ButtonListSettings> bls (new struct ButtonListSettings()); //here's the problem, I think
- bls->button.setSize(sf::Vector2f((size.x / (float)xCount)-spacing, (size.y / (float)yCount)-spacing));
- bls->button.setPosition(((x * size.x/xCount))+position.x, ((y * size.y/yCount))+position.y);
- bls->button.setFillColor(sf::Color::White);
- buttonList.push_back(std::move(bls));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement