bool Widget::IsClicked()
{
if(IsHover() && EngineManager::GetInstance()->Event->MouseState().isButtonPressed)
return true;
return false;
}
bool Widget::IsClickedReleased()
{
if(EngineManager::GetInstance()->Event->MouseState().isButtonReleased)
return true;
return false;
}
Mouse EventEngine::MouseState()
{
if(sf::Mouse::isButtonPressed(sf::Mouse::Left))
{
mouse.isButtonPressed = true;
}
else if(event->type == sf::Event::MouseButtonReleased)
{
mouse.isButtonReleased = true;
}
else
{
mouse.isButtonPressed = false;
mouse.isButtonReleased = false;
}
mouse.pos = sf::Mouse::getPosition(*Win);
return mouse;
}
EDIT : Finalement ça fonctionne
Désole du dérangement