forked from NaiJi/project-kyoku
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
765 B
C++
28 lines
765 B
C++
#pragma once
|
|
|
|
#include "widget.h"
|
|
#include "menudrop.h"
|
|
#include "button.h"
|
|
|
|
#include <SFML/Graphics/RectangleShape.hpp>
|
|
|
|
class MenuBar : public Widget
|
|
{
|
|
public:
|
|
explicit MenuBar();
|
|
|
|
virtual void input(const sf::Event& event) override;
|
|
virtual void update() override;
|
|
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const override;
|
|
virtual void setRect(const sf::FloatRect& rect) override;
|
|
virtual void setPosition(const sf::Vector2f& position) override;
|
|
virtual bool isUnderMouse(int mouse_x, int mouse_y) const override;
|
|
|
|
void addSubMenu(std::string name, const std::shared_ptr<MenuDrop>& submenu);
|
|
|
|
private:
|
|
sf::RectangleShape _bar_rect;
|
|
std::size_t _amount_buttons;
|
|
std::size_t _button_width;
|
|
};
|