SFML community forums

Help => Graphics => Topic started by: konig on March 10, 2014, 04:26:25 am

Title: invalid use of 'struct sf::Event::MouseButtonEvent'
Post by: konig 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
Title: Re: invalid use of 'struct sf::Event::MouseButtonEvent'
Post by: Laurent on March 10, 2014, 07:31:55 am
Please read the tutorials / documentation.
Title: AW: invalid use of 'struct sf::Event::MouseButtonEvent'
Post by: eXpl0it3r on March 10, 2014, 07:33:32 am
Maybe a look at the official tutorial (http://www.sfml-dev.org/tutorials/2.1/window-events.php) will help you understand that your usage is wrong. ;)
Title: Re: invalid use of 'struct sf::Event::MouseButtonEvent'
Post by: konig on March 18, 2014, 11:29:43 am
Thanks a lot both of you..especially eXpl0it3r
Sorry for the delayed reply.