SFML community forums

Help => General => Topic started by: mihaineken on April 01, 2013, 01:11:07 pm

Title: mouse click's
Post by: mihaineken on April 01, 2013, 01:11:07 pm
Can anyone help me with a function that can count mouse left click's using SFML 2 ?
Thank you !
Title: Re: mouse click's
Post by: Nexus on April 01, 2013, 01:31:19 pm
Read the tutorial and documentation about events.
Title: Re: mouse click's
Post by: mihaineken on April 01, 2013, 02:12:49 pm
Read the tutorial and documentation about events.

Yes, I've done that and I still dont know how to do it.
Title: Re: mouse click's
Post by: G. on April 01, 2013, 02:20:07 pm
Well, what do you know then?
Do you know how to create a window?
Do you know how to use an event loop?
Do you know how to deal with the sf::Event::MouseButtonPressed?
Do you know how to increment a variable?

The tutorial covers each of these things (except the incrementation, but this is more than the basics of programming :D ) and this is all you need.
What don't you understand, and what do you already have? If you haven't even tried before asking for help, then you're using the internet wrong.
Title: Re: mouse click's
Post by: Nexus on April 01, 2013, 02:29:48 pm
Please read also this thread (http://en.sfml-dev.org/forums/index.php?topic=5559.0).
Title: Re: mouse click's
Post by: mihaineken on April 01, 2013, 02:38:05 pm
Please give me that function if you know how to do it.This is all I need.Thank you !
Title: Re: mouse click's
Post by: G. on April 01, 2013, 03:19:45 pm
Please give me that function if you know how to do it.This is all I need.Thank you !
Here it is, in the MouseButtonPressed and MouseButtonReleased events paragraph (http://www.sfml-dev.org/tutorials/2.0/window-events.php).
Title: Re: mouse click's
Post by: Grimshaw on April 01, 2013, 04:03:52 pm
O.o