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

Author Topic: mouse click's  (Read 1997 times)

0 Members and 1 Guest are viewing this topic.

mihaineken

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • Email
mouse click's
« 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 !

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: mouse click's
« Reply #1 on: April 01, 2013, 01:31:19 pm »
Read the tutorial and documentation about events.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

mihaineken

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • Email
Re: mouse click's
« Reply #2 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.

G.

  • Hero Member
  • *****
  • Posts: 1592
    • View Profile
Re: mouse click's
« Reply #3 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.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: mouse click's
« Reply #4 on: April 01, 2013, 02:29:48 pm »
Please read also this thread.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

mihaineken

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • Email
Re: mouse click's
« Reply #5 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 !

G.

  • Hero Member
  • *****
  • Posts: 1592
    • View Profile
Re: mouse click's
« Reply #6 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.

Grimshaw

  • Hero Member
  • *****
  • Posts: 631
  • Nephilim SDK
    • View Profile
Re: mouse click's
« Reply #7 on: April 01, 2013, 04:03:52 pm »
O.o