Программы на C++. Форум разработчиков
-
Anonymous
Проблема с обработкой ввода мыши в C++
Сообщение
Anonymous »
Код: Выделить всё
bool isOnBottom(){
float y_bottom = m_shape->getPosition().y + (m_shape->getSize() / 2);
float x_shapeRight = m_shape->getPosition().x + (m_shape->getSize() / 2);
float x_shapeLeft = m_shape->getPosition().x - (m_shape->getSize() / 2);
float mouse_x = sf::Mouse::getPosition(*m_window).x;
float mouse_y = sf::Mouse::getPosition(*m_window).y;
return((std::abs(mouse_y - y_bottom) = x_shapeLeft - 15) &&
(mouse_x getPosition().x + (m_shape->getSize() / 2);
float y_shapeBottom = m_shape->getPosition().y - (m_shape->getSize() / 2);
float y_shapeTop = m_shape->getPosition().y + (m_shape->getSize() / 2);
return((std::abs(mouse_x - x_right)
Подробнее здесь: [url]https://stackoverflow.com/questions/79814489/c-mouse-input-handleproblem[/url]
1762641630
Anonymous
[code] bool isOnBottom(){
float y_bottom = m_shape->getPosition().y + (m_shape->getSize() / 2);
float x_shapeRight = m_shape->getPosition().x + (m_shape->getSize() / 2);
float x_shapeLeft = m_shape->getPosition().x - (m_shape->getSize() / 2);
float mouse_x = sf::Mouse::getPosition(*m_window).x;
float mouse_y = sf::Mouse::getPosition(*m_window).y;
return((std::abs(mouse_y - y_bottom) = x_shapeLeft - 15) &&
(mouse_x getPosition().x + (m_shape->getSize() / 2);
float y_shapeBottom = m_shape->getPosition().y - (m_shape->getSize() / 2);
float y_shapeTop = m_shape->getPosition().y + (m_shape->getSize() / 2);
return((std::abs(mouse_x - x_right)
Подробнее здесь: [url]https://stackoverflow.com/questions/79814489/c-mouse-input-handleproblem[/url]