39 lines
783 B
C++
39 lines
783 B
C++
|
#include "bpmslider.h"
|
||
|
|
||
|
BPMSlider::BPMSlider(const std::shared_ptr<sf::Font> &font)
|
||
|
{
|
||
|
_bpm_value.setFont(*font);
|
||
|
}
|
||
|
|
||
|
void BPMSlider::input(const sf::Event& event)
|
||
|
{
|
||
|
Widget::input(event);
|
||
|
}
|
||
|
|
||
|
void BPMSlider::update(const sf::Time& dt)
|
||
|
{
|
||
|
Widget::update(dt);
|
||
|
}
|
||
|
|
||
|
void BPMSlider::draw(sf::RenderTarget& target, sf::RenderStates states) const
|
||
|
{
|
||
|
Widget::draw(target, states);
|
||
|
}
|
||
|
|
||
|
void BPMSlider::setRect(const sf::FloatRect& rect)
|
||
|
{
|
||
|
_slider_background.setPosition(rect.left, rect.top);
|
||
|
_slider_background.setSize({rect.width, rect.height});
|
||
|
}
|
||
|
|
||
|
void BPMSlider::setPosition(const sf::Vector2f& position)
|
||
|
{
|
||
|
_slider_background.setPosition(position);
|
||
|
}
|
||
|
|
||
|
bool BPMSlider::isUnderMouse(int mouse_x, int mouse_y) const
|
||
|
{
|
||
|
return mouse_x == mouse_y; // just to compile
|
||
|
}
|
||
|
|