Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - pizzatime12

Pages: [1]
1
General / simple mouse position getter not working
« on: December 18, 2017, 03:31:44 am »
Quote
sf::Vector2i pixelPos = sf::Mouse::getPosition(window);
   if ( pixelPos.x > 378
      && pixelPos.x < 611
      && pixelPos.y > 385
      && pixelPos.y < 490 )
   {
      window.draw(spritePlay);
   }
   else if (pixelPos.x > 299
      && pixelPos.x < 704
      && pixelPos.y > 505
      && pixelPos.y < 623
      )
   {
      window.draw(spriteDontPlay);
   }
   else {
      window.draw(sprite);
   }

this section of code runs every frame on the main menu. "sprite" is displayed the whole time, and spriteDontPlay and spritePlay are never shown.

Pages: [1]