hi
i made a bitmap and sf::text button
class Button : public sf::Drawable, public sf::Transformable
with position and size being
sf::FloatRect m_shape;
initialized like this and origin is set in the constructor to be le middle
mylib::Button button(sf::FloatRect(320, 200 ,150, 100), texture, sf::Vector2f(230, 1600));
button.rotate(90);
button.setButtonType(mylib::Button::ButtonType::release);
button.setScale(sf::Vector2f(2,2));
button.setFont("OneSlot.ttf");
button.setTextSize(30);
button.setTextColor(sf::Color::Red);
button.setText("the button");
my pb is i don't have a getGlobalBounds() available
so i tried this
sf::FloatRect Button::getGlobalBounds() const
{
return getTransform().transformRect(m_shape);
}
width and height are good but left = -180 and top = 690
how do i have the good values ??
thx