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

Author Topic: invalid use of 'struct sf::Event::MouseButtonEvent'  (Read 2061 times)

0 Members and 2 Guests are viewing this topic.

konig

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
invalid use of 'struct sf::Event::MouseButtonEvent'
« on: March 10, 2014, 04:26:25 am »
                    if (event.MouseButtonEvent.button == sf::Mouse::Left){
                       std::cout << "The left mouse button was pressed at X=" << event.MouseButtonEvent.x
                       << "Y=" << event.MouseButtonEvent.y<< "." << std::endl;
                     }

This is my code...

I got three errors, for all the places I used MouseButtonEvent. They all of which show the same error:
 invalid use of 'struct sf::Event::MouseButtonEvent'

Can somebody tell me where I'm going wrong..
Thank You

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: invalid use of 'struct sf::Event::MouseButtonEvent'
« Reply #1 on: March 10, 2014, 07:31:55 am »
Please read the tutorials / documentation.
Laurent Gomila - SFML developer

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
AW: invalid use of 'struct sf::Event::MouseButtonEvent'
« Reply #2 on: March 10, 2014, 07:33:32 am »
Maybe a look at the official tutorial will help you understand that your usage is wrong. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

konig

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: invalid use of 'struct sf::Event::MouseButtonEvent'
« Reply #3 on: March 18, 2014, 11:29:43 am »
Thanks a lot both of you..especially eXpl0it3r
Sorry for the delayed reply.

 

anything